var ta=Object.defineProperty;var Ar=(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 ra=(e,t)=>()=>(e&&(t=e(e=0)),t);var na=(e,t)=>{for(var r in t)ta(e,r,{get:t[r],enumerable:!0})};var No={};na(No,{preCache:()=>_l,snapdom:()=>Z});function ia(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 Xn(e="soft"){switch(x.session.__counterEpoch=(x.session.__counterEpoch||0)+1,e){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.baseStyle=new me(50),x.defaultStyle=new me(30),x.image=new me(100),x.background=new me(100),x.resource=new me(150),x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}function Hr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function aa(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 Ut(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function sa(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}}function la(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 ca(e){return/^data:|^blob:|^about:blank$/i.test(e)}function ua(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 da(e,t){if(!t||ca(e)||ua(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 fa(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Ut(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}${Ut(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function Tn(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 ma(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function be(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:([^,]*),(.*)$/)||[],b=/;base64/i.test(h)?atob(y):decodeURIComponent(y),S=new Uint8Array([...b].map(v=>v.charCodeAt(0))),w=new Blob([S],{type:(h||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:e,fromCache:!1,mime:w.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(),b=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await Tn(y),status:h.status,url:e,fromCache:!1,mime:b}:r==="text"?{ok:!0,data:await y.text(),status:h.status,url:e,fromCache:!1,mime:b}:{ok:!0,data:y,status:h.status,url:e,fromCache:!1,mime:b}}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=ma(e,{as:r,timeout:n,useProxy:o,errorTTL:i}),l=bt.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&bt.delete(c);let u=Dt.get(c);if(u)return u;let d=da(e,o)?fa(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 p=new AbortController,g=setTimeout(()=>p.abort("timeout"),n),m=(async()=>{try{let h=await fetch(d,{signal:p.signal,credentials:f,headers:a});if(!h.ok){let S={ok:!1,data:null,status:h.status,url:d,fromCache:!1,reason:"http_error"};if(i>0&&bt.set(c,{until:Date.now()+i,result:S}),!s){let w=`${h.status} ${h.statusText||""}`.trim();Mr.warnOnce(`http:${h.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${r} ${e}`)}return t.onError&&t.onError(S),S}if(r==="text")return{ok:!0,data:await h.text(),status:h.status,url:d,fromCache:!1};let y=await h.blob(),b=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await Tn(y),status:h.status,url:d,fromCache:!1,mime:b}:{ok:!0,data:y,status:h.status,url:d,fromCache:!1,mime:b}}catch(h){let y=h&&typeof h=="object"&&"name"in h&&h.name==="AbortError"?String(h.message||"").includes("timeout")?"timeout":"abort":"network",b={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&bt.set(c,{until:Date.now()+i,result:b}),!s){let S=`${y}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,w=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`;Mr.errorOnce(S,w)}return t.onError&&t.onError(b),b}finally{clearTimeout(g),Dt.delete(c)}})();return Dt.set(c,m),m}async function Br(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=Hr(e);if(!r)return e;let n=sa(r),o=Ut(n);if(x.background.has(o)){let i=x.background.get(o);return i?`url("${i}")`:"none"}try{let i=await be(o,{as:"dataURL",useProxy:t.useProxy});return i.ok?(x.background.set(o,i.data),`url("${i.data}")`):(x.background.set(o,null),"none")}catch{return x.background.set(o,null),"none"}}function ha(){for(let e of Qn){let t=String(e).toLowerCase();Vr.has(t)||zt.has(t)||Jn(t)}}function Jn(e){if(e=String(e).toLowerCase(),zt.has(e)){let i={};return x.defaultStyle.set(e,i),i}if(x.defaultStyle.has(e))return x.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(Ur(i))continue;let a=n.getPropertyValue(i);o[i]=a}return t.removeChild(r),x.defaultStyle.set(e,o),o}function Ur(e){let t=String(e).toLowerCase();return!!(ro.has(t)||to.test(t)||eo.test(t))}function kr(e,t){if(t=String(t||"").toLowerCase(),zt.has(t))return"";let r=[],n=Jn(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(Ur(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 ga(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 ya(e){let t=new Map;for(let n of e){let o=x.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} }
`;return r}function ba(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 wa(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 xe(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=x.computedStyle.get(e);n||(n=new Map,x.computedStyle.set(e,n));let o=n.get(t);if(!o){let i=wa(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 Mn(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);return t}function Nr(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}function nt(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Sa(){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 Te(){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 Ca(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}function G(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))}function va(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Ea(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Ia(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Aa(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 xa(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 ao(e){let t=Aa(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=xa(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 Ta(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${ao(n)}}`)}function Ma(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,Ta(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${ao(n)}${r}`),e}function ka(e){if(!Te()||!va(e))return e;try{let t=Ea(e),r=Ma(t);return Ia(r)}catch{return e}}async function Kt(e,t){let{width:r,height:n,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s}=t;e=ka(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,p,g,m=Number.isFinite(r),h=Number.isFinite(n);if(m&&h)p=Math.max(1,r),g=Math.max(1,n);else if(m){let S=r/Math.max(1,d);p=r,g=f*S}else if(h){let S=n/Math.max(1,f);g=n,p=d*S}else p=l,g=u;p=p*o,g=g*o;let y=document.createElement("canvas");y.width=p*i,y.height=g*i,y.style.width=`${p}px`,y.style.height=`${g}px`;let b=y.getContext("2d");return i!==1&&b.scale(i,i),s&&(b.save(),b.fillStyle=s,b.fillRect(0,0,p,g),b.restore()),b.drawImage(c,0,0,p,g),y}async function so(e,t){let r=await Kt(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}async function kn(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(Te()&&c)return await so(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){G(t,"SVG width/height patch in toImg failed",f)}}return l}async function co(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 Kt(e,t);return new Promise(o=>n.toBlob(i=>o(i),`image/${r}`,t.quality))}async function Rn(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 Na(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=Sa();if(a==="svg"){let f=await co(e,{...c,type:"svg"});if(l&&await Rn(f,s))return;let p=URL.createObjectURL(f),g=document.createElement("a");g.href=p,g.download=s,document.body.appendChild(g),g.click(),URL.revokeObjectURL(p),g.remove();return}let u=await Kt(e,c);if(l){let f=`image/${a}`,p=await new Promise(g=>u.toBlob(g,f,t?.quality));if(p&&await Rn(p,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()}function wt(){Lr++,Ct.size>La&&Ct.clear()}function Oa(e=document.documentElement){if(!On){On=!0;try{new MutationObserver(()=>wt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>wt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",wt),t.ready?.then(()=>wt()).catch(()=>{}))}catch{}}}function Fa(e,t={}){let r={},n=e.getPropertyValue("visibility"),o=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(Ur(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let p=e.getPropertyValue(f);(f==="background-image"||f==="content")&&p.includes("url(")&&!p.includes("data:")&&(p="none"),r[f]=p}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 p=e.getPropertyValue(f);p&&(r[f]=p)}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",p=["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 g of p)delete r[g];f||(r.border="none")}return r}function _a(e){let t=Fn.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(";"),Fn.set(e,t),t)}function Da(e,t=null,r={}){let n=Ln.get(e);if(n&&n.epoch===Lr)return n.snapshot;let o=t||getComputedStyle(e),i=Fa(o,r);return Va(e,o,i),Ln.set(e,{epoch:Lr,snapshot:i}),i}function Pa(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Ct,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||{}}:{session:x.session,persist:{snapshotKeyCache:Ct,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||t||{}}}function $a(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 Ge(e,t,r,n){if(e.tagName==="STYLE")return;let o=Pa(r,n),i=o.options&&o.options.cache||"auto";i!=="disabled"&&Oa(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(wt(),Ct.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")&&$a(e,t,c);let l=Da(e,c,o.options),u=_a(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=kr(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function Wa(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Ha(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 Ba(e){let t=e.parentElement;if(!t)return!1;let r=getComputedStyle(t).display||"";return r.includes("flex")||r.includes("grid")}function Ua(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 Va(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")||Wa(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||Ha(t)||Ba(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"||Ua(e,t)&&(delete r.height,delete r["block-size"])}function Ga(e,t){let r=t+"::"+e.toLowerCase(),n=_n.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 mo)c[l]=s.getPropertyValue(l)||"";return a.remove(),_n.set(r,c),c}function za(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=Ga(e.tagName,i);for(let s of mo){let c=o.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}function xr(e,t,r){return Promise.all(e.map(n=>new Promise(o=>{function i(){nt(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,o):i()},{fast:r})}i()})))}function Ka(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function ja(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?Ka(n):n;return`:where(${t} ${o})`}).join(", ")}function Ya(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=ja(i,t,!0);return`${n}${o}${a}{`}),e):""}function qa(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Za(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
`});let r=e.adoptedStyleSheets||[];for(let n of r)try{if(n&&n.cssRules)for(let o of n.cssRules)t+=o.cssText+`
`}catch{}}catch{}return t}function Xa(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 Ja(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 Qa(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 es(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 ts(e,t,r){let n=[];for(let o of t){let i=es(e,o);i&&n.push(`${o}: ${i};`)}return n.length?`${r}{${n.join("")}}
`:""}function rs(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 ns(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 os(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 Ae(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 is(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 as(e,t,r){let n=await ns(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=os(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=is(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),Ge(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 ss(e){let{width:t,height:r}=Ae(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,p=!!e.indeterminate,g=Math.max(Math.min(l,u),12),m="middle";try{o&&o.verticalAlign&&(m=o.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),h.style.cssText=`display:inline-block;width:${g}px;height:${g}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(g)),y.setAttribute("height",String(g)),y.setAttribute("viewBox",`0 0 ${g} ${g}`),h.appendChild(y);function b(){let S="#0a6ed1";try{o&&(S=o.accentColor||o.color||S)}catch{}let w=2,v=w/2,E=g-w;if(y.innerHTML="",d){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(v)),C.setAttribute("y",String(v)),C.setAttribute("width",String(E)),C.setAttribute("height",String(E)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",f?S:"none"),C.setAttribute("stroke",S),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let I=document.createElementNS("http://www.w3.org/2000/svg","path");I.setAttribute("d",`M ${v+2} ${g/2} L ${g/2-1} ${g-v-2} L ${g-v-2} ${v+2}`),I.setAttribute("stroke","white"),I.setAttribute("stroke-width",String(Math.max(1.5,w))),I.setAttribute("fill","none"),I.setAttribute("stroke-linecap","round"),I.setAttribute("stroke-linejoin","round"),y.appendChild(I)}else if(p){let I=document.createElementNS("http://www.w3.org/2000/svg","rect"),N=Math.max(6,E-4);I.setAttribute("x",String((g-N)/2)),I.setAttribute("y",String((g-w)/2)),I.setAttribute("width",String(N)),I.setAttribute("height",String(w)),I.setAttribute("fill",S),I.setAttribute("rx","1"),y.appendChild(I)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(g/2)),C.setAttribute("cy",String(g/2)),C.setAttribute("r",String((g-w)/2)),C.setAttribute("fill",f?S:"none"),C.setAttribute("stroke",S),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let I=document.createElementNS("http://www.w3.org/2000/svg","circle"),N=Math.max(2,(g-w*2)*.35);I.setAttribute("cx",String(g/2)),I.setAttribute("cy",String(g/2)),I.setAttribute("r",String(N)),I.setAttribute("fill","white"),y.appendChild(I)}}h.style.setProperty("width",`${g}px`,"important"),h.style.setProperty("height",`${g}px`,"important"),h.style.setProperty("min-width",`${g}px`,"important"),h.style.setProperty("min-height",`${g}px`,"important")}return b(),{el:h,applyVisual:b}}async function St(e){if(x.resource?.has(e))return x.resource.get(e);if(yt.has(e))return yt.get(e);let t=(async()=>{let r=await be(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return x.resource?.set(e,r.data),r.data})();yt.set(e,t);try{let r=await t;return yt.set(e,r),r}catch(r){throw yt.delete(e),r}}async function Dn(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(ls)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let o=await St(n);r=r.split(n).join(o)}catch{}return r}function _t(e){return typeof e=="string"&&e.startsWith("blob:")}function cs(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 us(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function ds(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(_t(l)){let d=await St(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=cs(u),f=!1;for(let p of d)if(_t(p.url))try{p.url=await St(p.url),f=!0}catch(g){G(r,"blobUrlToDataUrl for srcset item failed",g)}f&&c.setAttribute("srcset",us(d))}}catch(l){G(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(_t(u)){let d=await St(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){G(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 Dn(l);c.setAttribute("style",u)}}catch(l){G(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 Dn(l))}catch(l){G(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);_t(d)&&u.setAttribute(c,await St(d))}catch(d){G(r,`resolveBlobUrls for ${c} failed`,d)}}}async function Wt(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")||Vr.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return G(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}=Ae(e),p=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${p}px;height:${g}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:p}=Ae(e),g=f||e.getBoundingClientRect().width||0,m=p||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${g}px;height:${m}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}=Ae(e),p=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${p}px;height:${g}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){G(t,"iframe same-origin probe failed",d)}if(u)try{return await as(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}=Ae(e),p=document.createElement("div");return p.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;`,Ge(e,p,t,r),p}else{let{width:d,height:f}=Ae(e),p=document.createElement("div");return p.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Ge(e,p,t,r),p}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Ge(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 g=e.getContext("2d",{willReadFrequently:!0});try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(m=>requestAnimationFrame(m)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(m=>requestAnimationFrame(m)),u=e.toDataURL("image/png"),!u||u==="data:,"){let m=document.createElement("canvas");m.width=e.width,m.height=e.height;let h=m.getContext("2d");h&&(h.drawImage(e,0,0),u=m.toDataURL("image/png"))}}}catch(g){G(t,"Canvas toDataURL failed, using empty/fallback",g)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(g){G(t,"img decoding/loading hints failed",g)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:p}=Ae(e);return f>0&&(d.style.width=`${f}px`),p>0&&(d.style.height=`${p}px`),t.nodeMap.set(d,e),Ge(e,d,t,r),d}if(e.tagName==="VIDEO"){let u="";try{let g=document.createElement("canvas");g.width=e.videoWidth||e.offsetWidth||320,g.height=e.videoHeight||e.offsetHeight||240;let m=g.getContext("2d");m&&(m.drawImage(e,0,0,g.width,g.height),u=g.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(g){G(t,"Video frame capture failed, using poster fallback",g)}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:p}=Ae(e);return f>0&&(d.style.width=`${f}px`),p>0&&(d.style.height=`${p}px`),d.style.objectFit="contain",t.nodeMap.set(d,e),Ge(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(za(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Ja(e,a);try{let{width:u,height:d}=Ae(e),f=Math.round(u||0),p=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),p&&(a.dataset.snapdomHeight=String(p))}catch(u){G(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=S=>{let w=u.match(new RegExp(`${S}\\s*:\\s*([^;]+)`,"i")),v=w?w[1].trim():d.getPropertyValue(S);return/%|auto/i.test(String(v||""))},p=parseInt(a.dataset.snapdomWidth||"0",10),g=parseInt(a.dataset.snapdomHeight||"0",10),m=f("width")||!p,h=f("height")||!g;m&&p&&(a.style.width=`${p}px`),h&&g&&(a.style.height=`${g}px`);let y=d.getPropertyValue("object-fit"),b=d.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,b&&(a.style.objectPosition=b)):(p&&(a.style.minWidth=`${p}px`),g&&(a.style.minHeight=`${g}px`))}catch(u){G(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}=Ae(e),f=u||e.getBoundingClientRect().width||0,p=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),p&&(a.style.height=`${p}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&Ca()){let{el:d,applyVisual:f}=ss(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 p=document.createElement("style");p.textContent=`.${f}::placeholder{color:${d}!important;opacity:${u.opacity||"1"}!important;}`,a.prepend(p)}}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(Ge(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 p=d.getPropertyValue(f);p&&a.style.setProperty(f,p)}}catch{}}if(e.shadowRoot){let u=function(S,w){if(S.nodeType===Node.ELEMENT_NODE&&S.tagName==="STYLE")return w(null);Wt(S,t,r).then(v=>{w(v||null)}).catch(()=>{w(null)})};try{let S=e.shadowRoot.querySelectorAll("slot");for(let w of S){let v=[];try{v=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{v=w.assignedNodes?.()||[]}for(let E of v)n.add(E)}}catch{}let d=qa(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let p=Za(e.shadowRoot),g=Ya(p,f),m=Qa(p),h=ts(e,m,f);Xa(a,h+g,d);let y=document.createDocumentFragment(),b=await xr(Array.from(e.shadowRoot.childNodes),u,r.fast);y.append(...b.filter(S=>!!S)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(m,h){Wt(m,t,r).then(y=>{y&&rs(y),h(y||null)}).catch(()=>{h(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),p=document.createDocumentFragment(),g=await xr(Array.from(f),u,r.fast);return p.append(...g.filter(m=>!!m)),p}function c(u,d){if(n.has(u))return d(null);Wt(u,t,r).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await xr(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}function ms(e){let t=Array.isArray(e)?e:[e];for(let r of t)r instanceof RegExp?Or.push(r):typeof r=="string"?Or.push(new RegExp(r,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r)}function Oe(e){let t=typeof e=="string"?e:"",r=[...fs,...Or];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 ps(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}function hs(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 gs(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"&&tt.materialIconsFilled?l={url:tt.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&tt.materialIconsRound?l={url:tt.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&tt.materialIconsSharp&&(l={url:tt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:n,familyForCanvas:n};if(!Pn.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),Pn.set(l.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function ys(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function bs(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 ws(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=hs(i),{familyForMeasure:u,familyForCanvas:d}=await gs(s,a,l);await ys(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 p=f.getBoundingClientRect(),g=Math.max(1,Math.ceil(p.width)),m=Math.max(1,Math.ceil(p.height));document.body.removeChild(f);let h=document.createElement("canvas");h.width=g*c,h.height=m*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:g,height:m}}async function Ss(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(!ps(u))continue;let d=(c||s).textContent.trim();if(!d)continue;let f=parseInt(l.fontSize,10)||24,p=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",g=bs(l),m=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",h=(c||s).className||"",{dataUrl:y,width:b,height:S}=await ws(d,{family:u,weight:p,fontSize:f,color:g,variation:m,className:h});s.textContent="";let w=s.ownerDocument.createElement("img");w.src=y,w.alt=d,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(b/S*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(w),i++}catch{}}return i}async function Cs(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}}function Gr(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!po.has(r.toLowerCase()))return r}return""}function Es(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(po.has(n.toLowerCase())||t.push(n))}return t}function Ht(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 Bt(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Is(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function As(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let o=Ht(r[1]),i=Ht(r[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let n=Ht(t);return{min:n,max:n}}function xs(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Ts(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 Ms(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ks(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)||vs.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=Ms(a);if(i.includes(s)||i.includes(c)||l&&i.includes(l))return!0}return!1}catch{return!1}}function Ns(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function $n(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}")`})}async function Rs(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>Vt)return console.warn(`[snapDOM] @import depth exceeded (${Vt}) at ${c}`),s;let u="",d=0,f;for(;f=Fr.exec(s);){u+=s.slice(d,f.index),d=Fr.lastIndex;let p=(f[2]||f[4]||"").trim(),g=o(p,c);if(n.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}n.add(g);let m="";try{let h=await be(g,{as:"text",useProxy:r,silent:!0});h.ok&&typeof h.data=="string"&&(m=h.data)}catch{}m?(m=$n(m,g),m=await i(m,g,l+1),u+=`
/* inlined: ${g} */
${m}
`):u+=f[0]}return u+=s.slice(d),u}let a=$n(e,t||location.href);return a=await i(a,t||location.href,0),a}function go(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 yo(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 zr(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(ho)){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 bo(e,t,r=""){let n=e;for(let o of e.matchAll(ho)){let i=Hr(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(!Oe(a)){if(x.resource?.has(a)){x.font?.add(a),n=n.replace(o[0],`url(${x.resource.get(a)})`);continue}if(!x.font?.has(a))try{let s=await be(a,{as:"dataURL",useProxy:r,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;x.resource?.set(a,c),x.font?.add(a),n=n.replace(o[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function Os(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 Wn(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=Os(i);if(a&&n.has(a))return!0}return!1}}function Fs(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=Gr(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(),p=zr(f,location.href),g=p.length?p.map(h=>String(h).toLowerCase()).sort().join("|"):f.toLowerCase(),m=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),g].join("|");r.has(m)||(r.add(m),n.push(i))}if(n.length===0)return e;let o=0;return e.replace(t,()=>n[o++]||"")}function _s(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 wo(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>=Vt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Vt}) 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 wo(a.styleSheet,s,r,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=Gr(s);if(!c||Oe(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(),p=(a.style.getPropertyValue("unicode-range")||"").trim();if(!n.faceMatchesRequired(c,u,l,d))continue;let g=go(p);if(!yo(n.usedCodepoints,g))continue;let m={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:p,srcRaw:f,srcUrls:zr(f,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(m,g))continue;if(/url\(/i.test(f)){let h=await bo(f,t||location.href,n.useProxy);await r(`@font-face{font-family:${c};src:${h};font-style:${u};font-weight:${l};font-stretch:${d};${p?`unicode-range:${p};`:""}}`)}else await r(`@font-face{font-family:${c};src:${f};font-style:${u};font-weight:${l};font-stretch:${d};${p?`unicode-range:${p};`:""}}`)}}}async function So({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,b,S,w]=String(h).split("__");if(!y)continue;let v=a.get(y)||[];v.push({w:parseInt(b,10),s:S,st:parseInt(w,10)}),a.set(y,v)}function s(h,y,b,S){if(!a.has(h))return!1;let w=a.get(h),v=As(b),E=xs(y),C=Ts(S),I=v.min!==v.max,N=v.min,H=k=>E.kind==="normal"&&k==="normal"||E.kind!=="normal"&&(k==="italic"||k==="oblique"),F=!1;for(let k of w){let T=I?k.w>=v.min&&k.w<=v.max:k.w===N,P=H(Bt(k.s)),K=k.st>=C.min&&k.st<=C.max;if(T&&P&&K){F=!0;break}}if(F)return!0;if(!I)for(let k of w){let T=H(Bt(k.s)),P=k.st>=C.min&&k.st<=C.max;if(Math.abs(N-k.w)<=300&&T&&P)return!0}if(!I&&E.kind==="normal"&&w.some(k=>Bt(k.s)!=="normal"))for(let k of w){let T=Math.abs(N-k.w)<=300,P=k.st>=C.min&&k.st<=C.max;if(T&&P)return!0}return!1}let c=Wn(r),l=_s(e,r,n,o,i);if(x.resource?.has(l))return x.resource.get(l);let u=Ns(e),d=[],f=Fr;for(let h of document.querySelectorAll("style")){let y=h.textContent||"";for(let b of y.matchAll(f)){let S=(b[2]||b[4]||"").trim();!S||Oe(S)||document.querySelector(`link[rel="stylesheet"][href="${S}"]`)||d.push(S)}}d.length&&await Promise.all(d.map(h=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${h}"]`))return y(null);let b=document.createElement("link");b.rel="stylesheet",b.href=h,b.setAttribute("data-snapdom","injected-import"),b.onload=()=>y(b),b.onerror=()=>y(null),document.head.appendChild(b)})));let p="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of g)try{if(Oe(h.href))continue;let y="",b=!1;try{b=new URL(h.href,location.href).origin===location.origin}catch{}if(!b){let w=Array.isArray(i)?i:[];if(!ks(h.href,u,w))continue}if(b){let w=Array.from(document.styleSheets).find(v=>v.href===h.href);if(w)try{let v=w.cssRules||[];y=Array.from(v).map(E=>E.cssText).join("")}catch{}}if(!y){let w=await be(h.href,{as:"text",useProxy:o});if(w?.ok&&typeof w.data=="string"&&(y=w.data),Oe(h.href))continue}y=await Rs(y,h.href,o);let S="";for(let w of y.match(Ls)||[]){let v=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),E=Gr(v);if(!E||Oe(E))continue;let C=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),I=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),H=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),F=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),k=zr(F,h.href);if(!s(E,I,C,N))continue;let T=go(H);if(!yo(t,T))continue;let P={family:E,weightSpec:C,styleSpec:I,stretchSpec:N,unicodeRange:H,srcRaw:F,srcUrls:k,href:h.href};if(r&&c(P,T))continue;let K=/url\(/i.test(F)?await bo(w,h.href,o):w;S+=K}S.trim()&&(p+=S)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let m={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:r?Wn(r):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&g.some(y=>y.href===h.href)))try{let y=h.href||location.origin+"/";y&&m.visitedSheets.add(y),await wo(h,y,async b=>{p+=b},m)}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(Oe(y)||!a.has(y)||r?.families&&r.families.some(S=>String(S).toLowerCase()===y.toLowerCase()))continue;let b=h._snapdomSrc;if(!String(b).startsWith("data:")){if(x.resource?.has(h._snapdomSrc))b=x.resource.get(h._snapdomSrc),x.font?.add(h._snapdomSrc);else if(!x.font?.has(h._snapdomSrc))try{let S=await be(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(S.ok&&typeof S.data=="string")b=S.data,x.resource?.set(h._snapdomSrc,b),x.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}p+=`@font-face{font-family:'${y}';src:url(${b});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||Oe(y)||!a.has(y)||r?.families&&r.families.some(C=>String(C).toLowerCase()===y.toLowerCase()))continue;let b=h.weight!=null?String(h.weight):"normal",S=h.style!=null?String(h.style):"normal",w=h.stretchPct!=null?`${h.stretchPct}%`:"100%",v=String(h.src||""),E=v;if(!E.startsWith("data:")){if(x.resource?.has(v))E=x.resource.get(v),x.font?.add(v);else if(!x.font?.has(v))try{let C=await be(v,{as:"dataURL",useProxy:o,silent:!0});if(C.ok&&typeof C.data=="string")E=C.data,x.resource?.set(v,E),x.font?.add(v);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",v);continue}}p+=`@font-face{font-family:'${y}';src:url(${E});font-style:${S};font-weight:${b};font-stretch:${w};}`}return p&&(p=Fs(p),x.resource?.set(l,p)),p}function Kr(e){let t=new Set;if(!e)return t;let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),n=a=>{let s=Es(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${Ht(u)}__${Bt(d)}__${Is(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 Co(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 jr(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)))}function Ds(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Ps(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Hn(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 Bn(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 Un(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 Hn(e,!1);case"upper-alpha":return Hn(e,!0);case"lower-roman":return Bn(e,!1);case"upper-roman":return Bn(e,!0);default:return String(e)}}function $s(e){let t=()=>x?.session?.__counterEpoch??0,r=t(),n=new WeakMap,o=e instanceof Document?e.documentElement:e,i=f=>f&&f.tagName==="LI",a=f=>{let p=0,g=f?.parentElement;if(!g)return 0;for(let m of g.children){if(m===f)break;m.tagName==="LI"&&p++}return p},s=f=>{let p=new Map;for(let[g,m]of f)p.set(g,m.slice());return p},c=(f,p,g)=>{let m=s(f),h;try{h=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(h&&h!=="none")for(let S of h.split(",")){let w=S.trim().split(/\s+/),v=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!v)continue;let C=p.get(v);if(C&&C.length){let I=C.slice();I.push(E),m.set(v,I)}else m.set(v,[E])}let y;try{y=g.style?.counterSet||getComputedStyle(g).counterSet}catch{}if(y&&y!=="none")for(let S of y.split(",")){let w=S.trim().split(/\s+/),v=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!v)continue;let C=m.get(v)||[];C.length===0&&C.push(0),C[C.length-1]=E,m.set(v,C)}let b;try{b=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(b&&b!=="none")for(let S of b.split(",")){let w=S.trim().split(/\s+/),v=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!v)continue;let C=m.get(v)||[];C.length===0&&C.push(0),C[C.length-1]+=E,m.set(v,C)}try{if(getComputedStyle(g).display==="list-item"&&i(g)){let S=g.parentElement,w=1;if(S&&S.tagName==="OL"){let E=S.getAttribute("start"),C=Number.isFinite(Number(E))?Number(E):1,I=a(g),N=g.getAttribute("value");w=Number.isFinite(Number(N))?Number(N):C+I}else w=1+a(g);let v=m.get("list-item")||[];v.length===0&&v.push(0),v[v.length-1]=w,m.set("list-item",v)}}catch{}return m},l=(f,p,g)=>{let m=c(g,p,f);n.set(f,m);let h=m;for(let b of f.children)h=l(b,m,h);let y=new Map;for(let[b,S]of g){let w=S.length,v=h.get(b);y.set(b,v&&v.length?v.slice(0,w):S.slice())}for(let[b,S]of h)!y.has(b)&&S.length&&!p.has(b)&&y.set(b,S.slice(0,1));return y},u=new Map;l(o,u,u);function d(){let f=t();if(f!==r){r=f;let p=new Map;l(o,p,p)}}return{get(f,p){d();let g=n.get(f)?.get(p);return g&&g.length?g[g.length-1]:0},getStack(f,p){d();let g=n.get(f)?.get(p);return g?g.slice():[]}}}function Ws(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 Un(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(p=>Un(p,d)).join(u):""}});return Ps(o)}catch{return"- "}}function Hs(e,t){let r=vo(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=zn(e),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):zn(e)}function _r(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function vo(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?_r(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?_r(l):null;u&&(n+=u.length)}}let o=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(o)?o.length:0}|tr:${n}`,r}function Gn(e,t,r){let n=_r(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 zn(e=document){let t=vo(e),r=rt.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 rt.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:Vn};try{for(let s of i)if(Gn(s,n,a))return rt.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:Vn};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&&Gn(u,n,s))return rt.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(rt.set(e,{fingerprint:t,result:!0}),!0):(rt.set(e,{fingerprint:t,result:!1}),!1)}function Bs(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Us(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n;for(;n=r.exec(e);)t.push(n[1]);return t.length?t.join(""):Bs(e)}function Dr(e,t){let r=e.parentElement,n=r?ot.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 Pr(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],p=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&l.push({name:f,num:p})}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 Vs(e,t,r){let n;try{n=xe(e,t)}catch{}let o=n?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=Dr(e,r),a=Pr(e,n,i),s=Ds(o)?Ws(o,e,a):o;return{text:Us(s),incs:a.__incs||[]}}async function $r(e,t,r,n){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!Hs(o,r))return;let i=x?.session?.__counterEpoch??0;if(Kn!==i&&(ot=new WeakMap,r&&(r.__counterCtx=null),Kn=i),!r.__counterCtx)try{r.__counterCtx=$s(e.ownerDocument||document)}catch(c){G(r,"buildCounterContext failed",c)}let a=r.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=xe(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 O=xe(e);if(!(l.color!==O.color||l.fontSize!==O.fontSize||l.fontWeight!==O.fontWeight||l.fontFamily!==O.fontFamily||l.fontStyle!==O.fontStyle||l.textTransform!==O.textTransform||l.float!==O.float||l.paddingTop!==O.paddingTop||l.paddingRight!==O.paddingRight||l.paddingBottom!==O.paddingBottom||l.paddingLeft!==O.paddingLeft||l.marginTop!==O.marginTop||l.marginRight!==O.marginRight||l.marginBottom!==O.marginBottom||l.marginLeft!==O.marginLeft))continue;let D=Array.from(t.childNodes).find(L=>L.nodeType===Node.TEXT_NODE&&L.textContent?.trim().length>0);if(!D)continue;let B=D.textContent,$=B.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],oe=B.slice($?.length||0);if(!$||/[\uD800-\uDFFF]/.test($))continue;let V=document.createElement("span");V.textContent=$,V.dataset.snapdomPseudo="::first-letter";let te=Mn(l),ie=kr(te,"span");r.styleMap.set(V,ie);let de=document.createTextNode(oe);t.replaceChild(de,D),t.insertBefore(V,de);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:p}=Vs(e,c,a),g=l.backgroundImage,m=l.backgroundColor,h=l.fontFamily,y=parseInt(l.fontSize)||32,b=parseInt(l.fontWeight)||!1,S=l.color||"#000",w=l.borderStyle,v=parseFloat(l.borderWidth),E=l.transform,C=Oe(h),I=!d&&f!=="",N=g&&g!=="none",H=m&&m!=="transparent"&&m!=="rgba(0, 0, 0, 0)",F=w&&w!=="none"&&v>0,k=E&&E!=="none";if(!(I||N||H||F||k)){if(p&&p.length&&e.parentElement){let O=ot.get(e.parentElement)||new Map;for(let{name:D}of p){if(!D)continue;let B=Dr(e,a),$=Pr(e,xe(e,c),B).get(e,D);O.set(D,$)}ot.set(e.parentElement,O)}continue}let T=document.createElement("span");T.dataset.snapdomPseudo=c,T.style.pointerEvents="none";let P=Mn(l),K=kr(P,"span");if(r.styleMap.set(T,K),C&&f&&f.length===1){let{dataUrl:O,width:D,height:B}=await Cs(f,h,b,y,S),$=document.createElement("img");$.src=O,$.style=`height:${y}px;width:${D/B*y}px;object-fit:contain;`,T.appendChild($),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let O=Hr(f);if(O?.trim())try{let D=await be(Ut(O),{as:"dataURL",useProxy:n.useProxy});if(D?.ok&&typeof D.data=="string"){let B=document.createElement("img");B.src=D.data,B.style=`width:${y}px;height:auto;object-fit:contain;`,T.appendChild(B)}}catch(D){console.error(`[snapdom] Error in pseudo ${c} for`,e,D)}}else!C&&I&&(T.textContent=f);T.style.backgroundImage="none","maskImage"in T.style&&(T.style.maskImage="none"),"webkitMaskImage"in T.style&&(T.style.webkitMaskImage="none");try{T.style.backgroundRepeat=l.backgroundRepeat,T.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(T.style.backgroundPositionX=l.backgroundPositionX,T.style.backgroundPositionY=l.backgroundPositionY):T.style.backgroundPosition=l.backgroundPosition,T.style.backgroundOrigin=l.backgroundOrigin,T.style.backgroundClip=l.backgroundClip,T.style.backgroundAttachment=l.backgroundAttachment,T.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(N)try{let O=Nr(g),D=await Promise.all(O.map(Br));T.style.backgroundImage=D.join(", ")}catch(O){console.warn(`[snapdom] Failed to inline background-image for ${c}`,O)}H&&(T.style.backgroundColor=m);let le=T.childNodes.length>0||T.textContent?.trim()!==""||N||H||F||k;if(p&&p.length&&e.parentElement){let O=ot.get(e.parentElement)||new Map,D=Dr(e,a),B=Pr(e,xe(e,c),D);for(let{name:$}of p){if(!$)continue;let oe=B.get(e,$);O.set($,oe)}ot.set(e.parentElement,O)}if(!le)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(T,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(T))}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 $r(l,c,r,n)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await $r(c[l],s[l],r,n)}}function Gs(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=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",l=w=>{if(!w||!w.getAttribute)return null;let v=w.getAttribute("href")||w.getAttribute("xlink:href")||(typeof w.getAttributeNS=="function"?w.getAttributeNS(c,"href"):null);if(v)return v;let E=w.attributes;if(!E)return null;for(let C=0;C<E.length;C++){let I=E[C];if(!I||!I.name)continue;if(I.name==="href")return I.value;let N=I.name.indexOf(":");if(N!==-1&&I.name.slice(N+1)==="href")return I.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(w=>w.id)),d=new Set,f=!1,p=(w,v=null)=>{if(!w)return;i.lastIndex=0;let E;for(;E=i.exec(w);){f=!0;let C=(E[1]||"").trim();C&&(u.has(C)||(d.add(C),v&&!v.has(C)&&v.add(C)))}},g=w=>{let v=w.querySelectorAll("use");for(let C of v){let I=l(C);if(!I||!I.startsWith("#"))continue;f=!0;let N=I.slice(1).trim();N&&!u.has(N)&&d.add(N)}let E=w.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 E){p(C.getAttribute("style")||"");for(let I of a)p(C.getAttribute(I))}};for(let w of o)g(w);if(!f)return;let m=e.querySelector("svg.inline-defs-container");m||(m=r.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(m,e.firstChild||null));let h=m.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let v=s(w),E=C=>{let I=n.querySelector(C);return I&&!e.contains(I)?I:null};return E(`svg defs > *#${v}`)||E(`svg > symbol#${v}`)||E(`*#${v}`)};if(!d.size)return;let b=new Set(d),S=new Set;for(;b.size;){let w=b.values().next().value;if(b.delete(w),!w||u.has(w)||S.has(w))continue;let v=y(w);if(!v){S.add(w);continue}h||(h=r.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(h));let E=v.cloneNode(!0);E.id||E.setAttribute("id",w),h.appendChild(E),S.add(w),u.add(w);let C=[E,...E.querySelectorAll("*")];for(let I of C){let N=l(I);if(N&&N.startsWith("#")){let F=N.slice(1).trim();F&&!u.has(F)&&!S.has(F)&&b.add(F)}let H=I.getAttribute?.("style")||"";H&&p(H,b);for(let F of a){let k=I.getAttribute?.(F);k&&p(k,b)}}}}function zs(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=jn(c.top),d=jn(c.bottom);if(u==null&&d==null)continue;let f=Ks(s,e),p=js(t,f,i);if(!p)continue;let g=s.getBoundingClientRect(),m=g.width,h=g.height,y=g.left-n.left;if(!(m>0&&h>0)||!Number.isFinite(y))continue;let b=u!=null?u+r:r+(o-h-d);if(!Number.isFinite(b))continue;let S=Number.parseInt(c.zIndex,10),w=Number.isFinite(S),v=w?Math.max(S,1)+1:2,E=w?S-1:0,C=p.cloneNode(!1);C.setAttribute(i,"1"),C.style.position="sticky",C.style.left=`${y}px`,C.style.top=`${b}px`,C.style.width=`${m}px`,C.style.height=`${h}px`,C.style.visibility="hidden",C.style.zIndex=String(E),C.style.overflow="hidden",C.style.background="transparent",C.style.boxShadow="none",C.style.filter="none",p.parentElement?.insertBefore(C,p),p.style.position="absolute",p.style.left=`${y}px`,p.style.top=`${b}px`,p.style.bottom="auto",p.style.zIndex=String(v),p.style.pointerEvents="none"}}function jn(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Ks(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 js(e,t,r){let n=e;for(let o=0;o<t.length;o++)if(n=Ys(n,r)[t[o]],!n)return null;return n instanceof HTMLElement?n:null}function Ys(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 qs(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 Zs(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 Xs(e,t={}){let r={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap,options:t},n,o="",i="";qs(e);let a=Zs(e);try{Gs(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{n=await Wt(e,r,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await $r(e,n,r,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await ds(n,r);try{let l=n.querySelectorAll("style[data-sd]");for(let u of l)i+=u.textContent||"",u.remove()}catch(l){G(r,"Failed to extract shadow CSS from style[data-sd]",l)}let s=ba(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,p=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),p&&(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 g=l.querySelectorAll("*");for(let m of g){if(!(m instanceof HTMLElement))continue;let h=m.style.position;if(h==="fixed"||h==="absolute"){let y=parseFloat(m.style.top)||0,b=parseFloat(m.style.left)||0;m.style.top=`${y+f}px`,m.style.left=`${b+d}px`,h==="fixed"&&(m.style.position="absolute")}}}catch{}let p=document.createElement("div");for(p.style.transform=`translate(${-d}px, ${-f}px)`,p.style.willChange="transform",p.style.display="inline-block",p.style.width="100%";l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p)}}let c=n instanceof HTMLElement&&n.firstElementChild instanceof HTMLElement?n.firstElementChild:n;if(zs(e,c),e===r.nodeMap.get(n)){let l=r.styleCache.get(e)||xe(e);r.styleCache.set(e,l);let u=aa(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}}function Js(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Eo,"href"):null)}function Qs(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 el(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 be(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}=Qs(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 p=await be(f,{as:"dataURL",useProxy:t.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.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=Js(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await be(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(Eo,"href"))};for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(i);await Promise.allSettled(s)}}async function Io(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)||xe(l);r.has(l)||r.set(l,d);let f=(()=>{let m=d.getPropertyValue("border-image"),h=d.getPropertyValue("border-image-source");return m&&m!=="none"||h&&h!=="none"})();for(let m of s){let h=d.getPropertyValue(m);h&&u.style.setProperty(m,h)}for(let m of i){let h=d.getPropertyValue(m);if(m==="background-image"&&(!h||h==="none")){let S=d.getPropertyValue("background");S&&/url\s*\(/.test(S)&&(h=Nr(S).filter(w=>/url\s*\(/.test(w)).join(", ")||h)}if(!h||h==="none")continue;let y=Nr(h),b=await Promise.all(y.map(S=>Br(S,n)));b.some(S=>S&&S!=="none"&&!/^url\(undefined/.test(S))&&u.style.setProperty(m,b.join(", "))}for(let m of a){let h=d.getPropertyValue(m);!h||h==="initial"||u.style.setProperty(m,h)}if(f)for(let m of c){let h=d.getPropertyValue(m);!h||h==="initial"||u.style.setProperty(m,h)}let p=l.shadowRoot?Array.from(l.shadowRoot.children).filter(m=>m.tagName!=="STYLE"):Array.from(l.children),g=Array.from(u.children).filter(m=>!(m.dataset?.snapdomPseudo||m.tagName==="STYLE"&&m.dataset?.sd));for(let m=0;m<Math.min(p.length,g.length);m++)o.push([p[m],g[m]])}}function tl(e){if(!e)return()=>{};let t=[];function r(n){let o=rl(n);o&&t.push(o);for(let i of n.children||[])r(i)}return r(e),()=>t.forEach(n=>n())}function rl(e){if(!e)return()=>{};let t=nl(e);if(t<=0)return()=>{};if(!al(e))return()=>{};let r=getComputedStyle(e),n=Math.round(ol(r)*t+il(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 nl(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 ol(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 il(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function al(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}function Ao(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 sl(...e){let t=e.flat();for(let r of t){let n=Ao(r);n&&(vt.some(o=>o&&o.name&&n.name&&o.name===n.name)||vt.push(n))}}function xo(e){return(e&&Array.isArray(e.plugins)?e.plugins:vt)||vt}async function Pe(e,t,r){let n=r,o=xo(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 ll(e,t,r){let n=[],o=xo(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 cl(e){let t=[];if(Array.isArray(e))for(let r of e){let n=Ao(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 ul(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=cl(t)),e}function dl(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){G(r,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){G(r,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){G(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){G(r,"stripRootShadows filter",i)}}function fl(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 ml(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 pl(e,t={}){e&&(ml(e,t),fl(e))}function hl(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function gl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function yl(e,t){if(!(e instanceof Element)||hl(e)||gl(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 bl(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&&yl(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 wl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Sl(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){G(t,"exclude selector match failed",n)}return!1}function Cl(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let p of s){if(Sl(p,t)||!wl(p))continue;let g=p.getBoundingClientRect(),m=g.top-n.top,h=g.bottom-n.top;h<=m||(m<o&&(o=m),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}function Wr(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+=Wr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=Wr(o.cssRules,t);i&&(r+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(vl.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}function El(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+=Wr(o,t))}catch{}return r}function Il(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(m=>parseFloat(m))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,p=Math.abs(l)+d+f,g=Math.abs(u)+d+f;o=Math.max(o,p+Math.max(l,0)),a=Math.max(a,p+Math.max(-l,0)),i=Math.max(i,g+Math.max(u,0)),n=Math.max(n,g+Math.max(-u,0))}return{top:Math.ceil(n),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function Al(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 xl(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 Tl(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(m=>parseFloat(m))||[],[u=0,d=0,f=0]=l,p=Math.abs(u)+f,g=Math.abs(d)+f;o=Math.max(o,p+Math.max(u,0)),a=Math.max(a,p+Math.max(-u,0)),i=Math.max(i,g+Math.max(d,0)),n=Math.max(n,g+Math.max(-d,0))}return{bleed:{top:M(n),right:M(o),bottom:M(i),left:M(a)},has:s}}function Ml(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=To(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,p=0;if(d>0){let g=s/d,m=c/d;f=g*l+m*u;let h=l-g*f,y=u-m*f;p=Math.sqrt(h*h+y*y)||0,p>0?f=f/p:f=0}return{a:d,b:0,c:f*p,d:p}}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 Yn(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,b){let S=y-n,w=b-o,v=i*S+s*w,E=a*S+c*w;return v+=n+l,E+=o+u,[v,E]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],p=1/0,g=1/0,m=-1/0,h=-1/0;for(let[y,b]of f)y<p&&(p=y),b<g&&(g=b),y>m&&(m=y),b>h&&(h=b);return{minX:p,minY:g,maxX:m,maxY:h,width:m-p,height:h-g}}function kl(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 Nl(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}function Rl(){if(Tr)return Tr;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),Tr=e,e}function Ll(e){let t=Rl(),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=To(r);return t.removeChild(r),n}function Ol(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 To(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 Mo(e,t){if(!e)throw new Error("Element cannot be null or undefined");Xn(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,p=null;await Pe("beforeSnap",i),await Pe("beforeClone",i);let g=tl(i.element);try{({clone:a,classCSS:s,styleCache:c}=await Xs(i.element,i.options)),!n&&a&&(p=Ml(i.element,a)),!o&&a&&dl(i.element,a,i.options)}finally{g()}if(i={clone:a,classCSS:s,styleCache:c,...i},await Pe("afterClone",i),pl(i.clone),i.options?.excludeMode==="remove")try{bl(i.element,i.clone,i.styleCache)}catch(S){console.warn("[snapdom] shrink pass failed:",S)}try{await Ss(i.clone,i.element)}catch{}await new Promise(S=>{nt(async()=>{await el(i.clone,i.options),S()},{fast:r})}),await new Promise(S=>{nt(async()=>{await Io(i.element,i.clone,i.styleCache,i.options),S()},{fast:r})}),t.embedFonts&&await new Promise(S=>{nt(async()=>{let w=Kr(i.element),v=Co(i.element);if(Te()){let E=new Set(Array.from(w).map(C=>String(C).split("__")[0]).filter(Boolean));await jr(E,1)}l=await So({required:w,usedCodepoints:v,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains}),S()},{fast:r})});let m=ga(i.clone).sort(),h=m.join(",");x.baseStyle.has(h)?u=x.baseStyle.get(h):await new Promise(S=>{nt(()=>{u=ya(m),x.baseStyle.set(h,u),S()},{fast:r})});let y=El(i.element?.ownerDocument||document);i={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...i},await Pe("beforeRender",i),await new Promise(S=>{nt(()=>{let w=xe(i.element),v=i.element.getBoundingClientRect(),E=Math.max(1,M(i.element.offsetWidth||parseFloat(w.width)||v.width||1)),C=Math.max(1,M(i.element.offsetHeight||parseFloat(w.height)||v.height||1)),I=i.element.ownerDocument||document;if(i.element===I.body||i.element===I.documentElement){let fe=Math.max(i.element.scrollHeight||0,I.documentElement?.scrollHeight||0,I.body?.scrollHeight||0),pe=Math.max(i.element.scrollWidth||0,I.documentElement?.scrollWidth||0,I.body?.scrollWidth||0);fe>0&&(C=Math.max(C,M(fe))),pe>0&&(E=Math.max(E,M(pe)));try{let Ne=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,Re=x.measureHints.get(i.element);if(Re&&Re.cssLen===Ne&&Re.w0===E)Re.csh>0&&(C=Math.max(C,M(Re.csh))),Re.csw>0&&(E=Math.max(E,M(Re.csw)));else{let Le=I.createElement("div");Le.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+E+"px!important;overflow:visible!important;visibility:hidden!important;";let Ft=I.createElement("style");Ft.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Le.appendChild(Ft),Le.appendChild(i.clone.cloneNode(!0)),I.body.appendChild(Le);let De=Le.scrollHeight,Ir=Le.scrollWidth;I.body.removeChild(Le),x.measureHints.set(i.element,{cssLen:Ne,w0:E,csh:De,csw:Ir}),De>0&&(C=Math.max(C,M(De))),Ir>0&&(E=Math.max(E,M(Ir)))}}catch{}}if(i.options?.excludeMode==="remove"){let fe=Cl(i.element,i.options);Number.isFinite(fe)&&fe>0&&(C=Math.max(1,Math.min(C,M(fe+1))))}let N=(fe,pe=NaN)=>{let Ne=typeof fe=="string"?parseFloat(fe):fe;return Number.isFinite(Ne)?Ne:pe},H=N(i.options.width),F=N(i.options.height),k=E,T=C,P=Number.isFinite(H),K=Number.isFinite(F),le=C>0?E/C:1;P&&K?(k=Math.max(1,M(H)),T=Math.max(1,M(F))):P?(k=Math.max(1,M(H)),T=Math.max(1,M(k/(le||1)))):K?(T=Math.max(1,M(F)),k=Math.max(1,M(T*(le||1)))):(k=E,T=C);let O=0,D=0,B=E,$=C;if(!n&&p&&Number.isFinite(p.a)){let fe={a:p.a,b:p.b||0,c:p.c||0,d:p.d||1,e:0,f:0},pe=Yn(E,C,fe,0,0);O=M(pe.minX),D=M(pe.minY),B=M(pe.maxX),$=M(pe.maxY)}else if(n&&qn(i.element)){let fe=w.transform&&w.transform!=="none"?w.transform:"",pe=Nl(i.element),Ne=Ll({baseTransform:fe,rotate:pe.rotate||"0deg",scale:pe.scale,translate:pe.translate}),{ox:Re,oy:Le}=kl(w,E,C),Ft=Ne.is2D?Ne:new DOMMatrix(Ne.toString()),De=Yn(E,C,Ft,Re,Le);O=M(De.minX),D=M(De.minY),B=M(De.maxX),$=M(De.maxY)}let oe=Il(w),V=Al(w),te=xl(w),ie=Tl(w),de=o?{top:M(oe.top+V.top+te.top+ie.bleed.top),right:M(oe.right+V.right+te.right+ie.bleed.right),bottom:M(oe.bottom+V.bottom+te.bottom+ie.bleed.bottom),left:M(oe.left+V.left+te.left+ie.bleed.left)}:{top:0,right:0,bottom:0,left:0};O=M(O-de.left),D=M(D-de.top),B=M(B+de.right),$=M($+de.bottom);let L=Math.max(1,M(B-O)),re=Math.max(1,M($-D)),ce=P||K?M(k/E):1,Y=K||P?M(T/C):1,ue=Math.max(1,M(L*ce)),U=Math.max(1,M(re*Y)),ae="http://www.w3.org/2000/svg",Ve=Te()&&qn(i.element)?1:0,q=M(Ve+(n?0:1)),ye=document.createElementNS(ae,"foreignObject"),Yi=M(O),qi=M(D);ye.setAttribute("x",String(M(-(Yi-q)))),ye.setAttribute("y",String(M(-(qi-q)))),ye.setAttribute("width",String(M(E+q*2))),ye.setAttribute("height",String(M(C+q*2))),ye.style.overflow="visible";let An=document.createElement("style"),Zi='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';An.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+Zi+i.classCSS,ye.appendChild(An);let Ot=document.createElement("div");Ot.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ot.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${M(E)}px;height:${M(C)}px`,Ot.appendChild(i.clone),ye.appendChild(Ot);let Xi=new XMLSerializer().serializeToString(ye),vr=M(L+q*2),Er=M(re+q*2),xn=P||K;t.meta={w0:E,h0:C,vbW:vr,vbH:Er,targetW:k,targetH:T};let Ji=Te()&&xn?vr:M(ue+q*2),Qi=Te()&&xn?Er:M(U+q*2),ea=parseFloat(xe(I.documentElement)?.fontSize)||16;f=`<svg xmlns="${ae}" width="${Ji}" height="${Qi}" viewBox="0 0 ${vr} ${Er}" font-size="${ea}px">`+Xi+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,i={svgString:f,dataURL:d,...i},S()},{fast:r})}),await Pe("afterRender",i);let b=document.getElementById("snapdom-sandbox");return b&&b.style.position==="absolute"&&b.remove(),i.dataURL}function qn(e){return Ol(e)}function Fl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=ia(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}}async function _l(e=document,t={}){let{embedFonts:r=!0,useProxy:n=""}=t,o=t.cache??t.cacheOpt??"full";Xn(o);try{await document.fonts?.ready}catch{}try{ha()}catch{}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new me(100),x.background=x.background||new me(100);try{await Io(e,void 0,x.session.styleCache,{useProxy:n})}catch{}let i=[],a=[];try{if(e&&e.nodeType===1){let c=e.querySelectorAll?Array.from(e.querySelectorAll("*")):[];a=[e,...c],i=[],e.tagName==="IMG"&&e.getAttribute("src")&&i.push(e),i.push(...Array.from(e.querySelectorAll?.("img[src]")||[]))}else e?.querySelectorAll&&(i=Array.from(e.querySelectorAll("img[src]")),a=Array.from(e.querySelectorAll("*")))}catch{}let s=[];for(let c of i){let l=c?.currentSrc||c?.src;if(l&&!x.image.has(l)){let u=Promise.resolve().then(async()=>{let d=await be(l,{as:"dataURL",useProxy:n});d?.ok&&typeof d.data=="string"&&x.image.set(l,d.data)}).catch(()=>{});s.push(u)}}for(let c of a){let l="";try{l=c?.style?.backgroundImage||"",(!l||l==="none")&&(l=xe(c).backgroundImage)}catch{}if(l&&l!=="none"){let u=l.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let d of u){let f=Promise.resolve().then(()=>Br(d,{...t,useProxy:n})).catch(()=>{});s.push(f)}}}if(r)try{let c=Kr(e),l=Co(e);if(typeof Te=="function"?Te():Te){let u=new Set(Array.from(c).map(d=>String(d).split("__")[0]).filter(Boolean));await jr(u,3)}await So({required:c,usedCodepoints:l,exclude:t.excludeFonts,localFonts:t.localFonts,useProxy:t.useProxy??n,fontStylesheetDomains:t.fontStylesheetDomains})}catch{}await Promise.allSettled(s)}function Dl(...e){return sl(...e),Z}async function $l(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=Fl(t);if(ul(r,t&&t.plugins),Te()&&(r.embedFonts===!0||Hl(e))){if(r.embedFonts)try{let o=Kr(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await jr(i,1)}catch{}let n=r.safariWarmupAttempts??3;for(let o=0;o<n;o++)try{await Wl(e,t)}catch{}}return r.iconFonts&&r.iconFonts.length>0&&ms(r.iconFonts),r.snap||(r.snap={toPng:(n,o)=>Z.toPng(n,o),toSvg:(n,o)=>Z.toSvg(n,o)}),Z.capture(e,r,ko)}async function Wl(e,t){if(Zn)return;let r={...t,fast:!0,embedFonts:!0,scale:.2},n;try{n=await Mo(e,r)}catch(o){G(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){G(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){G(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){G(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){G(t,"safariWarmup canvas poke failed",i)}}),Zn=!0}function Hl(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}var oa,he,Et,me,x,we,Gt,Mr,Dt,bt,it,pa,Vr,zt,Qn,eo,to,ro,no,It,oo,Me,io,jt,Pt,$t,Rr,Nn,lo,uo,fo,Ra,Ln,Ct,La,Lr,On,Fn,mo,_n,yt,ls,fs,tt,Or,Pn,po,vs,Fr,Vt,ho,Ls,rt,Vn,ot,Kn,Eo,vt,M,vl,Tr,Z,ko,Pl,Zn,Ro=ra(()=>{oa=Object.defineProperty,he=(e,t)=>()=>(e&&(t=e(e=0)),t),Et=(e,t)=>{for(var r in t)oa(e,r,{get:t[r],enumerable:!0})};we=he(()=>{me=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)}},x={image:new me(100),background:new me(100),resource:new me(150),defaultStyle:new me(30),baseStyle:new me(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});Gt=he(()=>{});it=he(()=>{Gt(),Mr=la("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Dt=new Map,bt=new Map});pa=he(()=>{we(),Gt(),it()});no=he(()=>{we(),Vr=new Set(["meta","script","noscript","title","link","template"]),zt=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"]),Qn=["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"],eo=/(?:^|-)(animation|transition)(?:-|$)/i,to=/^(--.+|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,ro=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"])});It=he(()=>{});oo=he(()=>{}),Me=he(()=>{pa(),no(),It(),Gt(),oo()}),io={};Et(io,{toCanvas:()=>Kt});jt=he(()=>{It()}),Pt={};Et(Pt,{rasterize:()=>so});$t=he(()=>{jt()}),Rr={};Et(Rr,{toImg:()=>kn,toSvg:()=>kn});Nn=he(()=>{Me(),$t()}),lo={};Et(lo,{toBlob:()=>co});uo=he(()=>{jt()}),fo={};Et(fo,{download:()=>Na});Ra=he(()=>{uo(),jt(),It()});Me();Me();we();Ln=new WeakMap,Ct=new Map,La=2e3,Lr=0;On=!1;Fn=new WeakMap;no();mo=["fill","stroke","color","background-color","stop-color"],_n=new Map;Me();Me();we();it();yt=new me(80);ls=/\bblob:[^)"'\s]+/g;It();Me();Gt();we();fs=[/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],tt=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__||{}),Or=[];Pn=new Map;it();po=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),vs=["katex","mathjax","mathml"];Fr=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Vt=4;ho=/url\((["']?)([^"')]+)\1\)/g,Ls=/@font-face[^{}]*\{[^}]*\}/g;we();it();we();rt=new WeakMap,Vn=1e3;ot=new WeakMap,Kn=-1;we();it();Eo="http://www.w3.org/1999/xlink";Me();Me();we();vt=[];Me();M=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,vl=/::-webkit-scrollbar(-[a-z]+)?\b/i;Tr=null;we();It();oo();Me();it();we();Z=Object.assign($l,{plugins:Dl}),ko=Symbol("snapdom.internal"),Pl=Symbol("snapdom.internal.silent"),Zn=!1;Z.capture=async(e,t,r)=>{if(r!==ko)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let n=await Mo(e,t),o={img:async(m,h)=>{let{toImg:y}=await Promise.resolve().then(()=>(Nn(),Rr));return y(n,{...m,...h||{}})},svg:async(m,h)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Nn(),Rr));return y(n,{...m,...h||{}})},canvas:async(m,h)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(jt(),io));return y(n,{...m,...h||{}})},blob:async(m,h)=>{let{toBlob:y}=await Promise.resolve().then(()=>(uo(),lo));return y(n,{...m,...h||{}})},png:async(m,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>($t(),Pt));return y(n,{...m,...h||{},format:"png"})},jpeg:async(m,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>($t(),Pt));return y(n,{...m,...h||{},format:"jpeg"})},webp:async(m,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>($t(),Pt));return y(n,{...m,...h||{},format:"webp"})},download:async(m,h)=>{let{download:y}=await Promise.resolve().then(()=>(Ra(),fo));return y(n,{...m,...h||{}})}},i={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])i[m]=async h=>o[m](t,{...h||{},[Pl]:!0});i.jpg=i.jpeg;let a={...t,export:{url:n},exports:i},s=await ll("defineExports",a),c=Object.assign({},...s.filter(m=>m&&typeof m=="object")),l={...o,...c};l.jpeg&&!l.jpg&&(l.jpg=(m,h)=>l.jpeg(m,h));function u(m,h){let y={...t,...h||{}};return(m==="jpeg"||m==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function p(m,h){let y=async()=>{let b=l[m];if(!b)throw new Error(`[snapdom] Unknown export type: ${m}`);let S=u(m,h),w={...t,export:{type:m,options:S,url:n}};await Pe("beforeExport",w);let v=await b(w,S);return await Pe("afterExport",w,v),d||(d=!0,await Pe("afterSnap",t)),v};return f=f.then(y)}let g={url:n,toRaw:()=>n,to:(m,h)=>p(m,h),toImg:m=>p("img",m),toSvg:m=>p("svg",m),toCanvas:m=>p("canvas",m),toBlob:m=>p("blob",m),toPng:m=>p("png",m),toJpg:m=>p("jpg",m),toWebp:m=>p("webp",m),download:m=>p("download",m)};for(let m of Object.keys(l)){let h="to"+m.charAt(0).toUpperCase()+m.slice(1);g[h]||(g[h]=y=>p(m,y))}return g};Z.toRaw=(e,t)=>Z(e,t).then(r=>r.toRaw());Z.toImg=(e,t)=>Z(e,t).then(r=>r.toImg());Z.toSvg=(e,t)=>Z(e,t).then(r=>r.toSvg());Z.toCanvas=(e,t)=>Z(e,t).then(r=>r.toCanvas());Z.toBlob=(e,t)=>Z(e,t).then(r=>r.toBlob());Z.toPng=(e,t)=>Z(e,{...t,format:"png"}).then(r=>r.toPng());Z.toJpg=(e,t)=>Z(e,{...t,format:"jpeg"}).then(r=>r.toJpg());Z.toWebp=(e,t)=>Z(e,{...t,format:"webp"}).then(r=>r.toWebp());Z.download=(e,t)=>Z(e,t).then(r=>r.download())});async function Lo(e,t=40){let{snapdom:r}=await Promise.resolve().then(()=>(Ro(),No)),n=e.getBoundingClientRect(),o=document.body.getBoundingClientRect(),i=n.width/n.height,c=document.body.scrollWidth*2*document.body.scrollHeight*2<16777216?2:1,l=await r.toCanvas(document.body,{dpr:c}),u=Math.max(0,(n.left-o.left-t)*c),d=Math.max(0,(n.top-o.top-t)*c),f=Math.min(l.width-u,(n.width+t*2)*c),p=Math.min(l.height-d,(n.height+t*2)*c),g=document.createElement("canvas");return g.width=f,g.height=p,g.getContext("2d").drawImage(l,u,d,f,p,0,0,f,p),{dataUrl:g.toDataURL("image/jpeg",.8),aspectRatio:i}}var ze=null,Yr={enable(){ze||(ze=document.createElement("style"),ze.textContent="* { cursor: crosshair !important; }",document.head.appendChild(ze))},disable(){ze&&(ze.remove(),ze=null)}};var $e=null,Ke=[],at=null;function Bl(){return $e||($e=document.createElement("div"),$e.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:1000000000;",document.body.appendChild($e)),$e}function Oo(){let e=Bl();for(;e.children.length>Ke.length;)e.lastElementChild.remove();for(;e.children.length<Ke.length;){let t=document.createElement("div");t.style.cssText="position:fixed;background:rgba(59,130,246,0.1);border:2px solid rgb(37,99,235);pointer-events:none;",e.appendChild(t)}for(let t=0;t<Ke.length;t++){let r=Ke[t].getBoundingClientRect(),n=e.children[t];n.style.top=`${r.top}px`,n.style.left=`${r.left}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}}function Yt(){Ke.length!==0&&at==null&&(at=requestAnimationFrame(()=>{at=null,Oo()}))}var qt=!1;function Ul(){qt||(qt=!0,document.addEventListener("scroll",Yt,{passive:!0,capture:!0}),window.addEventListener("scroll",Yt,{passive:!0}))}function Vl(){qt&&(qt=!1,document.removeEventListener("scroll",Yt,!0),window.removeEventListener("scroll",Yt))}function Fo(e){Ke=e,e.length>0?(Ul(),Oo()):Zt()}function Zt(){Ke=[],Vl(),$e&&($e.remove(),$e=null),at!=null&&(cancelAnimationFrame(at),at=null)}var _o=["https://gptengineer.app","http://localhost:3000","http://localhost","https://lovable.dev","https://beta.lovable.dev"],Gl=[/^https:\/\/[a-z0-9-]+\.beta\.lovable\.dev$/],Se=e=>_o.includes(e)||Gl.some(t=>t.test(e)),A={HIGHLIGHT_COLOR:"hsl(225, 88%, 53%)",HIGHLIGHT_BG:"hsla(225, 88%, 53%, 0.1)",DEBOUNCE_DELAY:10,Z_INDEX:1e4,TOOLTIP_OFFSET:25,MAX_TOOLTIP_WIDTH:200,SCROLL_DEBOUNCE:420,FULL_WIDTH_TOOLTIP_OFFSET:"12px",HIGHLIGHT_STYLE:{FULL_WIDTH:{OFFSET:"-5px",STYLE:"solid"},NORMAL:{OFFSET:"0",STYLE:"solid"}},SELECTED_ATTR:"data-lov-selected",HOVERED_ATTR:"data-lov-hovered",PRIMARY_ATTR:"data-lov-primary",OVERRIDE_STYLESHEET_ID:"lovable-override",INDEX_COMPONENT_NAME:"Index",TABLET_BREAKPOINT:"768px",INDEX_BORDER_RADIUS:"0.75rem"},R=e=>{if(!window.parent||!e||typeof e!="object")return;let t;try{t=new URL(document.referrer).origin}catch{}if(t&&Se(t))try{window.parent.postMessage(e,t);return}catch{}_o.forEach(r=>{try{window.parent.postMessage(e,r)}catch{}})};var st=()=>new Promise(e=>{let t=document.getElementById("root");if(t&&t.children.length>0){e();return}new MutationObserver((n,o)=>{let i=document.getElementById("root");i&&i.children.length>0&&(o.disconnect(),e())}).observe(document.body,{childList:!0,subtree:!0})});var zl=["click","submit","touchstart","touchend"],qr=!1;function Kl(e){qr&&(e.preventDefault(),e.stopPropagation())}for(let e of zl)document.addEventListener(e,Kl,!0);var lt={turnOn(){qr=!0},turnOff(){qr=!1}};var jl=5e3;function Yl(e){if(e.id)return`#${CSS.escape(e.id)}`;let t=[],r=e;for(;r&&r!==document.documentElement;){let n=r.tagName.toLowerCase();if(r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let o=r.parentElement;if(o){let i=Array.from(o.children).filter(a=>a.tagName===r.tagName);if(i.length>1){let a=i.indexOf(r)+1;n+=`:nth-of-type(${a})`}}t.unshift(n),r=o}return t.join(" > ")}function ql(e){if(!e.selector)return null;try{return document.querySelector(e.selector)}catch{return null}}function Zl(e){return typeof e.checkVisibility=="function"?e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):e.offsetWidth>0||e.offsetHeight>0}function Do(){let e=!1,t=[],r=null,n=c=>{let l=c.map(u=>{let d=ql(u.domAnchor);if(d&&Zl(d)){let g=d.getBoundingClientRect(),m=(g.left+g.width/2)/window.innerWidth*100,h=(g.top+g.height/2)/window.innerHeight*100,y=(u.domAnchor.offsetX??0)/100*(g.width/window.innerWidth*100),b=(u.domAnchor.offsetY??0)/100*(g.height/window.innerHeight*100);return{annotationId:u.id,x:m+y,y:h+b,anchorFound:!0}}let f=window.scrollX-(u.domAnchor.domPosition.scrollX??0),p=window.scrollY-(u.domAnchor.domPosition.scrollY??0);return{annotationId:u.id,x:u.domAnchor.domPosition.left-f/window.innerWidth*100,y:u.domAnchor.domPosition.top-p/window.innerHeight*100,anchorFound:!1}});R({type:"ANNOTATION_POSITIONS_UPDATE",payload:{positions:l}})},o=c=>{if(!e)return;let l=c.target;l instanceof Element&&Fo([l])},i=c=>{if(!e)return;c.preventDefault(),c.stopPropagation();let l=c.target;if(!(l instanceof Element))return;let u=Yl(l),d=c.clientX/window.innerWidth*100,f=c.clientY/window.innerHeight*100,p=`${window.innerWidth}x${window.innerHeight}`,g=l.getBoundingClientRect(),m=g.width>0?(c.clientX-(g.left+g.width/2))/g.width*100:0,h=g.height>0?(c.clientY-(g.top+g.height/2))/g.height*100:0,y=40,b=y*2,S=g.height>0?(g.width+b)/(g.height+b):null;R({type:"ANNOTATION_ELEMENT_CLICKED",payload:{selector:u,offsetX:m,offsetY:h,screenshotAspectRatio:S,domPosition:{screenSize:p,left:d,top:f,scrollX:window.scrollX,scrollY:window.scrollY}}}),Promise.race([Lo(l,y),new Promise((w,v)=>setTimeout(()=>v(new Error("Screenshot timed out")),jl))]).then(({dataUrl:w,aspectRatio:v})=>{R({type:"ANNOTATION_SCREENSHOT_CAPTURED",payload:{dataUrl:w,aspectRatio:v}})}).catch(()=>{R({type:"ANNOTATION_SCREENSHOT_FAILED"})}),Zt(),e=!1,document.removeEventListener("click",i,!0),document.removeEventListener("mousemove",o)},a=()=>{t.length!==0&&(r||(r=requestAnimationFrame(()=>{r=null,n(t)})))};document.addEventListener("scroll",a,{passive:!0,capture:!0}),window.addEventListener("resize",a,{passive:!0});let s=c=>{try{if(!c?.origin||!c?.data?.type||!Se(c.origin))return;switch(c.data.type){case"ANNOTATION_START_PLACEMENT":{e=!0,Yr.enable(),document.addEventListener("click",i,!0),document.addEventListener("mousemove",o),lt.turnOn();break}case"ANNOTATION_CANCEL_PLACEMENT":e=!1,Yr.disable(),Zt(),document.removeEventListener("click",i,!0),document.removeEventListener("mousemove",o),lt.turnOff();break;case"ANNOTATION_GET_POSITIONS":{let{anchors:l}=c.data.payload;t=l,n(l);break}default:break}}catch(l){console.error("Error handling annotation message:",l)}};window.addEventListener("message",s)}var Xl=e=>{let t=e.headers.get("content-type")||"";return t.includes("text/event-stream")||t.includes("application/stream+json")||t.includes("application/x-ndjson")},Jl=(e,t,r)=>{if(!e.body)return e;let n=e.body.getReader(),o=new TextDecoder,i="",a=new ReadableStream({async start(s){try{for(;;){let{done:c,value:l}=await n.read();if(c){let f={...t,responseBody:i||"[Streaming completed]",duration:Date.now()-r,streaming:!0,streamComplete:!0};R({type:"NETWORK_REQUEST",payload:f}),s.close();break}let u=o.decode(l,{stream:!0});i+=u,s.enqueue(l);let d={...t,chunk:u,streaming:!0};R({type:"NETWORK_REQUEST_CHUNK",payload:d})}}catch(c){s.error(c);let l={...t,responseBody:`[Streaming error: ${c instanceof Error?c.message:"Unknown"}]`,duration:Date.now()-r,streaming:!0,streamError:!0};R({type:"NETWORK_REQUEST",payload:l})}}});return new Response(a,{status:e.status,statusText:e.statusText,headers:e.headers})},Po=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},Ql=()=>{let e=window.fetch;window.fetch=async function(...t){let r=Date.now();try{let n;if(t?.[1]?.body)try{typeof t[1].body=="string"?n=t[1].body:t[1].body instanceof FormData?n="FormData: "+Array.from(t[1].body.entries()).map(([u,d])=>`${u}=${d}`).join("&"):t[1].body instanceof URLSearchParams?n=t[1].body.toString():n=JSON.stringify(t[1].body)}catch{n="Could not serialize request body"}let o=await e(...t),i=t?.[0],s={url:typeof i=="string"?i:i instanceof URL?i.toString():i instanceof Request?i.url:o.url,method:t?.[1]?.method||"GET",status:o.status,statusText:o.statusText,requestBody:n,timestamp:new Date().toISOString(),origin:window.location.origin,headers:t?.[1]?.headers?Po(new Headers(t[1].headers)):{}};if(Xl(o)){let u={...s,responseBody:"[Streaming response - data will follow]",duration:Date.now()-r,streaming:!0,streamComplete:!1};return R({type:"NETWORK_REQUEST",payload:u}),Jl(o,s,r)}let c;try{o.clone&&(c=await o.clone().text())}catch(u){c=`[Clone failed: ${u instanceof Error?u.message:"Unknown error"}]`}let l={...s,responseBody:c,duration:Date.now()-r};return R({type:"NETWORK_REQUEST",payload:l}),o}catch(n){let o;if(t?.[1]?.body)try{typeof t[1].body=="string"?o=t[1].body:t[1].body instanceof FormData?o="FormData: "+Array.from(t[1].body.entries()).map(([s,c])=>`${s}=${c}`).join("&"):t[1].body instanceof URLSearchParams?o=t[1].body.toString():o=JSON.stringify(t[1].body)}catch{o="Could not serialize request body"}let i={url:t?.[0],method:t?.[1]?.method||"GET",origin:window.location.origin,timestamp:new Date().toISOString(),duration:Date.now()-r,headers:t?.[1]?.headers?Po(new Headers(t[1].headers)):{},requestBody:o},a=n instanceof TypeError?{...i,error:{message:n?.message||"Unknown error",stack:n?.stack}}:{...i,error:{message:n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"?n.message:"Unknown fetch error",stack:n&&typeof n=="object"&&"stack"in n&&typeof n.stack=="string"?n.stack:"Not available"}};throw R({type:"NETWORK_REQUEST",payload:a}),n}}},$o=()=>{let e=document.querySelector("div#root");return e?e.childElementCount===0:!1},Wo=(()=>{let e=!1,t=n=>{try{let o=new URL(n);return o.searchParams.delete("__lovable_token"),o.toString()}catch{return n}},r=({message:n,lineno:o,colno:i,filename:a,error:s})=>{let c=Array.from(document.scripts||[]).slice(0,25).map(l=>l.src?l.src:l.textContent?.slice(0,80)||"inline");return{message:n,lineno:o,colno:i,filename:a&&t(a),stack:s?.stack,readyState:document.readyState,userAgent:navigator.userAgent,rootPresent:!!document.getElementById("root"),reactVersions:window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.renderers?Array.from(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.renderers.values()).map(l=>l?.version):void 0,scripts:c}};return()=>{if(e)return;let n=new Set,o=s=>{let{lineno:c,colno:l,filename:u,message:d}=s;return`${d}|${u}|${c}|${l}`};Ql();let i=s=>n.has(s)?!0:(n.add(s),setTimeout(()=>n.delete(s),5e3),!1),a=s=>{let c=o(s);if(i(c))return;let l=r(s),u=$o(),d={...l,blankScreen:u};R({type:"RUNTIME_ERROR",payload:d})};window.addEventListener("error",a),window.addEventListener("unhandledrejection",s=>{if(!s.reason?.stack)return;let c=s.reason?.stack||s.reason?.message||String(s.reason);if(i(c))return;let l=Array.from(document.scripts||[]).slice(0,25).map(p=>p.src?p.src:p.textContent?.slice(0,80)||"inline"),u={message:s.reason?.message||"Unhandled promise rejection",stack:s.reason?.stack||String(s.reason),readyState:document.readyState,userAgent:navigator.userAgent,rootPresent:!!document.getElementById("root"),scripts:l},d=$o(),f={...u,blankScreen:d};R({type:"UNHANDLED_PROMISE_REJECTION",payload:f})}),e=!0}})();(()=>{try{let e=()=>{if(document.querySelector("[data-lovable-blank-page-placeholder]"))return!0;let o=document.querySelector("div#root > div > div > h1"),i=document.querySelector("div#root > div > div > p");return o?.textContent==="Welcome to Your Blank App"&&i?.textContent==="Start building your amazing project here!"},t=()=>{let o=e();if(R({type:"APP_READY",payload:{readyState:document.readyState,isBlankApp:o}}),o){let i=()=>{R({type:"APP_READY",payload:{readyState:document.readyState,isBlankApp:!1}})},a=!1,s,c=()=>{u.disconnect(),clearInterval(s)},l=()=>a||e()?!1:(a=!0,i(),c(),!0),u=new MutationObserver(()=>l());u.observe(document.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),s=setInterval(()=>l(),2e3)}},n=()=>{Promise.race([st(),new Promise(o=>setTimeout(o,1e3))]).then(t)};document.readyState==="complete"||document.readyState==="interactive"?n():window.addEventListener("DOMContentLoaded",n,{once:!0})}catch{}})();var Zr=class{constructor(t){this.message=`[Circular Reference to ${t}]`}},Q=class{constructor(t,r){this._type=t,this.value=r}},ec={maxDepth:10,indent:2,includeSymbols:!0,preserveTypes:!0,maxStringLength:1e4,maxArrayLength:100,maxObjectKeys:100};function ke(e,t={},r=new WeakMap,n="root"){let o={...ec,...t};if(n.split(".").length>o.maxDepth)return new Q("MaxDepthReached",`[Max depth of ${o.maxDepth} reached]`);if(e===void 0)return new Q("undefined","undefined");if(e===null)return null;if(typeof e=="string")return e.length>o.maxStringLength?new Q("String",`${e.slice(0,o.maxStringLength)}... [${e.length-o.maxStringLength} more characters]`):e;if(typeof e=="number")return Number.isNaN(e)?new Q("Number","NaN"):Number.isFinite(e)?e:new Q("Number",e>0?"Infinity":"-Infinity");if(typeof e=="boolean")return e;if(typeof e=="bigint")return new Q("BigInt",e.toString());if(typeof e=="symbol")return new Q("Symbol",e.toString());if(typeof e=="function")return new Q("Function",{name:e.name||"anonymous",stringValue:e.toString().slice(0,o.maxStringLength)});if(e&&typeof e=="object"){if(r.has(e))return new Zr(r.get(e));r.set(e,n)}if(e instanceof Error){let c={name:e.name,message:e.message,stack:e.stack};for(let l of Object.getOwnPropertyNames(e))c[l]||(c[l]=ke(e[l],o,r,`${n}.${l}`));return new Q("Error",c)}if(e instanceof Date)return new Q("Date",{iso:e.toISOString(),value:e.valueOf(),local:e.toString()});if(e instanceof RegExp)return new Q("RegExp",{source:e.source,flags:e.flags,string:e.toString()});if(e instanceof Promise)return new Q("Promise","[Promise]");if(e instanceof WeakMap||e instanceof WeakSet)return new Q(e.constructor.name,"["+e.constructor.name+"]");if(e instanceof Set){let c=Array.from(e);return c.length>o.maxArrayLength?new Q("Set",{values:c.slice(0,o.maxArrayLength).map((l,u)=>ke(l,o,r,`${n}.Set[${u}]`)),truncated:c.length-o.maxArrayLength}):new Q("Set",{values:c.map((l,u)=>ke(l,o,r,`${n}.Set[${u}]`))})}if(e instanceof Map){let c={},l=0,u=0;for(let[d,f]of e.entries()){if(u>=o.maxObjectKeys){l++;continue}let p=typeof d=="object"?JSON.stringify(ke(d,o,r,`${n}.MapKey`)):String(d);c[p]=ke(f,o,r,`${n}.Map[${p}]`),u++}return new Q("Map",{entries:c,truncated:l||void 0})}if(ArrayBuffer.isView(e)){let c=e;return new Q(e.constructor.name,{length:c.length,byteLength:c.byteLength,sample:Array.from(c.slice(0,10))})}if(Array.isArray(e))return e.length>o.maxArrayLength?e.slice(0,o.maxArrayLength).map((c,l)=>ke(c,o,r,`${n}[${l}]`)).concat([`... ${e.length-o.maxArrayLength} more items`]):e.map((c,l)=>ke(c,o,r,`${n}[${l}]`));let i={},a=[...Object.getOwnPropertyNames(e)];o.includeSymbols&&a.push(...Object.getOwnPropertySymbols(e).map(c=>c.toString()));let s=0;return a.slice(0,o.maxObjectKeys).forEach(c=>{try{let l=e[c];i[c]=ke(l,o,r,`${n}.${c}`)}catch(l){i[c]=new Q("Error",`[Unable to serialize: ${l instanceof Error?l.message:String(l)}]`)}}),a.length>o.maxObjectKeys&&(s=a.length-o.maxObjectKeys,i["..."]=`${s} more properties`),i}var tc={log:console.log,warn:console.warn,error:console.error},rc={log:"info",warn:"warning",error:"error"},Ho=(()=>{let e=!1,t=[],r=null,n=250,o=()=>{if(t.length===0){r=null;return}let i=[...t];t.length=0,r=null,R({type:"CONSOLE_OUTPUT",payload:{messages:i}})};return()=>{if(e)return;let i=a=>{console[a]=(...s)=>{tc[a].apply(console,s);let c=null;if(a==="warn"||a==="error"){let f=new Error;f.stack&&(c=f.stack.split(`
`).slice(2).join(`
`))}let l=s.map(f=>ke(f,{maxDepth:5,includeSymbols:!0,preserveTypes:!0})),u=l.map(f=>typeof f=="string"?f:JSON.stringify(f,null,2).slice(0,1e4)).join(" ")+(c?`
`+c:""),d={level:rc[a],message:u.slice(0,1e4),logged_at:new Date().toISOString(),raw:l};t.push(d),r===null&&(r=setTimeout(o,n))}};i("log"),i("warn"),i("error"),e=!0}})();var Bo=()=>{let e=t=>{if(!(!t?.origin||!t?.data?.type||!Se(t.origin))&&t.data.type==="NAVIGATE"){let{direction:r}=t.data.payload;r==="back"?window.history.back():r==="forward"&&window.history.forward()}};window.addEventListener("message",e)};function Uo(){window.addEventListener("message",e=>{if(e.data?.type==="GET_LOCALSTORAGE"&&Se(e.origin)){let{key:t,requestId:r}=e.data;try{let n=localStorage.getItem(t);R({type:"LOCALSTORAGE_RESPONSE",requestId:r,key:t,value:n})}catch(n){R({type:"LOCALSTORAGE_RESPONSE",requestId:r,key:t,value:null,error:n instanceof Error?n.message:"Unknown error"})}}})}var Vo=()=>{R({type:"URL_CHANGED",payload:{url:document.location.href}})},Go=()=>{let e=()=>{Vo();let t=document.location.href,r=()=>{t!==document.location.href&&(t=document.location.href,Vo())},n=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...s)=>{n(...s),r()},history.replaceState=(...s)=>{o(...s),r()},window.addEventListener("popstate",r);let i=document.querySelector("body"),a=new MutationObserver(r);i&&a.observe(i,{childList:!0,subtree:!0})};document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e()};var zo=()=>{let e=null,t=!1,r=null,n=()=>({width:Math.round(window.innerWidth),height:Math.round(window.innerHeight),devicePixelRatio:window.devicePixelRatio||1}),o=()=>{let a=n();e&&e.width===a.width&&e.height===a.height&&e.devicePixelRatio===a.devicePixelRatio||(e=a,R({type:"VIEWPORT_CHANGED",payload:a}))},i=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1,o()}))};o(),window.addEventListener("resize",i),window.visualViewport?.addEventListener("resize",i),"ResizeObserver"in window&&(r=new ResizeObserver(i),r.observe(document.documentElement)),window.addEventListener("beforeunload",()=>{window.removeEventListener("resize",i),window.visualViewport?.removeEventListener("resize",i),r?.disconnect()},{once:!0})};var ne;(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"})(ne||(ne={}));function nc(e){return e.nodeType===e.ELEMENT_NODE}function Ze(e){var t=e?.host;return t?.shadowRoot===e}function Ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function oc(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 Xr(e){try{var t=e.rules||e.cssRules;return t?oc(Array.from(t).map(Jr).join("")):null}catch{return null}}function Jr(e){var t=e.cssText;if(ic(e))try{t=Xr(e.styleSheet)||t}catch{}return t}function ic(e){return"styleSheet"in e}var Yo=(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 qo(){return new Yo}function xt(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 Ko="__rrweb_original__";function ac(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=Ko in i?i[Ko]: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 sc=1,lc=new RegExp("[^a-z0-9-_:]"),qe=-2;function Qr(){return sc++}function cc(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return lc.test(t)?"div":t}function uc(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function dc(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,jo,fc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mc=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,pc=/^(data:)([^,]*),(.*)/i;function Xt(e,t){return(e||"").replace(fc,function(r,n,o,i,a,s){var c=o||a||s,l=n||i||"";if(!c)return r;if(!mc.test(c)||pc.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(dc(t)+c).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var g=p[f];g!=="."&&(g===".."?u.pop():u.push(g))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var hc=/^[^ \t\n\r\u000c]+/,gc=/^[, \t\n\r\u000c]+/;function yc(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(gc),!(r>=t.length);){var i=n(hc);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 bc(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function en(){var e=document.createElement("a");return e.href="",e.href}function tn(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?yc(e,n):r==="style"&&n?Xt(n,en()):t==="object"&&r==="data"&&n?ut(e,n):n}function wc(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 At(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?At(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?At(e.parentNode,t,r):!1}function rn(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(At(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Sc(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 Cc(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 vc(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,p=t.dataURLOptions,g=p===void 0?{}:p,m=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,b=t.newlyAddedElement,S=b===void 0?!1:b,w=Ec(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ne.Document,childNodes:[],compatMode:e.compatMode}:{type:ne.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ne.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return Ac(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:f,dataURLOptions:g,inlineImages:m,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:S,rootId:w});case e.TEXT_NODE:return Ic(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:w});case e.CDATA_SECTION_NODE:return{type:ne.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:ne.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function Ec(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function Ic(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=uc(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}c=Xt(c,en())}return u&&(c="SCRIPT_PLACEHOLDER"),!l&&!u&&c&&rn(e,n,o)&&(c=i?i(c):c.replace(/[\S]/g,"*")),{type:ne.Text,textContent:c||"",isStyle:l,rootId:a}}function Ac(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,p=t.keepIframeSrcFn,g=t.newlyAddedElement,m=g===void 0?!1:g,h=t.rootId,y=wc(e,n,o),b=cc(e),S={},w=e.attributes.length,v=0;v<w;v++){var E=e.attributes[v];S[E.name]=tn(r,b,E.name,E.value)}if(b==="link"&&i){var C=Array.from(r.styleSheets).find(function($){return $.href===e.href}),I=null;C&&(I=Xr(C)),I&&(delete S.rel,delete S.href,S._cssText=Xt(I,C.href))}if(b==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var I=Xr(e.sheet);I&&(S._cssText=Xt(I,en()))}if(b==="input"||b==="textarea"||b==="select"){var N=e.value,H=e.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&N?S.value=xt({type:S.type,tagName:b,value:N,maskInputOptions:s,maskInputFn:c}):H&&(S.checked=H)}if(b==="option"&&(e.selected&&!s.select?S.selected=!0:delete S.selected),b==="canvas"&&f){if(e.__context==="2d")ac(e)||(S.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var F=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height;var T=k.toDataURL(u.type,u.quality);F!==T&&(S.rr_dataURL=F)}}if(b==="img"&&d){ct||(ct=r.createElement("canvas"),jo=ct.getContext("2d"));var P=e,K=P.crossOrigin;P.crossOrigin="anonymous";var le=function(){try{ct.width=P.naturalWidth,ct.height=P.naturalHeight,jo.drawImage(P,0,0),S.rr_dataURL=ct.toDataURL(u.type,u.quality)}catch($){console.warn("Cannot inline img src=".concat(P.currentSrc,"! Error: ").concat($))}K?S.crossOrigin=K:P.removeAttribute("crossorigin")};P.complete&&P.naturalWidth!==0?le():P.onload=le}if((b==="audio"||b==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),y){var O=e.getBoundingClientRect(),D=O.width,B=O.height;S={class:S.class,rr_width:"".concat(D,"px"),rr_height:"".concat(B,"px")}}return b==="iframe"&&!p(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:ne.Element,tagName:b,attributes:S,childNodes:[],isSVG:bc(e)||void 0,needBlock:y,rootId:h}}function z(e){return e===void 0?"":e.toLowerCase()}function xc(e,t){if(t.comment&&e.type===ne.Comment)return!0;if(e.type===ne.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 je(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,p=f===void 0?{}:f,g=t.maskTextFn,m=t.maskInputFn,h=t.slimDOMOptions,y=t.dataURLOptions,b=y===void 0?{}:y,S=t.inlineImages,w=S===void 0?!1:S,v=t.recordCanvas,E=v===void 0?!1:v,C=t.onSerialize,I=t.onIframeLoad,N=t.iframeLoadTimeout,H=N===void 0?5e3:N,F=t.onStylesheetLoad,k=t.stylesheetLoadTimeout,T=k===void 0?5e3:k,P=t.keepIframeSrcFn,K=P===void 0?function(){return!1}:P,le=t.newlyAddedElement,O=le===void 0?!1:le,D=t.preserveWhiteSpace,B=D===void 0?!0:D,$=vc(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:w,recordCanvas:E,keepIframeSrcFn:K,newlyAddedElement:O});if(!$)return console.warn(e,"not serialized"),null;var oe;n.hasNode(e)?oe=n.getId(e):xc($,h)||!B&&$.type===ne.Text&&!$.isStyle&&!$.textContent.replace(/^\s+|\s+$/gm,"").length?oe=qe:oe=Qr();var V=Object.assign($,{id:oe});if(n.add(e,V),oe===qe)return null;C&&C(e);var te=!l;if(V.type===ne.Element){te=te&&!V.needBlock,delete V.needBlock;var ie=e.shadowRoot;ie&&Ye(ie)&&(V.isShadowHost=!0)}if((V.type===ne.Document||V.type===ne.Element)&&te){h.headWhitespace&&V.type===ne.Element&&V.tagName==="head"&&(B=!1);for(var de={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:m,slimDOMOptions:h,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:B,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:H,onStylesheetLoad:F,stylesheetLoadTimeout:T,keepIframeSrcFn:K},L=0,re=Array.from(e.childNodes);L<re.length;L++){var ce=re[L],Y=je(ce,de);Y&&V.childNodes.push(Y)}if(nc(e)&&e.shadowRoot)for(var ue=0,U=Array.from(e.shadowRoot.childNodes);ue<U.length;ue++){var ce=U[ue],Y=je(ce,de);Y&&(Ye(e.shadowRoot)&&(Y.isShadow=!0),V.childNodes.push(Y))}}return e.parentNode&&Ze(e.parentNode)&&Ye(e.parentNode)&&(V.isShadow=!0),V.type===ne.Element&&V.tagName==="iframe"&&Sc(e,function(){var ae=e.contentDocument;if(ae&&I){var Ve=je(ae,{doc:ae,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:m,slimDOMOptions:h,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:B,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:H,onStylesheetLoad:F,stylesheetLoadTimeout:T,keepIframeSrcFn:K});Ve&&I(e,Ve)}},H),V.type===ne.Element&&V.tagName==="link"&&V.attributes.rel==="stylesheet"&&Cc(e,function(){if(F){var ae=je(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:m,slimDOMOptions:h,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:B,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:H,onStylesheetLoad:F,stylesheetLoadTimeout:T,keepIframeSrcFn:K});ae&&F(e,ae)}},T),V}function Zo(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Yo: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,p=r.inlineStylesheet,g=p===void 0?!0:p,m=r.inlineImages,h=m===void 0?!1:m,y=r.recordCanvas,b=y===void 0?!1:y,S=r.maskAllInputs,w=S===void 0?!1:S,v=r.maskTextFn,E=r.maskInputFn,C=r.slimDOM,I=C===void 0?!1:C,N=r.dataURLOptions,H=r.preserveWhiteSpace,F=r.onSerialize,k=r.onIframeLoad,T=r.iframeLoadTimeout,P=r.onStylesheetLoad,K=r.stylesheetLoadTimeout,le=r.keepIframeSrcFn,O=le===void 0?function(){return!1}:le,D=w===!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}:w===!1?{password:!0}:w,B=I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I;return je(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:g,maskInputOptions:D,maskTextFn:v,maskInputFn:E,slimDOMOptions:B,dataURLOptions:N,inlineImages:h,recordCanvas:b,preserveWhiteSpace:H,onSerialize:F,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:P,stylesheetLoadTimeout:K,keepIframeSrcFn:O,newlyAddedElement:!1})}var Tc=/([^\\]):hover/,Pu=new RegExp(Tc.source,"g");function se(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
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`,Xo={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&&(Xo=new Proxy(Xo,{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 Xe(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)}}),()=>Xe(e,t,i||{},!0)}function Ce(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 Qt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function er(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function X(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(At(o,t,n))return!0;return!!(r&&(e.matches(r)||n&&o.closest(r)!==null))}function Jo(e,t){return t.getId(e)!==-1}function tr(e,t){return t.getId(e)===qe}function nn(e,t){if(Ze(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?nn(e.parentNode,t):!0:!0}function on(e){return!!e.changedTouches}function Qo(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 rr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function nr(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function or(e){return!!e?.shadowRoot}var Jt=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 W=(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))(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))(_||{}),ir=(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))(ir||{}),Fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Fe||{});function ei(e){return"__ln"in e}var an=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&&ei(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&&ei(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--)}},ti=(e,t)=>`${e}@${t}`,ar=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 an,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 p=f;for(;((d=(u=p?.getRootNode)===null||u===void 0?void 0:u.call(p))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&p.getRootNode().host;)p=p.getRootNode().host;let g=!this.doc.contains(s)&&(!p||!this.doc.contains(p));if(!s.parentNode||g)return;let m=Ze(s.parentNode)?this.mirror.getId(f):this.mirror.getId(s.parentNode),h=n(s);if(m===-1||h===-1)return r.addNode(s);let y=je(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:b=>{rr(b,this.mirror)&&this.iframeManager.addIframe(b),nr(b,this.mirror)&&this.stylesheetManager.trackLinkElement(b),or(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(b,S)=>{this.iframeManager.attachIframe(b,S),this.shadowDomManager.observeAttachShadow(b)},onStylesheetLoad:(b,S)=>{this.stylesheetManager.attachLinkElement(b,S)}});y&&t.push({parentId:m,nextId:h,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let s of Array.from(this.movedSet.values()))ri(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(let s of Array.from(this.addedSet.values()))!ni(this.droppedSet,s)&&!ri(this.removes,s,this.mirror)||ni(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 p=f.parentNode.host;if(this.mirror.getId(p)!==-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(!tr(t.target,this.mirror))switch(t.type){case"characterData":{let r=t.target.textContent;!X(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:rn(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=xt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),X(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]=tn(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(X(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=Ze(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);X(t.target,this.blockClass,this.blockSelector,!1)||tr(r,this.mirror)||!Jo(r,this.mirror)||(this.addedSet.has(r)?(sn(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||nn(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[ti(n,o)]?sn(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:Ze(t.target)&&Ye(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(tr(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[ti(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);X(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 sn(e,t){e.delete(t),t.childNodes.forEach(r=>sn(e,r))}function ri(e,t,r){return e.length===0?!1:oi(e,t,r)}function oi(e,t,r){let{parentNode:n}=t;if(!n)return!1;let o=r.getId(n);return e.some(i=>i.id===o)?!0:oi(e,n,r)}function ni(e,t){return e.size===0?!1:ii(e,t)}function ii(e,t){let{parentNode:r}=t;return r?e.has(r)?!0:ii(e,r):!1}var He=[],li=typeof CSSGroupingRule<"u",ci=typeof CSSMediaRule<"u",ui=typeof CSSSupportsRule<"u",di=typeof CSSConditionRule<"u";function Tt(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 ln(e,t){var r,n;let o=new ar;He.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 Mc({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(p=>(p.timeOffset-=f,p)),d),a=[],s=null},i),l=ft(d=>{let f=Tt(d),{clientX:p,clientY:g}=on(d)?d.changedTouches[0]:d;s||(s=Date.now()),a.push({x:p,y:g,id:n.getId(f),timeOffset:Date.now()-s}),c(typeof DragEvent<"u"&&d instanceof DragEvent?_.Drag:d instanceof MouseEvent?_.MouseMove:_.TouchMove)},o,{trailing:!1}),u=[se("mousemove",l,r),se("touchmove",l,r),se("drag",l,r)];return()=>{u.forEach(d=>d())}}function kc({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=Tt(u);if(X(d,n,o,!0))return;let f=on(u)?u.changedTouches[0]:u;if(!f)return;let p=r.getId(d),{clientX:g,clientY:m}=f;e({type:ir[l],id:p,x:g,y:m})};return Object.keys(ir).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let u=l.toLowerCase(),d=c(l);s.push(se(u,d,t))}),()=>{s.forEach(l=>l())}}function cn({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let a=ft(s=>{let c=Tt(s);if(!c||X(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 se("scroll",a,t)}function Nc({viewportResizeCb:e}){let t=-1,r=-1,n=ft(()=>{let o=Qt(),i=er();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return se("resize",n,window)}function ai(e,t){let r=Object.assign({},e);return t||delete r.userTriggered,r}var Rc=["INPUT","TEXTAREA","SELECT"],si=new WeakMap;function Lc({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(y){let b=Tt(y),S=y.isTrusted;if(b&&b.tagName==="OPTION"&&(b=b.parentElement),!b||!b.tagName||Rc.indexOf(b.tagName)<0||X(b,n,o,!0))return;let w=b.type;if(b.classList.contains(i))return;let v=b.value,E=!1;w==="radio"||w==="checkbox"?E=b.checked:(a[b.tagName.toLowerCase()]||a[w])&&(v=xt({maskInputOptions:a,tagName:b.tagName,type:w,value:v,maskInputFn:s})),d(b,ai({text:v,isChecked:E,userTriggered:S},l));let C=b.name;w==="radio"&&C&&E&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(I=>{I!==b&&d(I,ai({text:I.value,isChecked:!E,userTriggered:!1},l))})}function d(y,b){let S=si.get(y);if(!S||S.text!==b.text||S.isChecked!==b.isChecked){si.set(y,b);let w=r.getId(y);e(Object.assign(Object.assign({},b),{id:w}))}}let p=(c.input==="last"?["change"]:["input","change"]).map(y=>se(y,u,t)),g=t.defaultView;if(!g)return()=>{p.forEach(y=>y())};let m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),h=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...h.map(y=>Xe(y[0],y[1],{set(){u({target:this})}},!1,g))),()=>{p.forEach(y=>y())}}function sr(e){let t=[];function r(n,o){if(li&&n.parentRule instanceof CSSGroupingRule||ci&&n.parentRule instanceof CSSMediaRule||ui&&n.parentRule instanceof CSSSupportsRule||di&&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 We(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Oc({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:p}=We(this,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,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}=We(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}=We(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}=We(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),s.apply(this,[u])});let c={};li?c.CSSGroupingRule=n.CSSGroupingRule:(ci&&(c.CSSMediaRule=n.CSSMediaRule),di&&(c.CSSConditionRule=n.CSSConditionRule),ui&&(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,p){let{id:g,styleId:m}=We(this.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&e({id:g,styleId:m,adds:[{rule:f,index:[...sr(this),p||0]}]}),l[u].insertRule.apply(this,[f,p])},d.prototype.deleteRule=function(f){let{id:p,styleId:g}=We(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,removes:[{index:[...sr(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 un({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 Fc({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}=We((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:sr(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}=We((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:sr(this.parentRule)}),a.apply(this,[s])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function _c({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){let i=s=>ft(c=>{let l=Tt(c);if(!l||X(l,t,r,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:p}=l;e({type:s,id:n.getId(l),currentTime:u,volume:d,muted:f,playbackRate:p})},o.media||500),a=[se("play",i(0)),se("pause",i(1)),se("seeked",i(2)),se("volumechange",i(3)),se("ratechange",i(4))];return()=>{a.forEach(s=>s())}}function Dc({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=Ce(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 Pc(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:p,startOffset:g,endContainer:m,endOffset:h}=f;X(p,n,o,!0)||X(m,n,o,!0)||l.push({start:r.getId(p),startOffset:g,end:r.getId(m),endOffset:h})}i({ranges:l})};return s(),se("selectionchange",s)}function $c(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:p}=e;e.mutationCb=(...g)=>{t.mutation&&t.mutation(...g),r(...g)},e.mousemoveCb=(...g)=>{t.mousemove&&t.mousemove(...g),n(...g)},e.mouseInteractionCb=(...g)=>{t.mouseInteraction&&t.mouseInteraction(...g),o(...g)},e.scrollCb=(...g)=>{t.scroll&&t.scroll(...g),i(...g)},e.viewportResizeCb=(...g)=>{t.viewportResize&&t.viewportResize(...g),a(...g)},e.inputCb=(...g)=>{t.input&&t.input(...g),s(...g)},e.mediaInteractionCb=(...g)=>{t.mediaInteaction&&t.mediaInteaction(...g),c(...g)},e.styleSheetRuleCb=(...g)=>{t.styleSheetRule&&t.styleSheetRule(...g),l(...g)},e.styleDeclarationCb=(...g)=>{t.styleDeclaration&&t.styleDeclaration(...g),u(...g)},e.canvasMutationCb=(...g)=>{t.canvasMutation&&t.canvasMutation(...g),d(...g)},e.fontCb=(...g)=>{t.font&&t.font(...g),f(...g)},e.selectionCb=(...g)=>{t.selection&&t.selection(...g),p(...g)}}function fi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};$c(e,t);let n=ln(e,e.doc),o=Mc(e),i=kc(e),a=cn(e),s=Nc(e),c=Lc(e),l=_c(e),u=Oc(e,{win:r}),d=un(e,e.doc),f=Fc(e,{win:r}),p=e.collectFonts?Dc(e):()=>{},g=Pc(e),m=[];for(let h of e.plugins)m.push(h.observer(h.callback,r,h.options));return()=>{He.forEach(h=>h.reset()),n.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),f(),p(),g(),m.forEach(h=>h())}}var Mt=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 lr=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Mt(Qr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Mt(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 W.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:W.IncrementalSnapshot,data:{source:_.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case W.Meta:case W.Load:case W.DomContentLoaded:return!1;case W.Plugin:return r;case W.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case W.IncrementalSnapshot:switch(r.data.source){case _.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 _.Drag:case _.TouchMove:case _.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case _.ViewportResize:return!1;case _.MediaInteraction:case _.MouseInteraction:case _.Scroll:case _.CanvasMutation:case _.Input:return this.replaceIds(r.data,t,["id"]),r;case _.StyleSheetRule:case _.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case _.Font:return r;case _.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case _.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 cr=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(Ce(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),ln(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),cn(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)),un({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let r=this;this.restorePatches.push(Ce(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 mi(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 pi(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+/",Wc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(kt=0;kt<mt.length;kt++)Wc[mt.charCodeAt(kt)]=kt;var kt,hi=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 gi=new Map;function Hc(e,t){let r=gi.get(e);return r||(r=new Map,gi.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var dn=(e,t,r)=>{if(!e||!(yi(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=Hc(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ur(e,t,r){if(e instanceof Array)return e.map(n=>ur(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=hi(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ur(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:[ur(e.data,t,r),e.width,e.height]};if(yi(e,t)||typeof e=="object"){let n=e.constructor.name,o=dn(e,t,r);return{rr_type:n,index:o}}}}return e}var dr=(e,t,r)=>[...e].map(n=>ur(n,t,r)),yi=(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 bi(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=Ce(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return X(this.canvas,r,n,!0)||setTimeout(()=>{let u=dr([...l],t,this);e(this.canvas,{type:Fe["2D"],property:a,args:u})},0),c.apply(this,l)}});o.push(s)}catch{let c=Xe(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Fe["2D"],property:a,args:[l],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function fn(e,t,r){let n=[];try{let o=Ce(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...s){return X(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 wi(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=Ce(e,l,function(d){return function(...f){let p=d.apply(this,f);if(dn(p,a,this),!X(this.canvas,n,o,!0)){let g=dr([...f],a,this),m={type:t,property:l,args:g};r(this.canvas,m)}return p}});s.push(u)}catch{let d=Xe(e,l,{set(f){r(this.canvas,{type:t,property:l,args:[f],setter:!0})}});s.push(d)}return s}function Si(e,t,r,n,o){let i=[];return i.push(...wi(t.WebGLRenderingContext.prototype,Fe.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...wi(t.WebGL2RenderingContext.prototype,Fe.WebGL2,e,r,n,o,t)),()=>{i.forEach(a=>a())}}var mn=null;try{Ci=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Ar=="function"&&Ar("worker_threads"),mn=Ci.Worker}catch{}var Ci;function Bc(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function vi(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Bc(e,o),a=i.indexOf(`
`,10)+1,s=i.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(l){return new mn(s,Object.assign({},l,{eval:!0}))}}function Uc(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 Vc(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Uc(e,o),a=i.indexOf(`
`,10)+1,s=i.substring(a)+(n?"//# sourceMappingURL="+n:""),c=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(c)}function Ei(e,t,r){var n;return function(i){return n=n||Vc(e,t,r),new Worker(n,i)}}var Gc=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function Ii(){return Gc}function Ai(e,t,r){return Ii()?vi(e,t,r):Ei(e,t,r)}var xi=Ai("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var fr=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=fn(r,n,o),s=new Map,c=new xi;c.onmessage=g=>{let{id:m}=g.data;if(s.set(m,!1),!("base64"in g.data))return;let{base64:h,type:y,width:b,height:S}=g.data;this.mutationCb({id:m,type:Fe["2D"],commands:[{property:"clearRect",args:[0,0,b,S]},{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 g=[];return r.document.querySelectorAll("canvas").forEach(m=>{X(m,n,o,!0)||g.push(m)}),g},p=g=>{if(u&&g-u<l){d=requestAnimationFrame(p);return}u=g,f().forEach(m=>pi(this,void 0,void 0,function*(){var h;let y=this.mirror.getId(m);if(s.get(y))return;if(s.set(y,!0),["webgl","webgl2"].includes(m.__context)){let S=m.getContext(m.__context);((h=S?.getContextAttributes())===null||h===void 0?void 0:h.preserveDrawingBuffer)===!1&&S?.clear(S.COLOR_BUFFER_BIT)}let b=yield createImageBitmap(m);c.postMessage({id:y,bitmap:b,width:m.width,height:m.height,dataURLOptions:i.dataURLOptions},[b])})),d=requestAnimationFrame(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=fn(t,r,n),i=bi(this.processMutation.bind(this),t,r,n),a=Si(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=>mi(a,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};var mr=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Jt,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:Jr(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 ee(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var J,pr,pn,hr=!1,ve=qo();function Je(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:p,maskTextFn:g,hooks:m,packFn:h,sampling:y={},dataURLOptions:b={},mousemoveWait:S,recordCanvas:w=!1,recordCrossOriginIframes:v=!1,userTriggeredOnInput:E=!1,collectFonts:C=!1,inlineImages:I=!1,plugins:N,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:F=new Set([])}=e,k=v?window.parent===window:!0,T=!1;if(!k)try{window.parent.document,T=!1}catch{T=!0}if(k&&!t)throw new Error("emit function is required");S!==void 0&&y.mousemove===void 0&&(y.mousemove=S),ve.reset();let P=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},K=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||{};Qo();let le,O=0,D=L=>{for(let re of N||[])re.eventProcessor&&(L=re.eventProcessor(L));return h&&(L=h(L)),L};J=(L,re)=>{var ce;if(!((ce=He[0])===null||ce===void 0)&&ce.isFrozen()&&L.type!==W.FullSnapshot&&!(L.type===W.IncrementalSnapshot&&L.data.source===_.Mutation)&&He.forEach(Y=>Y.unfreeze()),k)t?.(D(L),re);else if(T){let Y={type:"rrweb",event:D(L),isCheckout:re};window.parent.postMessage(Y,"*")}if(L.type===W.FullSnapshot)le=L,O=0;else if(L.type===W.IncrementalSnapshot){if(L.data.source===_.Mutation&&L.data.isAttachIframe)return;O++;let Y=n&&O>=n,ue=r&&L.timestamp-le.timestamp>r;(Y||ue)&&pr(!0)}};let B=L=>{J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.Mutation},L)}))},$=L=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.Scroll},L)})),oe=L=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.CanvasMutation},L)})),V=L=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.AdoptedStyleSheet},L)})),te=new mr({mutationCb:B,adoptedStyleSheetCb:V}),ie=new lr({mirror:ve,mutationCb:B,stylesheetManager:te,recordCrossOriginIframes:v,wrappedEmit:J});for(let L of N||[])L.getMirror&&L.getMirror({nodeMirror:ve,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});pn=new fr({recordCanvas:w,mutationCb:oe,win:window,blockClass:o,blockSelector:i,mirror:ve,sampling:y.canvas,dataURLOptions:b});let de=new cr({mutationCb:B,scrollCb:$,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:P,dataURLOptions:b,maskTextFn:g,maskInputFn:p,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:K,iframeManager:ie,stylesheetManager:te,canvasManager:pn,keepIframeSrcFn:H},mirror:ve});pr=(L=!1)=>{var re,ce,Y,ue,U,ae;J(ee({type:W.Meta,data:{href:window.location.href,width:er(),height:Qt()}}),L),te.reset(),He.forEach(q=>q.lock());let Ve=Zo(document,{mirror:ve,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:P,maskTextFn:g,slimDOM:K,dataURLOptions:b,recordCanvas:w,inlineImages:I,onSerialize:q=>{rr(q,ve)&&ie.addIframe(q),nr(q,ve)&&te.trackLinkElement(q),or(q)&&de.addShadowRoot(q.shadowRoot,document)},onIframeLoad:(q,ye)=>{ie.attachIframe(q,ye),de.observeAttachShadow(q)},onStylesheetLoad:(q,ye)=>{te.attachLinkElement(q,ye)},keepIframeSrcFn:H});if(!Ve)return console.warn("Failed to snapshot the document");J(ee({type:W.FullSnapshot,data:{node:Ve,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((ce=(re=document?.body)===null||re===void 0?void 0:re.parentElement)===null||ce===void 0?void 0:ce.scrollLeft)||((Y=document?.body)===null||Y===void 0?void 0:Y.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((U=(ue=document?.body)===null||ue===void 0?void 0:ue.parentElement)===null||U===void 0?void 0:U.scrollTop)||((ae=document?.body)===null||ae===void 0?void 0:ae.scrollTop)||0}}})),He.forEach(q=>q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&te.adoptStyleSheets(document.adoptedStyleSheets,ve.getId(document))};try{let L=[];L.push(se("DOMContentLoaded",()=>{J(ee({type:W.DomContentLoaded,data:{}}))}));let re=Y=>{var ue;return fi({mutationCb:B,mousemoveCb:(U,ae)=>J(ee({type:W.IncrementalSnapshot,data:{source:ae,positions:U}})),mouseInteractionCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.MouseInteraction},U)})),scrollCb:$,viewportResizeCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.ViewportResize},U)})),inputCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.Input},U)})),mediaInteractionCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.MediaInteraction},U)})),styleSheetRuleCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.StyleSheetRule},U)})),styleDeclarationCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.StyleDeclaration},U)})),canvasMutationCb:oe,fontCb:U=>J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.Font},U)})),selectionCb:U=>{J(ee({type:W.IncrementalSnapshot,data:Object.assign({source:_.Selection},U)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:P,inlineStylesheet:l,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:E,collectFonts:C,doc:Y,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:H,blockSelector:i,slimDOMOptions:K,dataURLOptions:b,mirror:ve,iframeManager:ie,stylesheetManager:te,shadowDomManager:de,canvasManager:pn,ignoreCSSAttributes:F,plugins:((ue=N?.filter(U=>U.observer))===null||ue===void 0?void 0:ue.map(U=>({observer:U.observer,options:U.options,callback:ae=>J(ee({type:W.Plugin,data:{plugin:U.name,payload:ae}}))})))||[]},m)};ie.addLoadListener(Y=>{L.push(re(Y.contentDocument))});let ce=()=>{pr(),L.push(re(document)),hr=!0};return document.readyState==="interactive"||document.readyState==="complete"?ce():L.push(se("load",()=>{J(ee({type:W.Load,data:{}})),ce()},window)),()=>{L.forEach(Y=>Y()),hr=!1}}catch(L){console.warn(L)}}Je.addCustomEvent=(e,t)=>{if(!hr)throw new Error("please add custom event after start recording");J(ee({type:W.Custom,data:{tag:e,payload:t}}))};Je.freezePage=()=>{He.forEach(e=>e.freeze())};Je.takeFullSnapshot=e=>{if(!hr)throw new Error("please take full snapshot after start recording");pr(e)};Je.mirror=ve;var hn=[],Ti=()=>{let e=Je({emit(r){hn.push(r),R({type:"RRWEB_EVENT",payload:{event:r}})},maskInputOptions:{password:!0},maskTextSelector:"input, textarea",ignoreClass:"rrweb-ignore"}),t=setInterval(()=>{hn=[]},6e4);return()=>{clearInterval(t),e?.(),hn=[]}};var Mi=()=>{let e=!1,t=()=>{R({type:"SCROLL_POSITION",payload:{scrollY:window.scrollY,scrollHeight:document.documentElement.scrollHeight,clientHeight:window.innerHeight,timestamp:Date.now()}}),e=!1},r=()=>{e||(requestAnimationFrame(t),e=!0)};window.addEventListener("scroll",r)},ki=()=>{let e=!1;function t(){return document.documentElement.scrollHeight>document.documentElement.clientHeight}function r(){e||t()&&(e=!0,R({type:"SCROLLABLE"}))}r(),document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",r),window.addEventListener("load",r),setTimeout(r,500)};var Ee=e=>(e.includes("dev_server")&&(e=e.split("dev_server")[1].slice(1)),e.includes("sandbox-scheduler/sandbox")&&(e=e.split("sandbox-scheduler/")[1].split("/").slice(1).join("/")),e.replace(/^\/dev-server\//,"")),gn=e=>e.replace(/^\/dev-server\//,"");function yn(e){for(let t in e){let r=t;if(r.startsWith("__reactFiber$")||r.startsWith("__reactContainer$"))return e[r]}return null}var Kc=0,jc=1,Yc=11,qc=14,Zc=7,Xc=10,Jc=9;function Qc(e){return e?typeof e.type=="function"||[Kc,jc,Yc,qc].includes(e.tag):!1}function eu(e){return e?[Zc,Xc,Jc].includes(e.tag):!1}function Ni(e){return e?typeof e.type!="string"?e.type?.displayName||e.type?.name||"Anonymous":typeof e.type=="string"?e.type:"Unknown":"Unknown"}function Ri(e){let t=e,r=t.return;for(;r&&eu(r);)r=r.return;if(r&&Qc(r)&&r._debugSource)return{...r._debugSource,fileName:Ee(gn(r._debugSource.fileName)),displayName:Ni(r)};for(t=e;t;){if(t._debugSource)return{...t._debugSource,fileName:Ee(gn(t._debugSource.fileName)),displayName:Ni(t)};t=t.return}return null}function tu(e){let t=yn(e);if(!t)return null;let r=Ri(t);return r?{filePath:Ee(r.fileName),lineNumber:r.lineNumber,col:r.columnNumber,displayName:r.displayName}:null}function ru(){let e=[],t=document.getElementById("root")||document.body,r=yn(t);if(r){let o=r;for(;o.return;)o=o.return;e.push(o)}let n=document.querySelectorAll('[data-reactroot], #root, [id*="root"]');for(let o of Array.from(n)){let i=yn(o);if(i){let a=i;for(;a.return;)a=a.return;e.includes(a)||e.push(a)}}return e}function nu(e,t){let r=[];function n(o){if(!o)return;if(o.stateNode?.nodeType===Node.ELEMENT_NODE){let a=Ri(o);a&&Ee(a.fileName)===Ee(t.fileName)&&a.lineNumber===t.lineNumber&&a.columnNumber===t.columnNumber&&r.push(o)}let i=o.child;for(;i;)n(i),i=i.sibling}return n(e),r}function ou(e){let r={fileName:Ee(e.filePath),lineNumber:e.lineNumber,columnNumber:e.col??0},n=[],o=ru();for(let i of o){let a=nu(i,r);n.push(...a)}return n.map(i=>i.stateNode).filter(i=>!!i)}var Nt=class{constructor(){this.getElementIdFromDomNode=tu;this.findAllElementsById=ou}};var Li=Symbol.for("__jsxSource__");function iu(e){return`${e.filePath}:${e.lineNumber}:${e.columnNumber}`}function au(e){let t=iu(e),r=window.sourceElementMap?.get(t);if(!r)return[];let n=[];for(let o of r){let i=o.deref();i&&document.contains(i)?n.push(i):r.delete(o)}return r.size===0&&window.sourceElementMap?.delete(t),n}var Rt=class{getElementIdFromDomNode(t){let r=t[Li];if(r)return{filePath:Ee(r.fileName),lineNumber:r.lineNumber,col:r.columnNumber,displayName:r.displayName};let n=t.parentElement;for(;n;){let o=n[Li];if(o)return{filePath:Ee(o.fileName),lineNumber:o.lineNumber,col:o.columnNumber,displayName:o.displayName};n=n.parentElement}return null}findAllElementsById(t){return au?.({filePath:Ee(t.filePath),lineNumber:t.lineNumber,columnNumber:t.col??0})??[]}};var j=new Nt;function Oi(){if(!Object.getOwnPropertyDescriptor(window,"sourceElementMap")){let t;Object.defineProperty(window,"sourceElementMap",{set(r){t=r,j=r?new Rt:new Nt},get(){return t}})}window.sourceElementMap&&(j=new Rt)}var Fi=()=>{window.addEventListener("keydown",e=>{let t=[];e.metaKey&&t.push("Meta"),e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift");let r=e.key!=="Meta"&&e.key!=="Control"&&e.key!=="Alt"&&e.key!=="Shift"?e.key:"",n=[...t,r].filter(Boolean).join("+");["Meta+z","Meta+d","Meta+b","Ctrl+b","Alt+s","Alt+\xDF"].includes(n)&&e.preventDefault(),n&&setTimeout(()=>{e.defaultPrevented||R({type:"KEYBIND",payload:{compositeKey:n,rawEvent:{key:e.key,code:e.code,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,repeat:e.repeat},timestamp:Date.now()}})},0)},{passive:!0})};var gr=class{constructor(){this.hoveredElement=null,this.isActive=!1,this.selectedTooltips=new Map,this.clickedElementMap=new Map,this.scrollTimeout=null,this.mouseX=0,this.mouseY=0,this.styleElement=null,this.mouseDownElement=null,this.resizeObserver=null,this.primarySelectedElement=null}reset(){this.hoveredElement=null,this.scrollTimeout=null,this.selectedTooltips.forEach(t=>t.remove()),this.selectedTooltips.clear(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.primarySelectedElement=null}};var yr=e=>{let t=e?.parentElement;return!t||t.id==="root"||["HTML","BODY"].includes(t.tagName)?null:t},pt=e=>{let t=e.tagName.toLowerCase(),r=e.getAttribute("data-updated-icon-name");return r||j.getElementIdFromDomNode(e)?.displayName||t},ht=e=>{Math.abs(e.getBoundingClientRect().width-window.innerWidth)<5&&e.setAttribute("data-full-width","true"),pt(e)===A.INDEX_COMPONENT_NAME&&e.setAttribute("data-lov-index","true")};function bn(e,t){return e?.filePath===t?.filePath&&e?.lineNumber===t?.lineNumber&&e?.col===t?.col}var _i=2e3,br=e=>e.length<=_i?e:e.slice(0,_i)+"... [truncated]";var Di=()=>{let e=document.createElement("style"),t=":not(input):not(img):not(textarea):not(select):not(video):not(audio):not(iframe):not(canvas):not(svg)";e.textContent=`
        @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@700&display=swap');
        .gpt-selected-tooltip {
          position: fixed;
          z-index: ${A.Z_INDEX};
          pointer-events: none;
          background-color: ${A.HIGHLIGHT_COLOR};
          color: white;
          padding: 4px 8px;
          border-radius: 4px;
          font-family: 'Roboto Mono', monospace;
          font-size: 14px;
          font-weight: bold;
          line-height: 1;
          white-space: nowrap;
          display: block;
          box-shadow: 0 2px 4px rgba(0,0,0,0.2);
          margin: -2px 0 0 -2px;
          border: 1px solid rgba(255,255,255,0.3);
        }
        /* Hovered state: Uses outline on parent for standard elements */
        [${A.HOVERED_ATTR}][${A.PRIMARY_ATTR}]${t} {
          outline: 2px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: ${A.HIGHLIGHT_STYLE.NORMAL.OFFSET} !important;
        }
        [${A.HOVERED_ATTR}]:not([${A.PRIMARY_ATTR}])${t} {
          outline: 2px dotted ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: ${A.HIGHLIGHT_STYLE.NORMAL.OFFSET} !important;
        }
        [${A.SELECTED_ATTR}][${A.PRIMARY_ATTR}]${t} {
          outline: 1px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: 1px !important;
        }
        /* Secondary selected instances - dotted border */
        [${A.SELECTED_ATTR}]:not([${A.PRIMARY_ATTR}])${t} {
          outline: 1px dotted ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: 1px !important;
        }

        /* Primary replaced elements - solid */
        :is(input, img, textarea, select, video, audio, iframe, canvas, svg)[${A.HOVERED_ATTR}][${A.PRIMARY_ATTR}] {
          outline: 2px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: ${A.HIGHLIGHT_STYLE.NORMAL.OFFSET} !important;
        }
        /* Secondary replaced elements - dotted */
        :is(input, img, textarea, select, video, audio, iframe, canvas, svg)[${A.HOVERED_ATTR}]:not([${A.PRIMARY_ATTR}]) {
          outline: 2px dotted ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: ${A.HIGHLIGHT_STYLE.NORMAL.OFFSET} !important;
        }

        /* Primary selected replaced elements - solid */
        :is(input, img, textarea, select, video, audio, iframe, canvas, svg)[${A.SELECTED_ATTR}][${A.PRIMARY_ATTR}] {
          outline: 1px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: 1px !important;
        }
        /* Secondary selected replaced elements - dotted */
        :is(input, img, textarea, select, video, audio, iframe, canvas, svg)[${A.SELECTED_ATTR}]:not([${A.PRIMARY_ATTR}]) {
          outline: 1px dotted ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: 1px !important;
        }

        /* Remove outline from contenteditable selected elements to avoid conflicts */
        [${A.SELECTED_ATTR}][contenteditable] {
          outline: none !important;
        }

        /* Full-width elements use different offset for better visibility */
        [${A.HOVERED_ATTR}][data-full-width]${t},
        [${A.SELECTED_ATTR}][data-full-width]${t} {
          outline-offset: ${A.HIGHLIGHT_STYLE.FULL_WIDTH.OFFSET} !important;
        }

        /* Full-width offset for replaced elements */
        :is(input, img, textarea, select, video, audio, iframe, canvas, svg):is([${A.HOVERED_ATTR}], [${A.SELECTED_ATTR}])[data-full-width] {
          outline-offset: ${A.HIGHLIGHT_STYLE.FULL_WIDTH.OFFSET} !important;
        }

        /* Replaced elements inside overflow-hidden parents - hide their outline and style the parent instead */
        :is([class*="overflow-hidden"], [class*="overflow-clip"]) > :is(img, video, iframe, canvas):is([${A.HOVERED_ATTR}], [${A.SELECTED_ATTR}]) {
          outline: none !important;
        }

        /* Apply outline to overflow-hidden parent when it contains a hovered/selected replaced element */
        :is([class*="overflow-hidden"], [class*="overflow-clip"]):has(> :is(img, video, iframe, canvas)[${A.HOVERED_ATTR}]) {
          outline: 2px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: ${A.HIGHLIGHT_STYLE.NORMAL.OFFSET} !important;
        }

        :is([class*="overflow-hidden"], [class*="overflow-clip"]):has(> :is(img, video, iframe, canvas)[${A.SELECTED_ATTR}]) {
          outline: 1px solid ${A.HIGHLIGHT_COLOR} !important;
          outline-offset: 1px !important;
        }

      `,document.head.appendChild(e)},_e=(e,t)=>{if(!(!e||!t))try{let r=t.getBoundingClientRect(),o=t.getAttribute("data-lov-icon-preview")||pt(t),i=Math.abs(r.width-window.innerWidth)<5;if(e.style.maxWidth=`${A.MAX_TOOLTIP_WIDTH}px`,i)e.style.left=A.FULL_WIDTH_TOOLTIP_OFFSET,e.style.top=A.FULL_WIDTH_TOOLTIP_OFFSET;else{let a=r.top-A.TOOLTIP_OFFSET;e.style.left=`${r.left}px`,e.style.top=`${a}px`}e.textContent=o}catch(r){console.error("Error updating selected tooltip:",r),e.remove()}},Pi=(e,t,r)=>{let n=document.createElement("div");return n.className="gpt-selected-tooltip",n.setAttribute("role","tooltip"),document.body.appendChild(n),_e(n,t),e.selectedTooltips.set(r,n),n};var Be=({filePath:e,lineNumber:t,col:r,instanceId:n})=>`${e}:${t}:${r||0}:${n??""}`,wr=e=>{let[t,r,n,o]=e.split(":");return{filePath:t,lineNumber:parseInt(r,10),col:parseInt(n,10)||0,instanceId:o||void 0}},wn=(e,t)=>{let r=j.findAllElementsById({filePath:t.filePath,lineNumber:t.lineNumber,col:t.col??0});if(r.length<=1)return;let n=r.findIndex(o=>o===e);return n>=0?String(n):void 0},Ie=e=>{let t=j.getElementIdFromDomNode(e)??null;return{...{filePath:t?.filePath??"",lineNumber:t?.lineNumber??0,col:t?.col??0},displayName:t?.displayName??void 0}},gt=e=>{let t=Ie(e);return{...t,instanceId:wn(e,t)}};var vn=e=>{let t={};try{if(!(e instanceof HTMLElement))return t;let r=c=>{let l={};for(let u=0;u<c.length;u++){let d=c[u];if(d&&d.startsWith("--"))try{let f=c.getPropertyValue(d).trim();f&&(l[d]=f)}catch{}}return l},n=window.getComputedStyle(document.documentElement),o=r(n);Object.assign(t,o);let i=window.getComputedStyle(e),a=r(i);Object.assign(t,a);let s=e.style;for(let c=0;c<s.length;c++){let l=s[c];if(l&&l.startsWith("--"))try{let u=s.getPropertyValue(l).trim();u&&(t[l]=u)}catch{}}}catch(r){console.warn("Error extracting CSS variables:",r)}return t},$i=/url\((?:"([^"]*)"|'([^']*)'|([^)]*))\)/,su=/bg-\[url\((?:"([^"]*)"|'([^']*)'|([^)]*))\)\]/,Sn=(e,t)=>{if(!e)return null;try{return{url:new URL(e,window.location.href).href,source:t}}catch{return{url:e,source:t}}},Cn=e=>e&&(e[1]||e[2]||e[3])||"",En=e=>{if(!(e instanceof HTMLElement))return null;let t=e.getAttribute("class")||"";if(e.style.backgroundImage&&e.style.backgroundImage!=="none"){let o=e.style.backgroundImage.match($i),i=Sn(Cn(o),"inline");if(i)return i}let r=t.match(su),n=Sn(Cn(r),"tailwind");if(n)return n;try{let o=window.getComputedStyle(e);if(o.backgroundImage&&o.backgroundImage!=="none"){let i=o.backgroundImage.match($i),a=Sn(Cn(i),"css");if(a)return a}}catch{}return null};var Wi=e=>{let t=[],r=0;for(let n of Array.from(e.childNodes))if(n.nodeType===Node.TEXT_NODE){let i=(n.textContent||"").trim();i&&(t.push({type:"text",content:i,editable:!0,index:r}),r++)}else if(n.nodeType===Node.ELEMENT_NODE){let o=n,i=o.tagName.toLowerCase();t.push({type:"element",tagName:i,textContent:br(o.textContent||""),editable:!1,index:r}),r++}return t},Qe=e=>{let t=e.tagName.toLowerCase(),r=pt(e),n=gt(e),o=Array.from(e.children).filter(s=>!bn(Ie(s),Ie(e))).filter((s,c,l)=>c===l.findIndex(u=>bn(Ie(u),Ie(s)))).map(s=>{let c=gt(s),l=s.tagName.toLowerCase(),u=pt(s),d=vn(s),f=En(s);return{filePath:c.filePath,lineNumber:c.lineNumber,col:c.col,instanceId:c.instanceId,elementType:l,componentName:u,className:s.getAttribute("class")||"",textContent:br(s.textContent||""),textNodes:Wi(s),attrs:{src:(()=>{let p=s.getAttribute("src");if(!p)return"";if(s.tagName.toLowerCase()==="img")try{return new URL(p,window.location.href).href}catch{return p}return p})(),placeholder:s.getAttribute("placeholder")||"",href:s.getAttribute("href")||"",type:s.getAttribute("type")||"",backgroundImage:f?.url??"",backgroundImageSource:f?.source??""},cssVariables:d}}),i=vn(e),a=En(e);return{filePath:n.filePath,lineNumber:n.lineNumber,col:n.col,instanceId:n.instanceId,elementType:t,componentName:r,children:o,className:e.getAttribute("class")||"",textContent:br(e.textContent||""),textNodes:Wi(e),attrs:{src:(()=>{let s=e.getAttribute("src");if(!s)return"";if(e.tagName.toLowerCase()==="img")try{return new URL(s,window.location.href).href}catch{return s}return s})(),placeholder:e.getAttribute("placeholder")||"",href:e.getAttribute("href")||"",type:e.getAttribute("type")||"",backgroundImage:a?.url??"",backgroundImageSource:a?.source??""},cssVariables:i}};var Hi=(e,t=!1)=>{e.setAttribute(A.HOVERED_ATTR,"true"),t?e.setAttribute(A.PRIMARY_ATTR,"true"):e.removeAttribute(A.PRIMARY_ATTR),ht(e)},Ue=e=>{e.removeAttribute(A.HOVERED_ATTR),e.hasAttribute(A.SELECTED_ATTR)||(e.removeAttribute("data-full-width"),e.removeAttribute("data-lov-index"),e.removeAttribute(A.PRIMARY_ATTR)),e instanceof HTMLElement&&(e.style.cursor="")};var lu=e=>e.tagName.toLowerCase()!=="svg"&&e.closest("svg")!==null,Lt=e=>e.tagName.toLowerCase()==="html"?null:lu(e)?e.closest("svg"):e;var et=(e,t,r)=>{let n=Be({filePath:t.filePath,lineNumber:t.lineNumber,col:t.col??0,instanceId:t.instanceId}),o=e.clickedElementMap.get(n);if(o instanceof HTMLElement&&document.contains(o)&&r.includes(o))return o;if(t.instanceId){let i=r.find(a=>wn(a,{filePath:t.filePath,lineNumber:t.lineNumber,col:t.col??0})===t.instanceId);if(i)return i}return r[0]??null};var Sr=(e,t,r,n,o=!1)=>{if(!(e instanceof HTMLElement))return;if(e.getAttribute("contenteditable")==="true"){if(o){e.focus();let d=window.getSelection();d&&d.selectAllChildren(e)}return}e.setAttribute("contenteditable","true");let i=window.getComputedStyle(e),a=i.webkitTextFillColor==="transparent"||i.color==="rgba(0, 0, 0, 0)",s=i.backgroundClip==="text"||i.webkitBackgroundClip==="text";if(a||s){let d=document.documentElement.classList.contains("dark")||window.matchMedia("(prefers-color-scheme: dark)").matches;e.style.caretColor=d?"#fff":"#000"}if(o){e.focus();let d=window.getSelection();d&&d.selectAllChildren(e)}let c=d=>{R({type:"ELEMENT_TEXT_UPDATED",payload:{id:t,content:e.innerText,textNodeIndex:n}})},l=d=>{if(d.target!==e)return;if(d.stopPropagation(),(d.metaKey||d.ctrlKey)&&d.key==="Enter"){d.preventDefault(),R({type:"KEYBIND",payload:{compositeKey:d.metaKey?"Meta+Enter":"Ctrl+Enter",rawEvent:{key:d.key,code:d.code,metaKey:d.metaKey,ctrlKey:d.ctrlKey,altKey:d.altKey,shiftKey:d.shiftKey},timestamp:Date.now()}});return}d.key==="Escape"&&(d.preventDefault(),r.forEach(p=>{p instanceof HTMLElement&&p.blur()}))},u=()=>{e.removeAttribute("contenteditable"),e.style.caretColor="",e.removeEventListener("input",c),document.removeEventListener("keydown",l,{capture:!0}),e.removeEventListener("blur",u)};e.addEventListener("input",c),document.addEventListener("keydown",l,{capture:!0}),e.addEventListener("blur",u)};var Bi=(e,t)=>{let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>e(...n),t)}};function Ui(e){let t=m=>m instanceof HTMLElement?m.closest('[contenteditable="true"]')!==null:m instanceof Node&&m.parentElement?m.parentElement.closest('[contenteditable="true"]')!==null:!1,r=m=>m instanceof Element?Lt(m):m instanceof Node&&m.parentElement?Lt(m.parentElement):null,n=(m,h)=>{R({type:"ELEMENT_DOUBLE_CLICKED",payload:{element:m,rect:h,isMultiSelect:!1}})},o=()=>{if(!e.primarySelectedElement||!document.contains(e.primarySelectedElement))return;let m=e.primarySelectedElement.getBoundingClientRect(),h=gt(e.primarySelectedElement);R({type:"SELECTED_ELEMENT_BOUNDS_UPDATED",payload:{rect:m,id:h}})},i=m=>{if(e.resizeObserver&&e.resizeObserver.disconnect(),e.primarySelectedElement=m,!m){e.resizeObserver=null;return}e.resizeObserver=new ResizeObserver(()=>{o()}),e.resizeObserver.observe(m)},a=Bi(m=>{if(!e.isActive||e.mouseDownElement)return;let h=m.target;if(!(h instanceof Element))return;let y=Lt(h);if(!y)return;e.hoveredElement&&j.findAllElementsById(Ie(e.hoveredElement)).forEach(w=>{Ue(w)}),e.hoveredElement=y,(e.hoveredElement&&j.findAllElementsById(Ie(e.hoveredElement)))?.forEach(S=>{Hi(S,S===y)})},A.DEBOUNCE_DELAY),s=Bi(()=>{e.isActive&&e.hoveredElement&&((e.hoveredElement&&j.findAllElementsById(Ie(e.hoveredElement)))?.forEach(h=>{h.removeAttribute(A.HOVERED_ATTR),h.hasAttribute(A.SELECTED_ATTR)||(h.removeAttribute(A.PRIMARY_ATTR),Ue(h))}),e.hoveredElement=null)},A.DEBOUNCE_DELAY);return{sendBoundsUpdate:o,observeSelectedElement:i,handleMouseOver:a,handleMouseOut:s,handleScroll:()=>{e.scrollTimeout&&clearTimeout(e.scrollTimeout),e.isActive&&(R({type:"SCROLL_HAPPENED"}),o()),e.selectedTooltips.forEach((m,h)=>{let y=e.clickedElementMap.get(h);if(y&&document.contains(y))_e(m,y);else{let b=j.findAllElementsById(wr(h));b.length>0&&_e(m,b[0])}}),e.hoveredElement&&Ue(e.hoveredElement),e.scrollTimeout=setTimeout(()=>{e.scrollTimeout=null;let m=document.elementFromPoint(e.mouseX,e.mouseY);m&&e.isActive&&a({target:m})},A.SCROLL_DEBOUNCE)},handleMouseDown:m=>{if(!e.isActive){e.mouseDownElement=null;return}let h=m.target;if(!(h instanceof Element)){e.mouseDownElement=null;return}e.mouseDownElement=Lt(h),m.target&&m.target instanceof HTMLElement&&["input","textarea","select"].includes(m.target.tagName.toLowerCase())&&m.preventDefault()},handleClick:m=>{if(!e.isActive||t(m.target))return;let h=r(m.target);if(!h||(m.preventDefault(),m.stopPropagation(),e.primarySelectedElement===h))return;if(e.mouseDownElement!==h){e.mouseDownElement=null;return}e.mouseDownElement=null;let y=m.metaKey||m.ctrlKey,b=Qe(h),S=h.getBoundingClientRect(),w=Be({filePath:b.filePath,lineNumber:b.lineNumber,col:b.col,instanceId:b.instanceId});e.clickedElementMap.set(w,h),y||i(h),j.findAllElementsById(Ie(h)).forEach(E=>{E.setAttribute(A.SELECTED_ATTR,"true"),E===h?E.setAttribute(A.PRIMARY_ATTR,"true"):E.removeAttribute(A.PRIMARY_ATTR),ht(E)}),R({type:"ELEMENT_CLICKED",payload:{element:b,rect:S,isMultiSelect:y}})},handleDoubleClick:m=>{let h=r(m.target);if(!h)return;let y=Qe(h),b=h.getBoundingClientRect();if(!e.isActive){if(!(m.metaKey||m.ctrlKey))return;m.preventDefault(),m.stopPropagation(),n(y,b);return}if(t(m.target))return;m.preventDefault(),m.stopPropagation();let S=gt(h),w=j.findAllElementsById(S);Sr(h,S,w,void 0,!0),n(y,b)},handleResize:()=>{e.selectedTooltips.forEach((m,h)=>{let y=e.clickedElementMap.get(h);if(y&&document.contains(y))_e(m,y);else{let b=j.findAllElementsById(wr(h));b.length>0&&_e(m,b[0])}})},handleArrowUpToParent:m=>{if(!e.isActive||m.key!=="ArrowUp")return;let h=document.activeElement;if(h instanceof HTMLElement&&(h.isContentEditable||h.tagName==="INPUT"||h.tagName==="TEXTAREA"||h.tagName==="SELECT")||e.selectedTooltips.size!==1)return;m.preventDefault(),m.stopPropagation();let y=Array.from(e.selectedTooltips.keys())[0],b=j.findAllElementsById(wr(y));if(b.length===0)return;let S=b[0],w=yr(S);if(!w)return;let v=Qe(w),E=w.getBoundingClientRect();R({type:"ELEMENT_CLICKED",payload:{element:v,rect:E,isMultiSelect:!1}})},trackMousePosition:m=>{e.mouseX=m.clientX,e.mouseY=m.clientY}}}function Vi(e,t){return{addListeners:()=>{document.addEventListener("mouseover",t.handleMouseOver),document.addEventListener("mouseout",t.handleMouseOut),document.addEventListener("click",t.handleClick,!0),window.addEventListener("scroll",t.handleScroll,{passive:!0}),window.addEventListener("resize",t.handleResize,{passive:!0}),document.addEventListener("mousedown",t.handleMouseDown,!0),document.addEventListener("keydown",t.handleArrowUpToParent,{capture:!0});let o=document.createElement("style");o.textContent=`
        * {
          scroll-behavior: auto !important;
          cursor: default !important;
        }
        [contenteditable="true"], [contenteditable="true"] * {
          cursor: text !important;
        }
        /* Enable pointer events on SVGs inside interactive elements so icons can be selected */
        :is(button, a, [role="button"], [role="link"]) svg {
          pointer-events: auto !important;
        }
      `,document.head.appendChild(o),e.styleElement=o,lt.turnOn()},removeListeners:()=>{document.removeEventListener("mouseover",t.handleMouseOver),document.removeEventListener("mouseout",t.handleMouseOut),document.removeEventListener("click",t.handleClick,!0),window.removeEventListener("scroll",t.handleScroll),window.removeEventListener("resize",t.handleResize),document.removeEventListener("mousedown",t.handleMouseDown,!0),document.removeEventListener("keydown",t.handleArrowUpToParent,{capture:!0}),lt.turnOff(),e.styleElement&&(e.styleElement.remove(),e.styleElement=null),e.selectedTooltips.forEach(o=>o.remove()),e.selectedTooltips.clear(),e.resizeObserver&&(e.resizeObserver.disconnect(),e.resizeObserver=null),e.primarySelectedElement=null,document.body.style.cursor="",document.body.style.userSelect="",document.body.style.msUserSelect="",document.body.style.mozUserSelect="",e.hoveredElement&&(e.hoveredElement.hasAttribute(A.SELECTED_ATTR)||Ue(e.hoveredElement),e.hoveredElement=null)}}}function Gi(e,t,r){return n=>{try{if(!n?.origin||!n?.data?.type||!Se(n.origin))return;switch(n.data.type){case"TOGGLE_SELECTOR":let o=!!n.data.payload.isActive;e.isActive!==o&&(e.isActive=o,e.isActive?(r.addListeners(),document.body.setAttribute("data-selector-active","true"),st().then(()=>{document.querySelectorAll("button[disabled]").forEach(s=>{s.removeAttribute("disabled"),s.setAttribute("data-lov-disabled","")})}).catch(()=>{console.error("Failed to load")})):(r.removeListeners(),document.body.removeAttribute("data-selector-active"),document.querySelectorAll("[data-lov-disabled]").forEach(c=>{c.removeAttribute("data-lov-disabled"),c.setAttribute("disabled","")}),document.querySelectorAll(`[${A.HOVERED_ATTR}], [data-full-width], [${A.PRIMARY_ATTR}]`).forEach(c=>{c.hasAttribute(A.SELECTED_ATTR)||(c.removeAttribute(A.PRIMARY_ATTR),Ue(c),c instanceof HTMLElement&&(c.style.cursor=""))}),e.reset()));break;case"UPDATE_SELECTED_ELEMENTS":if(!Array.isArray(n.data.payload)){console.error("Invalid payload for UPDATE_SELECTED_ELEMENTS");return}e.selectedTooltips.forEach(s=>s.remove()),e.selectedTooltips.clear(),document.querySelectorAll(`[${A.SELECTED_ATTR}], [${A.HOVERED_ATTR}]`).forEach(s=>{s.removeAttribute(A.SELECTED_ATTR),s.removeAttribute(A.HOVERED_ATTR),s.removeAttribute(A.PRIMARY_ATTR),s.removeAttribute("data-full-width"),s.removeAttribute("data-lov-index")});let i=n.data.payload,a=null;i.forEach(s=>{if(!s?.filePath||!s?.lineNumber){console.error("Invalid element data:",s);return}let c=Be({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0,instanceId:s.instanceId}),l=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}),u=e.clickedElementMap.get(c),d=(u&&document.contains(u)?u:et(e,{filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0,instanceId:s.instanceId},l))??l[0];l.forEach(f=>{f.setAttribute(A.SELECTED_ATTR,"true"),f===d?f.setAttribute(A.PRIMARY_ATTR,"true"):f.removeAttribute(A.PRIMARY_ATTR),ht(f)}),d&&(Pi(e,d,c),a||(a=d))}),t.observeSelectedElement(a);break;case"SET_ELEMENT_CONTENT":{let{id:s,content:c,textNodeIndex:l}=n.data.payload,u=s,d=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}),f=d;if(u.instanceId!==void 0){let p=et(e,u,d);f=p?[p]:[]}f.forEach(p=>{if(l!==void 0){let g=0,m=!1;for(let h=0;h<p.childNodes.length;h++){let y=p.childNodes[h];if(y.nodeType===Node.TEXT_NODE){let b=y.textContent||"";if(b.trim()==="")continue;if(g===l){let S=b.match(/^\s*/)?.[0]||"",w=b.match(/\s*$/)?.[0]||"",v=S+c+w;y.textContent=v,m=!0;break}g++}else y.nodeType===Node.ELEMENT_NODE&&g++}m||(p.innerHTML=c)}else p.innerHTML=c})}break;case"SET_ELEMENT_ATTRS":{let{id:s,attrs:c}=n.data.payload,l=s,u=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}),d=u;if(l.instanceId!==void 0){let g=et(e,l,u);d=g?[g]:[]}d.forEach(g=>{Object.keys(c).forEach(m=>{if(m==="backgroundImage"&&g instanceof HTMLElement){let h=c[m];h?g.style.backgroundImage=`url(${JSON.stringify(h)})`:g.style.backgroundImage=""}else g.setAttribute(m,c[m])})});let f=Be({filePath:l.filePath,lineNumber:l.lineNumber,col:l.col,instanceId:l.instanceId}),p=e.selectedTooltips.get(f);if(p&&d.length>0){let g=e.clickedElementMap.get(f),m=g&&document.contains(g)?g:d[0];_e(p,m)}}break;case"SET_ELEMENT_ICON":{let{id:s,iconName:c}=n.data.payload,l=s,u=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}),d=u;if(l.instanceId!==void 0){let m=et(e,l,u);d=m?[m]:[]}let f=Be({filePath:l.filePath,lineNumber:l.lineNumber,col:l.col,instanceId:l.instanceId}),p=e.selectedTooltips.get(f);if(p&&d.length>0){let m=e.clickedElementMap.get(f),h=m&&document.contains(m)?m:d[0];h.setAttribute("data-lov-icon-preview",c),_e(p,h)}let g=async(m,h=5e3)=>{let y=new AbortController,b=setTimeout(()=>y.abort(),h);try{let S=await fetch(m,{signal:y.signal});return clearTimeout(b),S}catch(S){throw clearTimeout(b),S}};Promise.all(d.map(async m=>{if(m.tagName.toLowerCase()==="svg"){let h=m.innerHTML;try{let y=c.replace(/([A-Z])/g,"-$1").toLowerCase().slice(1),b=`https://unpkg.com/lucide-static@latest/icons/${encodeURIComponent(y)}.svg`,S=await g(b,5e3);if(!S.ok){console.warn(`Failed to fetch icon "${c}" (${S.status}): ${S.statusText}. Original icon preserved.`);return}let w=await S.text();if(!w||w.trim().length===0){console.warn(`Empty response received for icon "${c}". Original icon preserved.`);return}let E=new DOMParser().parseFromString(w,"image/svg+xml"),C=E.querySelector("parsererror");if(C){console.error(`Failed to parse SVG for icon "${c}":`,C.textContent);return}let I=E.querySelector("svg");if(!I||!I.innerHTML){console.warn(`Invalid SVG structure for icon "${c}". Original icon preserved.`);return}try{let N={};Array.from(m.attributes).forEach(F=>{F.name!=="viewBox"&&F.name!=="xmlns"&&(N[F.name]=F.value)}),m.innerHTML=I.innerHTML,Object.entries(N).forEach(([F,k])=>{m.setAttribute(F,k)});let H=I.getAttribute("viewBox");H&&m.setAttribute("viewBox",H),m.setAttribute("data-lov-icon-preview",c),m.setAttribute("data-updated-icon-name",c)}catch(N){console.error(`Failed to update DOM for icon "${c}":`,N),m.innerHTML=h}}catch(y){y instanceof Error?y.name==="AbortError"?console.error(`Request timeout: Failed to load icon "${c}" within 5 seconds. Original icon preserved.`):console.error(`Failed to load icon "${c}":`,y.message):console.error(`Failed to load icon "${c}":`,y)}}})).catch(m=>{console.error("Failed to update icons:",m)})}break;case"SET_STYLESHEET":{let{stylesheet:s,fontLinks:c=[]}=n.data.payload,l=Array.from(document.querySelectorAll('link[id^="lovable-font-"]')),u=new Set;c.forEach(({fontUrl:f,linkId:p})=>{if(f&&p){let g=`lovable-font-${p}`;if(u.add(g),document.getElementById(g))return;let h=document.createElement("link");h.id=g,h.rel="stylesheet",h.href=f,document.head.appendChild(h)}}),l.forEach(f=>{u.has(f.id)||f.remove()});let d=document.getElementById(A.OVERRIDE_STYLESHEET_ID);d||(d=document.createElement("style"),d.id=A.OVERRIDE_STYLESHEET_ID,document.head.appendChild(d)),d.innerHTML=s;break}case"EDIT_TEXT_REQUESTED":{let{id:s}=n.data.payload,c=s,l=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}),u=et(e,c,l);u&&Sr(u,c,l,void 0,!0);break}case"HOVER_ELEMENT_REQUESTED":{let{id:s}=n.data.payload;document.querySelectorAll(`[${A.HOVERED_ATTR}]`).forEach(l=>{l.removeAttribute(A.HOVERED_ATTR),l.removeAttribute(A.PRIMARY_ATTR)}),j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}).forEach((l,u)=>{l.setAttribute(A.HOVERED_ATTR,"true"),u===0&&l.setAttribute(A.PRIMARY_ATTR,"true")});break}case"UNHOVER_ELEMENT_REQUESTED":{let{id:s}=n.data.payload;j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0}).forEach(l=>{l.removeAttribute(A.HOVERED_ATTR),l.hasAttribute(A.SELECTED_ATTR)||l.removeAttribute(A.PRIMARY_ATTR)});break}case"GET_PARENT_ELEMENT":{let{id:s}=n.data.payload,c=s,l=j.findAllElementsById({filePath:s.filePath,lineNumber:s.lineNumber,col:s.col??0});if(l.length===0){R({type:"PARENT_ELEMENT",payload:{element:null}});break}let u=et(e,c,l);if(!u){R({type:"PARENT_ELEMENT",payload:{element:null}});break}let d=yr(u);if(!d)R({type:"PARENT_ELEMENT",payload:{element:null}});else{let f=d.getBoundingClientRect(),p=Qe(d);R({type:"PARENT_ELEMENT",payload:{element:p,rect:f}})}break}case"SCROLL_TO":{let{selector:s,top:c}=n.data.payload,l=null;try{l=s?document.querySelector(s):null}catch{}l?l.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}):c!=null&&window.scrollTo({top:c,behavior:"smooth"});break}case"GET_LOCALSTORAGE":case"ANNOTATION_START_PLACEMENT":case"ANNOTATION_CANCEL_PLACEMENT":case"ANNOTATION_GET_POSITIONS":break;default:console.warn("Unknown message type:",n.data.type)}}catch(o){console.error("Error handling message:",o),r.removeListeners(),e.reset()}}}var zi=()=>{Oi();let e=new gr,t=Ui(e),r=Vi(e,t),n=Gi(e,t,r);Fi();try{Di(),window.addEventListener("message",n),document.addEventListener("mousemove",t.trackMousePosition),document.addEventListener("dblclick",t.handleDoubleClick,!0),R({type:"SELECTOR_SCRIPT_LOADED",payload:{version:window.LOV_SCRIPT_VERSION}}),st().then(()=>{R({type:"REQUEST_PICKER_STATE"}),R({type:"REQUEST_SELECTED_ELEMENTS"})}).catch(()=>{console.error("Failed to load")})}catch(o){console.error("Failed to initialize selector script:",o)}};var ge=null,Cr=[];function Ki(){if(ge&&(ge.readyState===WebSocket.CONNECTING||ge.readyState===WebSocket.OPEN))return;let t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;ge=new WebSocket(t,"vite-hmr"),ge.onopen=()=>{Cr.forEach(r=>ge?.send(r)),Cr=[]},ge.onclose=()=>{ge=null},ge.onerror=r=>{console.error("[virtual-overrides] Error connecting to Vite HMR",r),ge=null,Cr=[],Ki()}}function In(e,t){let r=JSON.stringify({type:"custom",event:e,data:t});ge&&ge.readyState===WebSocket.OPEN?ge.send(r):(Cr.push(r),Ki())}function ji(){window.addEventListener("message",e=>{if(!(!e.origin||!Se(e.origin)))switch(e.data?.type){case"VIRTUAL_OVERRIDE":{let{payload:t}=e.data;t?.path&&t?.content!==void 0&&In("lovable:override",t);break}case"CLEAR_VIRTUAL_OVERRIDE":{let{payload:t}=e.data;t?.path&&In("lovable:clear-override",t);break}case"CLEAR_ALL_VIRTUAL_OVERRIDES":{In("lovable:clear-all-overrides",{});break}}})}window.LOV_SCRIPT_VERSION="1.4.3";console.log("\u2764\uFE0F Lovable Script \u2014 v1.4.3");var cu=()=>{if(window.location.search.includes("lov-override-script")){let r="http://localhost:8001/lovable.js";console.log("Overriding lovable.js script with:",r);let n=document.createElement("script");n.type="module",n.src=r,document.body.appendChild(n);return}if(window.top===window.self)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(r){document.hasFocus()&&e.call(this,r)},Go(),zo(),Bo(),Mi(),ki(),Wo(),Ho(),zi(),ji(),Uo(),Do();let t=Ti();window.addEventListener("unload",()=>{t&&t()})};cu();
/*! Bundled license information:

rrweb/es/rrweb/ext/tslib/tslib.es6.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** *)
*/
