From 9069d32564268f6b66ce8e505267fb36eaa0c1bc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 10 Nov 2026 13:58:34 +0800 Subject: [PATCH] feat(Dom2Image): update SnapDOM to v3.7.4 --- .../BootstrapBlazor.Dom2Image.csproj | 2 +- .../wwwroot/lib/snapdom.mjs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj index c8076ceb..f65cc125 100644 --- a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj +++ b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj @@ -1,7 +1,7 @@ - 11.0.0-rc.3.5 + 11.0.0-rc.3.6 diff --git a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs index 5e0d57fa..5020a513 100644 --- a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs +++ b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs @@ -1,19 +1,19 @@ /* * SnapDOM -* v3.7.2 +* v3.7.4 * License: MIT */ -var Bc=Object.defineProperty;var st=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var re=(t,e)=>{for(var n in e)Bc(t,n,{get:e[n],enumerable:!0})};function Gi(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function qi(t="soft"){t==="disabled"&&(j.computedStyle=new WeakMap,j.measureHints=new WeakMap,j.baseStyle=new gt(50),j.defaultStyle=new gt(64),j.image=new gt(100),j.background=new gt(100),j.resource=new gt(150),j.compress=new gt(50))}var gt,j,Mt=st(()=>{"use strict";gt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},j={image:new gt(100),background:new gt(100),resource:new gt(150),defaultStyle:new gt(64),baseStyle:new gt(50),compress:new gt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function ge(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Uc(t){let e=[],n=0,o=0,r="";for(let i=0;ii.dppx-s.dppx),(o.find(i=>i.dppx>=e)||o[o.length-1]).url):null}function ir(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function Hn(t,e){if(!e)return t;let[n,o,r]=e.zoomed,i=t.indexOf("")+8;if(i<8||!t.startsWith(n)||!t.startsWith(o,i)||!t.endsWith(r))return t;let[s,a,l]=e.flat;return s+t.slice(n.length,i)+a+t.slice(i+o.length,t.length-r.length)+l}function ie(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function sr(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}function hn(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function ar(t){return"\u2022".repeat(String(t??"").length)}function ft(t,e){return t?.nodeType===1&&t.localName===e}function Pt(t){return t?.nodeType===1&&t.namespaceURI===Hc}function Nt(t){return t?.nodeType===1&&t.namespaceURI===jc}function Jt(t){return t?.nodeType===11&&!!t.host}function Bt(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function lr(t){return t?.nodeType===9}var rr,zc,Hc,jc,vt=st(()=>{"use strict";rr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,zc=rr;Hc="http://www.w3.org/1999/xhtml",jc="http://www.w3.org/2000/svg"});function Vc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function i(s,a,l){if(r>=n)return;let u=Date.now();(o.get(a)||0)>u||(o.set(a,u+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){i("warn",s,a)},errorOnce(s,a){i("error",s,a)},reset(){o.clear(),r=0}}}function Ki(t,e,n){if(Qt.size>=Yi){let o=Date.now();for(let[r,i]of Qt)i.until<=o&&Qt.delete(r);for(;Qt.size>=Yi;)Qt.delete(Qt.keys().next().value)}Qt.set(t,{until:Date.now()+n,result:e})}function Gc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function qc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.split(/\{url(?:Raw)?\}/)[0],r=new URL(o||".",n);if(new URL(t,n).origin===r.origin)return!0}catch{}return!1}function Xc(t,e){if(!e||Gc(t)||qc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Yc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>ie(t)).replace("{url}",()=>encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ie(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ji(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"").replace(/^data:[^,]*/,r=>r.replace(/\s+/g,""))),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Kc(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function Qi(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function fr(t,e){try{t.onError?.(e)}catch{}}async function ut(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",i=e.errorTTL??8e3,s=e.headers||{},a=!!e.debug;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,p="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(p)?atob(y):decodeURIComponent(y),S=new Uint8Array([...w].map(C=>C.charCodeAt(0))),v=new Blob([S],{type:(p||"").split(";")[0]||""});return{ok:!0,data:v,status:200,url:t,fromCache:!1,mime:v.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ji(y),blob:y,status:p.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let l;try{l=Kc(t,{as:n,timeout:o,useProxy:r,errorTTL:i,credentials:e.credentials,headers:s})}catch{let p={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return fr(e,p),p}let u=Qt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Qt.delete(l);let c=cr.get(l);if(c)return c;let f=Xc(t,r)?Yc(t,r):t,d=e.credentials;if(!d)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,p);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),o),g=(async()=>{try{let p=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!p.ok){let w={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(l!==null&&i>0&&Ki(l,w,i),a){let S=`${p.status} ${p.statusText||""}`.trim();Xi.warnOnce(`http:${p.status}:${n}:${Qi(t)}`,`Couldn't load ${t} (HTTP ${S}).`)}return fr(e,w),w}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ji(y),blob:y,status:p.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:f,fromCache:!1,mime:b}}catch(p){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":p&&typeof p=="object"&&p.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&i>0&&Ki(l,b,i),a){let w=`${y}:${n}:${Qi(t)}`,S=y==="timeout"?`Timed out loading ${t} after ${o}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;Xi.errorOnce(w,S)}return fr(e,b),b}finally{clearTimeout(m),cr.delete(l)}})();return l!==null&&cr.set(l,g),g}var Xi,cr,Yi,Qt,ye=st(()=>{"use strict";vt();Xi=Vc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),cr=new Map,Yi=50,Qt=new Map});async function Ie(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=pn(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??ge(t);if(!o)return t;let r=sr(o),i=ie(r),s=(e.useProxy||"")+"|"+i;if(j.background.has(s)){let a=j.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ut(i,{as:"dataURL",useProxy:e.useProxy,debug:e.debug});return a.ok?(j.background.set(s,a.data),`url("${a.data}")`):(j.background.set(s,null),"none")}catch{return j.background.set(s,null),"none"}}var Zi=st(()=>{"use strict";Mt();vt();ye()});function ns(t,e){if(Jc.has(e))t.add(e);else if(e.startsWith("transform-origin-"))t.add("transform-origin");else return!1;return!0}function is(t){let e=t.replace(nf,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ss(t,e,n,o){for(let r=0;r5&&(d[0]==="m"||d[0]==="p")){let h=d.startsWith("margin")?"marginUnstable":d.startsWith("padding")?"paddingUnstable":null;h&&!o[h]&&ef.test(s.getPropertyValue(d))&&(o[h]=!0)}}}let u=i.selectorText;if(u&&u.includes(":has(")&&(o.usesHas=!0),u&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(u)&&(o.leaksAcrossSubtrees=!0),s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes("counter"))&&(o.leaksAcrossSubtrees=!0),u&&u.includes("&"))for(let c=i.parentRule;c&&u.includes("&");c=c.parentRule)c.selectorText&&(u=u.replace(/&/g,`:is(${c.selectorText})`));if(u&&(o.inContainer||es.test(u)||u.includes("+")||u.includes("~")))for(let c of Vn(u,",")){let f=c.trim();f&&(o.inContainer||es.test(f)||f.includes("+")||f.includes("~"))&&o.shareUnsafeSels.add(f)}if((a||l)&&of(i,u,a,o),u&&u.includes(":"))for(let c in ts)ts[c].test(u)&&n[c].push(is(u));if(i.styleSheet){if(!jn(i.styleSheet,e,n,o))return!1}else if(i.cssRules&&i.cssRules.length){let c=i.constructor?.name==="CSSContainerRule",f=i.constructor?.name==="CSSScopeRule";c&&o.inContainer++,f&&(o.inScope=(o.inScope||0)+1);let d=ss(i.cssRules,e,n,o);if(c&&o.inContainer--,f&&o.inScope--,!d)return!1}}return!0}function of(t,e,n,o){if(n&&t.constructor?.name==="CSSKeyframeRule"){o.svgKeyframes=!0;return}if(!e||o.inScope){n&&(o.svgGeometryAll=!0);return}let r=n?o.svgGeometrySels:o.svgAnimSels;for(let i of Vn(e,",")){let s=i.trim();s&&r.add(os.test(s)?is(s):s)}}function jn(t,e,n,o){let r;try{r=t.cssRules}catch{r=o.crossOriginRules?.(t)}return r?ss(r,e,n,o):!1}function pr(t,e){for(let n of t){let o=n.effect?.getKeyframes?.()||[];for(let r of o)for(let i of Object.keys(r))i==="offset"||i==="easing"||i==="composite"||i==="computedOffset"||e.add(i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function as(t){let e=new Set;return jn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:rs,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Vn(t,e){if(!t.includes(e))return[t];let n=[],o=0,r=null,i=0;for(let s=0;s"||f==="+"||f==="~")&&(o=c+1)}let r="",i=0;for(let c of t.slice(o))c==="("||c==="["?i++:c===")"||c==="]"?i--:i===0&&(r+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((r.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((r.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let u=(r.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function ur(t,e){if(!e.length)return"";if(e.some(o=>o.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function sf(t,e){let n={};for(let o in e){let r=e[o];(o==="before"||o==="after")&&r.push("q"),n[o]=ur(t,r)}return n}function ls(t,e){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let o=new Set(dr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:rs,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:e};for(let d of t.styleSheets)if(!jn(d,o,r,i))return n;let s=t.adoptedStyleSheets;if(Array.isArray(s)){for(let d of s)if(!jn(d,o,r,i))return n}if(typeof t.getAnimations=="function"){let d=new Set;pr(t.getAnimations(),d);for(let h of d)o.add(h),ns(i.svgGeometry,h)&&(i.svgGeometryAll=!0)}if(i.svgKeyframes)for(let d of i.svgAnimSels)i.svgGeometrySels.add(d);let a=t.createElement("div"),l=i.svgGeometryAll?null:ur(a,Array.from(i.svgGeometrySels)),u=Array.from(i.shareUnsafeSels),c=ur(a,u)===null?null:u.map(d=>({sel:d,key:rf(d)})),f=new Set(tf);for(let d of Zc)o.has(d)&&f.add(d);for(let d of i.pseudoProps)f.add(d);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&f.add("transform-origin"),i.pseudoProps.has("perspective")&&f.add("perspective-origin"),{universe:o,pseudoUniverse:f,svgGeometry:i.svgGeometry,svgGeometrySel:l,pseudoGates:sf(a,r),usesHas:i.usesHas,leaksAcrossSubtrees:i.leaksAcrossSubtrees,shareGate:c,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return n}}var Jc,Qc,dr,Zc,tf,os,rs,ef,ts,nf,es,Gn=st(()=>{"use strict";Jc=new Set(["r","cx","cy","rx","ry","x","y","width","height","d","transform","translate","rotate","scale","transform-origin","transform-box","vector-effect"]);Qc=/^(?:animation|transition)/,dr=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],Zc=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],tf=["display","width","height","min-width","min-height"],os=/(?{"use strict";cs=new WeakSet});function mr(t){if(t=String(t).toLowerCase(),mn.has(t)){let i={};return j.defaultStyle.set(t,i),i}if(j.defaultStyle.has(t))return j.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);e||(e=document.createElement("div"),tt(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let i of o){if(We(i))continue;let s=o.getPropertyValue(i);r[i]=s}for(let i of dr)!(i in r)&&!We(i)&&(r[i]=o.getPropertyValue(i));return e.removeChild(n),j.defaultStyle.set(t,r),r}function We(t){let e=fs.get(t);if(e===void 0){let n=String(t).toLowerCase();e=cf.has(n)||lf.test(n)||af.test(n),fs.set(t,e)}return e}function ps(t,e){let n=hf.get(t);if(n===void 0||e[n]!==e[t])return!1;let o=e["writing-mode"];if(o&&o!=="horizontal-tb")return!1;let r=e.direction;return!(r&&r!=="ltr")}function qn(t,e){return!uf.has(t)&&(e==="inline"||ff.has(t)||ds.has(t))}function gr(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||ds.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let i=(e.position||"static").toLowerCase();return i==="absolute"||i==="fixed"?!1:!gf.has(o)}function Oe(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),mn.has(e))return"";let r=[],i=mr(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=qn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",c=u==="nowrap"||u==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(We(m)||ps(m,t))continue;let g=t[m];if(!(us.has(m)&&df.has(e))){if(d){if(us.has(m))continue;if(pf.has(m)){g&&g!==i[m]&&(r.push(`${m}:${g}`),g!=="auto"&&(h=!0));continue}}if(g&&g!==i[m]){if((m==="height"||m==="block-size"||!c&&(m==="width"||m==="inline-size"))&&g.endsWith("px")&&g.includes(".")){let y=parseFloat(g);if(Number.isFinite(y)){r.push(`${m}:${(y+mf).toFixed(3)}px`);continue}}r.push(`${m}:${g}`)}}}if(d&&!a&&!o&&!h){let m=t.width;m&&m!=="auto"&&m!==i.width&&r.push(`min-width:${m}`)}return r.sort(),r.join(";")}function yr(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function br(t,e=null){let n=new Map;for(let s of t){let a=mr(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!ps(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=c.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:c}),n.get(f).tagList.push(s))}let o=[...n.values()],r=null;for(let{declarations:s}of o){let a=new Set(s);if(!r){r=a;continue}for(let l of r)a.has(l)||r.delete(l)}r??=new Set;let i="";if(r.size&&o.length>1){let s=o.flatMap(a=>a.tagList);i+=`${s.join(",")} { ${[...r].join("")} } +var Uc=Object.defineProperty;var st=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var re=(t,e)=>{for(var n in e)Uc(t,n,{get:e[n],enumerable:!0})};function Xi(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Yi(t="soft"){t==="disabled"&&(j.computedStyle=new WeakMap,j.measureHints=new WeakMap,j.baseStyle=new gt(50),j.defaultStyle=new gt(64),j.image=new gt(100),j.background=new gt(100),j.resource=new gt(150),j.compress=new gt(50))}var gt,j,Mt=st(()=>{"use strict";gt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},j={image:new gt(100),background:new gt(100),resource:new gt(150),defaultStyle:new gt(64),baseStyle:new gt(50),compress:new gt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function ge(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function jc(t){let e=[],n=0,o=0,r="";for(let i=0;ii.dppx-s.dppx),(o.find(i=>i.dppx>=e)||o[o.length-1]).url):null}function sr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function jn(t,e){if(!e)return t;let[n,o,r]=e.zoomed,i=t.indexOf("")+8;if(i<8||!t.startsWith(n)||!t.startsWith(o,i)||!t.endsWith(r))return t;let[s,a,l]=e.flat;return s+t.slice(n.length,i)+a+t.slice(i+o.length,t.length-r.length)+l}function ie(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function ar(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}function mn(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function lr(t){return"\u2022".repeat(String(t??"").length)}function ft(t,e){return t?.nodeType===1&&t.localName===e}function Pt(t){return t?.nodeType===1&&t.namespaceURI===Vc}function Nt(t){return t?.nodeType===1&&t.namespaceURI===Gc}function Jt(t){return t?.nodeType===11&&!!t.host}function Bt(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function cr(t){return t?.nodeType===9}var ir,Hc,Vc,Gc,vt=st(()=>{"use strict";ir=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Hc=ir;Vc="http://www.w3.org/1999/xhtml",Gc="http://www.w3.org/2000/svg"});function qc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function i(s,a,l){if(r>=n)return;let u=Date.now();(o.get(a)||0)>u||(o.set(a,u+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){i("warn",s,a)},errorOnce(s,a){i("error",s,a)},reset(){o.clear(),r=0}}}function Qi(t,e,n){if(Qt.size>=Ji){let o=Date.now();for(let[r,i]of Qt)i.until<=o&&Qt.delete(r);for(;Qt.size>=Ji;)Qt.delete(Qt.keys().next().value)}Qt.set(t,{until:Date.now()+n,result:e})}function Xc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Yc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.split(/\{url(?:Raw)?\}/)[0],r=new URL(o||".",n);if(new URL(t,n).origin===r.origin)return!0}catch{}return!1}function Kc(t,e){if(!e||Xc(t)||Yc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Jc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>ie(t)).replace("{url}",()=>encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ie(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Zi(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"").replace(/^data:[^,]*/,r=>r.replace(/\s+/g,""))),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Qc(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function ts(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function ur(t,e){try{t.onError?.(e)}catch{}}async function ut(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",i=e.errorTTL??8e3,s=e.headers||{},a=!!e.debug;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,p="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(p)?atob(y):decodeURIComponent(y),S=new Uint8Array([...w].map(C=>C.charCodeAt(0))),v=new Blob([S],{type:(p||"").split(";")[0]||""});return{ok:!0,data:v,status:200,url:t,fromCache:!1,mime:v.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Zi(y),blob:y,status:p.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let l;try{l=Qc(t,{as:n,timeout:o,useProxy:r,errorTTL:i,credentials:e.credentials,headers:s})}catch{let p={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return ur(e,p),p}let u=Qt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Qt.delete(l);let c=fr.get(l);if(c)return c;let f=Kc(t,r)?Jc(t,r):t,d=e.credentials;if(!d)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,p);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),o),g=(async()=>{try{let p=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!p.ok){let w={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(l!==null&&i>0&&Qi(l,w,i),a){let S=`${p.status} ${p.statusText||""}`.trim();Ki.warnOnce(`http:${p.status}:${n}:${ts(t)}`,`Couldn't load ${t} (HTTP ${S}).`)}return ur(e,w),w}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Zi(y),blob:y,status:p.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:f,fromCache:!1,mime:b}}catch(p){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":p&&typeof p=="object"&&p.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&i>0&&Qi(l,b,i),a){let w=`${y}:${n}:${ts(t)}`,S=y==="timeout"?`Timed out loading ${t} after ${o}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;Ki.errorOnce(w,S)}return ur(e,b),b}finally{clearTimeout(m),fr.delete(l)}})();return l!==null&&fr.set(l,g),g}var Ki,fr,Ji,Qt,ye=st(()=>{"use strict";vt();Ki=qc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),fr=new Map,Ji=50,Qt=new Map});async function Ie(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=hn(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??ge(t);if(!o)return t;let r=ar(o),i=ie(r),s=(e.useProxy||"")+"|"+i;if(j.background.has(s)){let a=j.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ut(i,{as:"dataURL",useProxy:e.useProxy,debug:e.debug});return a.ok?(j.background.set(s,a.data),`url("${a.data}")`):(j.background.set(s,null),"none")}catch{return j.background.set(s,null),"none"}}var es=st(()=>{"use strict";Mt();vt();ye()});function rs(t,e){if(Zc.has(e))t.add(e);else if(e.startsWith("transform-origin-"))t.add("transform-origin");else return!1;return!0}function as(t){let e=t.replace(rf,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ls(t,e,n,o){for(let r=0;r5&&(d[0]==="m"||d[0]==="p")){let h=d.startsWith("margin")?"marginUnstable":d.startsWith("padding")?"paddingUnstable":null;h&&!o[h]&&of.test(s.getPropertyValue(d))&&(o[h]=!0)}}}let u=i.selectorText;if(u&&u.includes(":has(")&&(o.usesHas=!0),u&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(u)&&(o.leaksAcrossSubtrees=!0),s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes("counter"))&&(o.leaksAcrossSubtrees=!0),u&&u.includes("&"))for(let c=i.parentRule;c&&u.includes("&");c=c.parentRule)c.selectorText&&(u=u.replace(/&/g,`:is(${c.selectorText})`));if(u&&(o.inContainer||os.test(u)||u.includes("+")||u.includes("~")))for(let c of Gn(u,",")){let f=c.trim();f&&(o.inContainer||os.test(f)||f.includes("+")||f.includes("~"))&&o.shareUnsafeSels.add(f)}if((a||l)&&sf(i,u,a,o),u&&u.includes(":"))for(let c in ns)ns[c].test(u)&&n[c].push(as(u));if(i.styleSheet){if(!Vn(i.styleSheet,e,n,o))return!1}else if(i.cssRules&&i.cssRules.length){let c=i.constructor?.name==="CSSContainerRule",f=i.constructor?.name==="CSSScopeRule";c&&o.inContainer++,f&&(o.inScope=(o.inScope||0)+1);let d=ls(i.cssRules,e,n,o);if(c&&o.inContainer--,f&&o.inScope--,!d)return!1}}return!0}function sf(t,e,n,o){if(n&&t.constructor?.name==="CSSKeyframeRule"){o.svgKeyframes=!0;return}if(!e||o.inScope){n&&(o.svgGeometryAll=!0);return}let r=n?o.svgGeometrySels:o.svgAnimSels;for(let i of Gn(e,",")){let s=i.trim();s&&r.add(is.test(s)?as(s):s)}}function Vn(t,e,n,o){let r;try{r=t.cssRules}catch{r=o.crossOriginRules?.(t)}return r?ls(r,e,n,o):!1}function hr(t,e){for(let n of t){let o=n.effect?.getKeyframes?.()||[];for(let r of o)for(let i of Object.keys(r))i==="offset"||i==="easing"||i==="composite"||i==="computedOffset"||e.add(i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function cs(t){let e=new Set;return Vn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:ss,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Gn(t,e){if(!t.includes(e))return[t];let n=[],o=0,r=null,i=0;for(let s=0;s"||f==="+"||f==="~")&&(o=c+1)}let r="",i=0;for(let c of t.slice(o))c==="("||c==="["?i++:c===")"||c==="]"?i--:i===0&&(r+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((r.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((r.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let u=(r.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function dr(t,e){if(!e.length)return"";if(e.some(o=>o.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function lf(t,e){let n={};for(let o in e){let r=e[o];(o==="before"||o==="after")&&r.push("q"),n[o]=dr(t,r)}return n}function fs(t,e){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let o=new Set(pr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:ss,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:e};for(let d of t.styleSheets)if(!Vn(d,o,r,i))return n;let s=t.adoptedStyleSheets;if(Array.isArray(s)){for(let d of s)if(!Vn(d,o,r,i))return n}if(typeof t.getAnimations=="function"){let d=new Set;hr(t.getAnimations(),d);for(let h of d)o.add(h),rs(i.svgGeometry,h)&&(i.svgGeometryAll=!0)}if(i.svgKeyframes)for(let d of i.svgAnimSels)i.svgGeometrySels.add(d);let a=t.createElement("div"),l=i.svgGeometryAll?null:dr(a,Array.from(i.svgGeometrySels)),u=Array.from(i.shareUnsafeSels),c=dr(a,u)===null?null:u.map(d=>({sel:d,key:af(d)})),f=new Set(nf);for(let d of ef)o.has(d)&&f.add(d);for(let d of i.pseudoProps)f.add(d);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&f.add("transform-origin"),i.pseudoProps.has("perspective")&&f.add("perspective-origin"),{universe:o,pseudoUniverse:f,svgGeometry:i.svgGeometry,svgGeometrySel:l,pseudoGates:lf(a,r),usesHas:i.usesHas,leaksAcrossSubtrees:i.leaksAcrossSubtrees,shareGate:c,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return n}}var Zc,tf,pr,ef,nf,is,ss,of,ns,rf,os,qn=st(()=>{"use strict";Zc=new Set(["r","cx","cy","rx","ry","x","y","width","height","d","transform","translate","rotate","scale","transform-origin","transform-box","vector-effect"]);tf=/^(?:animation|transition)/,pr=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],ef=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],nf=["display","width","height","min-width","min-height"],is=/(?{"use strict";us=new WeakSet});function gr(t){if(t=String(t).toLowerCase(),gn.has(t)){let i={};return j.defaultStyle.set(t,i),i}if(j.defaultStyle.has(t))return j.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);e||(e=document.createElement("div"),tt(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let i of o){if(We(i))continue;let s=o.getPropertyValue(i);r[i]=s}for(let i of pr)!(i in r)&&!We(i)&&(r[i]=o.getPropertyValue(i));return e.removeChild(n),j.defaultStyle.set(t,r),r}function We(t){let e=ds.get(t);if(e===void 0){let n=String(t).toLowerCase();e=uf.has(n)||ff.test(n)||cf.test(n),ds.set(t,e)}return e}function ms(t,e){let n=gf.get(t);if(n===void 0||e[n]!==e[t])return!1;let o=e["writing-mode"];if(o&&o!=="horizontal-tb")return!1;let r=e.direction;return!(r&&r!=="ltr")}function Xn(t,e){return!pf.has(t)&&(e==="inline"||df.has(t)||hs.has(t))}function yr(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||hs.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let i=(e.position||"static").toLowerCase();return i==="absolute"||i==="fixed"?!1:!bf.has(o)}function Oe(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),gn.has(e))return"";let r=[],i=gr(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=Xn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",c=u==="nowrap"||u==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(We(m)||ms(m,t))continue;let g=t[m];if(!(ps.has(m)&&hf.has(e))){if(d){if(ps.has(m))continue;if(mf.has(m)){g&&g!==i[m]&&(r.push(`${m}:${g}`),g!=="auto"&&(h=!0));continue}}if(g&&g!==i[m]){if((m==="height"||m==="block-size"||!c&&(m==="width"||m==="inline-size"))&&g.endsWith("px")&&g.includes(".")){let y=parseFloat(g);if(Number.isFinite(y)){r.push(`${m}:${(y+yf).toFixed(3)}px`);continue}}r.push(`${m}:${g}`)}}}if(d&&!a&&!o&&!h){let m=t.width;m&&m!=="auto"&&m!==i.width&&r.push(`min-width:${m}`)}return r.sort(),r.join(";")}function br(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function wr(t,e=null){let n=new Map;for(let s of t){let a=gr(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!ms(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=c.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:c}),n.get(f).tagList.push(s))}let o=[...n.values()],r=null;for(let{declarations:s}of o){let a=new Set(s);if(!r){r=a;continue}for(let l of r)a.has(l)||r.delete(l)}r??=new Set;let i="";if(r.size&&o.length>1){let s=o.flatMap(a=>a.tagList);i+=`${s.join(",")} { ${[...r].join("")} } `}for(let{tagList:s,declarations:a}of o){let l=o.length>1?a.filter(c=>!r.has(c)):a;if(!l.length)continue;let u=l.join("");i+=`${s.join(",")} { ${u} } -`}return i}function gn(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function yf(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let o=0;o{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(t?.nodeType!==1){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(t,e)||n()}catch{return n()}return n()}let o=j.computedStyle.get(t);o||(o=new Map,j.computedStyle.set(t,o));let r=o.get(e);if(!r){let i=yf(t),s=null;try{s=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}r=s||n(),o.set(e,r)}return r}function De(t,e=null){let n={};for(let o of e||t){let r=t.getPropertyValue(o);r&&(n[o]=r)}for(let o of bf){let r=n[`border-${o}-style`],i=n[`border-${o}-width`];(r==="none"||r==="hidden"||i==="0px")&&(delete n[`border-${o}-style`],delete n[`border-${o}-width`],delete n[`border-${o}-color`])}return n}function se(t){let e=[],n=0,o=0,r="";for(let i=0;i{"use strict";Mt();Gn();At();hr=new Set(["meta","script","noscript","title","link","template"]),mn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);af=/(?:^|-)(animation|transition)(?:-|$)/i,lf=/^(--.+|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,cf=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","stroke-color"]),fs=new Map;ff=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ds=new Set(["table","thead","tbody","tfoot","tr","td","th"]),uf=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),us=new Set(["width","max-width","inline-size","max-inline-size"]),df=new Set(["mi","mn","mo","ms","mtext"]),pf=new Set(["min-width","min-inline-size"]),hf=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));mf=.001;gf=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);bf=["top","right","bottom","left"]});function Ct(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,o=()=>{n||(n=!0,e())};try{requestAnimationFrame(o)}catch{o();return}setTimeout(o,t)})}async function bn(t=document){let e=t.fonts,n=!1,o=e.ready.then(()=>{n=!0},()=>{n=!0});for(;!n&&e.status==="loading";){let r=[...e].filter(i=>i.status==="loading");if(!r.length)return;await Promise.race([o,Promise.allSettled(r.map(i=>i.loaded))])}}function hs(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?wf:wr),n=null,o={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=xr().then(()=>{n=null,o.yielded=!0,e=performance.now()+wr}))};return o}function xr(){return new Promise(t=>{let e=new MessageChannel;e.port1.onmessage=()=>t(),e.port2.postMessage(0)})}async function Xn(){yn>=0&&performance.now()-yn>wr&&await xr(),yn<0&&(yn=performance.now(),xr().then(()=>{yn=-1}))}function wn(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function Y(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),r=/mobile/i.test(t),i=!/safari/i.test(t),s=o&&r&&i,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&o;return n||s||a||l||u}function _t(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var wr,wf,yn,dt=st(()=>{"use strict";wr=16,wf=40;yn=-1});function D(t,e,n){let o=t&&typeof t=="object"&&(t.options||t);o&&o.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function nt(t,e,n,o){let r=t&&t.warnings;r&&r.length{"use strict";xf=50});var Et=st(()=>{"use strict";Zi();Be();dt();vt();wt()});function Xr(t){return Ka(t.boxShadow)}function Yr(t){return Ka(t.textShadow)}function Ka(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",o=0;for(let l=0;lparseFloat(p))||[];if(u.length<2)continue;let[c,f,d=0,h=0]=u,m=Math.abs(c)+d+h,g=Math.abs(f)+d+h;i=Math.max(i,m+Math.max(c,0)),a=Math.max(a,m+Math.max(-c,0)),s=Math.max(s,g+Math.max(f,0)),r=Math.max(r,g+Math.max(-f,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(s),left:Math.ceil(a)}}function Kr(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,o=0,r;for(;r=n.exec(e);)o+=parseFloat(r[1])||0;let i=Math.ceil(o*2);return{top:i,right:i,bottom:i,left:i}}function Jr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,o=e+Math.max(0,Math.ceil(n));return{top:o,right:o,bottom:o,left:o}}function Qr(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,r=0,i=0,s=0,a=!1;for(let l of n){a=!0;let u=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[c=0,f=0,d=0]=u,h=Math.abs(c)+d,m=Math.abs(f)+d;r=Math.max(r,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),i=Math.max(i,m+Math.max(f,0)),o=Math.max(o,m+Math.max(-f,0))}return{bleed:{top:H(o),right:H(r),bottom:H(i),left:H(s)},has:a}}function jd(t){let e=Xr(t),n=Yr(t),o=Kr(t),r=Jr(t),i=Qr(t);return{top:Math.max(e.top,n.top)+o.top+r.top+i.bleed.top,right:Math.max(e.right,n.right)+o.right+r.right+i.bleed.right,bottom:Math.max(e.bottom,n.bottom)+o.bottom+r.bottom+i.bleed.bottom,left:Math.max(e.left,n.left)+o.left+r.left+i.bleed.left}}function Vd(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function Ya(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",o=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:o||e!=="visible",y:o||n!=="visible"}}function Zr(t,e,n,o=1,r=1){let i=0,s=0,a=0,l=0,u=Ya(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let c=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!Vd(d))continue;let h=jd(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),g={left:m.left-h.left/o,top:m.top-h.top/r,right:m.right+h.right/o,bottom:m.bottom+h.bottom/r};for(let p=f.parentElement;p;p=p.parentElement){let y=Ya(n.get(p)||O(p));if(y.x||y.y){let b=p.getBoundingClientRect();y.x&&(g.left=Math.max(g.left,b.left),g.right=Math.min(g.right,b.right)),y.y&&(g.top=Math.max(g.top,b.top),g.bottom=Math.min(g.bottom,b.bottom))}if(p===t)break}u.x||(l=Math.max(l,(c.left-g.left)*o),s=Math.max(s,(g.right-c.right)*o)),u.y||(i=Math.max(i,(c.top-g.top)*r),a=Math.max(a,(g.bottom-c.bottom)*r))}return{top:Math.max(0,Math.ceil(i)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(l))}}function Ja(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none"){let l=null;try{l=ke(t).scale}catch{}try{e.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let u=de({scale:l});return{a:u.a,b:u.b,c:u.c,d:u.d}}function r(l,u,c,f){let d=Math.sqrt(l*l+u*u)||0,h=0,m=0;if(d>0){let g=l/d,p=u/d;h=g*c+p*f;let y=c-g*h,b=f-p*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let i=l=>{let u=ke(t).scale;if(!u)return l;let c=de({scale:u,baseTransform:`matrix(${l.a},${l.b},${l.c},${l.d},0,0)`});return{a:c.a,b:c.b,c:c.c,d:c.d}},s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let l=s[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===6&&l.every(Number.isFinite)){let[u,c,f,d]=l,h=r(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return i(h)}}let a=o.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===16&&l.every(Number.isFinite)){let u=l[0],c=l[1],f=l[4],d=l[5],h=r(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return i(h)}}try{let l=new DOMMatrix(o),u=r(l.a,l.b,l.c,l.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return i(u)}catch{return null}}function Ze(t,e,n,o,r){let i=n.a,s=n.b,a=n.c,l=n.d,u=n.e||0,c=n.f||0;function f(y,b){let w=y-o,S=b-r,v=i*w+a*S,C=s*w+l*S;return v+=o+u,C+=r+c,[v,C]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,g=-1/0,p=-1/0;for(let[y,b]of d)yg&&(g=y),b>p&&(p=b);return{minX:h,minY:m,maxX:g,maxY:p,width:g-h,height:p-m}}function Tn(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,i]=[o[0]||"0",o[1]||"0"],s=(a,l)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?l/2:u==="right"||u==="bottom"?l:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*l/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(r,e),oy:s(i,n)}}function ke(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let r=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},i=r("rotate");if(i)if(i.angle){let l=i.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit,i.is2D===!1&&i.x&&i.y&&i.z&&(e.rotate=`${i.x.value} ${i.y.value} ${i.z.value} ${e.rotate}`)}else i.unit?e.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:e.rotate=String(i);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let s=r("scale");if(s){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[l(s.x),l(s.y)??l(s.x),...s.is2D===!1?[l(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(l).join(" "):e.scale=String(s)}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=r("translate");if(a){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[l(a.x),l(a.y)??"0px",...a.is2D===!1?[l(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(l).join(" "):e.translate=String(a)}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function Gd(){if(qr?.isConnected)return qr;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),tt(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),qr=t,t}function de(t){let e=i=>{let s=[],a=0,l=0,u=String(i).trim();for(let c=0;cl&&s.push(u.slice(l,c)),l=c+1);return li&&i!=="none",o=[];if(n(t.translate)){let i=e(t.translate);for(let s=0;s<2&&s2?`translate3d(${i.join(",")})`:`translate(${i.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let i=e(t.rotate);i.length===4?o.push(`rotate3d(${i.join(",")})`):i.length===2&&/^[xyz]$/i.test(i[0])?o.push(`rotate${i[0].toUpperCase()}(${i[1]})`):o.push(`rotate(${i.join(" ")})`)}if(n(t.scale)){let i=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);o.push(i.length>2?`scale3d(${i.join(",")})`:`scale(${i.join(",")})`)}if(n(t.baseTransform)&&o.push(t.baseTransform),!o.length)return new DOMMatrix;let r=o.join(" ");try{if(r.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(r)}catch{let i=Gd(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",r,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");i.appendChild(s);try{return qd(s)}finally{s.remove()}}}function Qa(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",i=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||i||s)}function qd(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var qr,$n=st(()=>{"use strict";Me();Be();At();qr=null});function ko(t,e){if(!e)return null;let n=t.ownerDocument||document,o=n.defaultView||window,r,i,s,a;if(e==="viewport")r=0,i=0,s=n.documentElement?.clientWidth||o.innerWidth,a=n.documentElement?.clientHeight||o.innerHeight;else if(typeof e=="object")r=(Number(e.x)||0)-(o.scrollX||0),i=(Number(e.y)||0)-(o.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:r,top:i,width:s,height:a,right:r+s,bottom:i+a}:null}function Pn(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Jt(e)?e.host:null}function Xd(t,e){for(let n=e;n;n=Pn(n))if(n===t)return!0;return!1}function Yd(t,e){for(let n=Pn(t);n&&n!==e&&n?.nodeType===1;n=Pn(n)){let o=O(n);if(o.position!=="static"||ti(o))return n}return null}function ti(t){return t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.backdropFilter&&t.backdropFilter!=="none"||t.perspective&&t.perspective!=="none"||/transform|perspective|filter/.test(t.willChange||"")||/layout|paint|strict|content/.test(t.contain||"")}function nl(t,e,n,o,r,i){if(t.scrollTop||t.scrollLeft)return;let s=o.get(t)||O(t);if(ti(s))return;let a=s.position!=="static",l=new Map;for(let[u,c]of e){let f=n.get(u);if(!f)continue;let d=l.get(f);if(d===void 0&&l.set(f,d=Kd.exec(f)?.[1]||""),!d||d==="absolute"&&a||ni.has(u))continue;let h=!1;for(let y=Pn(c);y&&y!==t&&y.nodeType===1;y=Pn(y)){let b=o.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||ti(b)){h=!0;break}}if(h)continue;let m=o.get(c)||O(c),g=parseFloat(m.left),p=parseFloat(m.top);r&&Number.isFinite(g)&&(u.style.left=`${g+r}px`),i&&Number.isFinite(p)&&(u.style.top=`${p+i}px`)}}function oi(t,e){try{return de({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function ol(t,e,n,o,r){let i=t.getBoundingClientRect();Pt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,l]of n){if(l?.nodeType!==1)continue;let u=a.localName==="svg"&&Nt(a)&&!Nt(l.parentNode);if(!Pt(a)&&!u||l===t||!Xd(t,l))continue;let c=o.get(l)||O(l),f=c.position;if(f!=="fixed"&&f!=="sticky"&&f!=="-webkit-sticky"||a.style.position==="absolute")continue;let d=l.getBoundingClientRect();if(!(d.width>0&&d.height>0))continue;ni.add(a);let h=c.transform&&c.transform!=="none"?c.transform:"",m=ke(l),g=!!(h||m.rotate!=="0deg"||m.scale||m.translate),p=g?oi(h,m):null,y=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,b=d.width,w=d.height;y||(b=l.offsetWidth||d.width,w=l.offsetHeight||d.height);let S=l.getRootNode&&Jt(l.getRootNode()),v=i,C=t.clientLeft||0,M=t.clientTop||0;if(S){let _=Yd(l,t);_&&(v=_.getBoundingClientRect(),C=_.clientLeft||0,M=_.clientTop||0)}let T=d.left-v.left-C,F=d.top-v.top-M;if(g)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",y)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:_,oy:P}=Tn(c,b,w),E=Ze(b,w,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},_,P);T-=E.minX,F-=E.minY}if(f!=="fixed"){let _=a.cloneNode(!1);_.setAttribute("data-snap-ph","1"),_.style.position="static",_.style.visibility="hidden",_.style.width=`${b}px`,_.style.height=`${w}px`,_.style.boxSizing="border-box",a.parentElement?.insertBefore(_,a)}let A=u?b:b+2,x=w;r&&(Math.abs(F-r.y)<.5&&(F-=1,x+=1),Math.abs(T-r.x)<.5&&(T-=1,A+=1)),a.style.position="absolute",a.style.left=`${T}px`,a.style.top=`${F}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${A}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",S||s.push(a)}for(let a of s)e.appendChild(a)}function rl(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){D(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){D(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){D(n,"Couldn't remove the root outline.",s)}let i=(o.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=i.length?i:"none"}catch(s){D(n,"Couldn't remove the root drop-shadow filter.",s)}}function il(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function Za(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",o=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||o!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function sl(t,e){let n=Array.from(t.childNodes),o=e==="top"?n:n.reverse();for(let r of o){if(r.nodeType===Node.TEXT_NODE){if(/\S/.test(r.textContent||""))return null;continue}if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=getComputedStyle(r),s=String(i.display||"");if(s!=="none"){if(s==="contents"){let a=sl(r,e);if(a!==void 0)return a;continue}if(!(i.position==="absolute"||i.position==="fixed"))return i.float&&i.float!=="none"||s.startsWith("inline")?null:r}}}function al(t,e,n,o=null){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!Za(r))for(let i of["top","bottom"]){let s=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${s}Width`])||0)>0||(parseFloat(r[`padding${s}`])||0)>0)continue;let a=t,l=e;for(;a&&l;){let u=sl(a,i);if(!u)break;let c=n?Array.from(l.children).find(h=>n.get(h)===u)||o?.get(u)||null:l.children[Array.from(a.children).indexOf(u)]||null,f=getComputedStyle(u),d=parseFloat(f[`margin${s}`])||0;if(c&&c.style&&d>0&&(c.style[`margin${s}`]="0px"),Za(f)||(parseFloat(f[`border${s}Width`])||0)>0||(parseFloat(f[`padding${s}`])||0)>0)break;a=u,l=c}}}function Qd(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Jd.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}function Mo(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,o=a=>{for(let l of Array.from(a.attributes)){if(Qd(l.name,n)){a.removeAttribute(l.name);continue}if(tp.test(l.value))continue;let u=tl(l.value);if(u!==l.value)try{a.setAttribute(l.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&o(t);let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=i.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)o(s);else if(s.nodeType===Node.COMMENT_NODE)r.push(s);else{let a=tl(s.data);a!==s.data&&(s.data=a)}for(let a of r)a.remove()}function ep(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function op(t){return Nt(t)||np.has(t?.localName)}function rp(t,e){if(t?.nodeType!==1||ep(t)||op(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function ll(t,e,n=new Map,o=null){function r(i,s){if(i?.nodeType!==1||s?.nodeType!==1)return;let a=i.childElementCount>s.childElementCount,l=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,l),a&&rp(i,l)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let c=l.overflowY||l.overflowBlock||"visible",f=l.overflowX||l.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(o)for(let c of u){let f=o.get(c);f&&f.nodeType===1&&r(f,c)}else{let c=Array.from(i.children);for(let f=0;fi&&(i=p),s=!0)}let l=s?Math.max(0,i-r):0,u=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+c+f+d+l}function ii(t){let e=document.implementation.createHTMLDocument(""),n=e.importNode(t,!0);for(let o of[n,...n.querySelectorAll("*")]){let r=o.localName.includes("-");if(!Pt(o)||!(r||o.hasAttribute("is")))continue;let i=e.createElement(r?"span":o.localName);for(let s of o.attributes)s.name!=="is"&&i.setAttribute(s.name,s.value);i.append(...o.childNodes),o===n?n=i:o.replaceWith(i)}return n}function Nn(t,e){try{let n=new t.ownerDocument.defaultView.CSSStyleSheet;n.replaceSync(e),t.adoptedStyleSheets=[n]}catch{let n=t.ownerDocument.createElement("style");n.textContent=e,t.appendChild(n)}}function cl(t,e,n,o,r,i){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),l=r>0&&a.width>0?a.width/r:1,u=i>0&&a.height>0?a.height/i:1;if(Math.abs(l-u)>.02)return 0;let c=s.createElement("div");tt(c),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+r+"px!important;overflow:visible!important;visibility:hidden!important;";let f=c.attachShadow({mode:"open"});Nn(f,n);let d=ii(e);f.appendChild(d),s.body.appendChild(c);let h=0,m=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],g=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],p=(y,b,w)=>{let S=O(y),v=S.boxSizing==="border-box",C=(M,T,F)=>{let A=parseFloat(M);if(!Number.isFinite(A))return T;let x=0;if(!v)for(let P of F)x+=parseFloat(S[P])||0;let _=A+x;return Math.abs(_-T)<=.51?_:T};return{width:C(S.width,b,m),height:C(S.height,w,g)}};try{let y=d.getBoundingClientRect(),b=d.offsetWidth||r,w=d.offsetHeight||i,S=b>0&&y.width>0?y.width/b:1,v=w>0&&y.height>0?y.height/w:1,C=(M,T,F=!1)=>{let A=M.children,x=T.children,_=Math.min(A.length,x.length);for(let P=0;P<_;P++){let E=A[P],R=x[P],L=o.get(E),k=F||ni.has(E);if(L?.nodeType===1&&Pt(E)&&E.style&&L.isConnected){let I=L.getBoundingClientRect();if(I.width>0&&I.height>0){let W=R.getBoundingClientRect(),$=I.width/l,N=I.height/u,U=W.width,z=W.height,V=L.offsetWidth||$,B=L.offsetHeight||N,rt=R.offsetWidth||U,at=R.offsetHeight||z,pt=Math.abs($-V)>tn||Math.abs(N-B)>tn||Math.abs(U-rt)>tn||Math.abs(z-at)>tn;if(k){let yt=p(R,rt,at);$=U>0?$*S*yt.width/U:$,N=z>0?N*v*yt.height/z:N,U=yt.width,z=yt.height}else if(pt){let yt=p(L,V,B),It=p(R,rt,at);$=yt.width,N=yt.height,U=It.width,z=It.height}let St=U-$,ee=z-N;(Math.abs(St)>tn||Math.abs(ee)>tn)&&(E.style.boxSizing="border-box",E.style.width=`${H($)}px`,E.style.height=`${H(N)}px`,h++)}}C(E,R,k)}};C(e,d)}finally{c.remove()}return h}function ei(t,e=new Set){let n="";if(!t)return n;for(let o=0;o`${a*f/100}px`),u=parseFloat(i==="x"?n.width:n.height);e.style.setProperty(r,Number.isFinite(u)?`${r.slice(0,3)}(${l}, ${u}px)`:l)}}function up(t,e){let n=t.ownerDocument,o=n.documentElement,r={w:o.clientWidth,h:o.clientHeight};if(e.position==="fixed")return r;if(e.position==="absolute"){let l=t.offsetParent;return!l||(l===n.body||l===o)&&getComputedStyle(l).position==="static"?r:{w:l.clientWidth,h:l.clientHeight}}let i=t.parentElement;if(!i)return r;let s=getComputedStyle(i),a=l=>parseFloat(s.getPropertyValue(l))||0;return{w:i.clientWidth-a("padding-left")-a("padding-right"),h:i.clientHeight-a("padding-top")-a("padding-bottom")}}var ni,Kd,Jd,Zd,tl,tp,np,H,tn,ap,el,fp,Me=st(()=>{"use strict";Et();Mt();At();$n();ni=new WeakSet;Kd=/(?:^|;)position:(absolute|fixed)(?:;|$)/;Jd=new Set(["xml","xlink"]);Zd=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,tl=t=>t.replace(Zd,e=>e.length===2?e:""),tp=/^data:[^,]{0,120};base64,/;np=new Set(["img","canvas","video","iframe","object","embed"]);H=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;tn=.75;ap=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;el=new WeakMap;fp=[["max-width","x"],["min-width","x"],["max-height","y"],["min-height","y"]]});var Ll={};re(Ll,{detectDrawApi:()=>Nl,tryCanvasEngine:()=>ph});function Nl(){try{let t=document.createElement("canvas").getContext("2d");if(t&&typeof t.drawElementImage=="function")return"drawElementImage"}catch{}return null}function dh(t,e,n,o){let r=document.createElement("canvas");r.setAttribute("layoutsubtree",""),r.setAttribute("content","drawable"),tt(r),r.style.cssText="position:fixed;top:0;left:0;z-index:-2147483647;pointer-events:none";let i=document.createElement("div");i.setAttribute("drawable",""),i.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${n}px;height:${o}px`;let s=i.attachShadow({mode:"open"});return Nn(s,e),s.appendChild(t),r.appendChild(i),{canvas:r,wrapper:i}}async function ph(t,e){let n=Nl();if(!n)return null;let o=t.element,r=t.clone;if(!o||!r)return null;let i=o.ownerDocument||document;if(!o.isConnected||i!==document||o===i.body||o===i.documentElement||o.scrollTop||o.scrollLeft||e.outerShadows||e.clip||e.excludeMode==="remove"||typeof e.filter=="function"&&e.filterMode==="remove"||e.width!=null||e.height!=null)return null;try{for(let v=o;v;v=v.assignedSlot||v.parentElement||v.getRootNode?.().host){let C=getComputedStyle(v);if(C.transform&&C.transform!=="none"||C.rotate&&C.rotate!=="none"||C.scale&&C.scale!=="none"||C.translate&&C.translate!=="none"||v===o&&C.filter&&C.filter!=="none")return null;let M=C.getPropertyValue("zoom");if(M&&Number.isFinite(parseFloat(M))&&Math.abs(parseFloat(M)-1)>1e-4)return null}}catch{return null}let s=o.getBoundingClientRect(),a=Math.max(1,s.width||o.offsetWidth||1),l=Math.max(1,s.height||o.offsetHeight||1),u=o.offsetWidth||Math.ceil(a),c=o.offsetHeight||Math.ceil(l),f=Number.isFinite(e.scale)&&e.scale>0?e.scale:1,d=Number.isFinite(e.dpr)&&e.dpr>0?e.dpr:window.devicePixelRatio||1,h=Math.max(1,Math.round(u*f*d)),m=Math.max(1,Math.round(c*f*d)),g=(t.scrollbarCSS||"")+(t.baseCSS||"")+(t.fontsCSS||"")+(t.classCSS||""),{canvas:p,wrapper:y}=dh(r,g,a,l);p.width=h,p.height=m,document.body.appendChild(p);let b;try{p.getBoundingClientRect(),await new Promise(F=>{requestAnimationFrame(()=>setTimeout(F,0)),setTimeout(F,50)});let v=p.getContext("2d"),C=v&&v[n];if(typeof C!="function")return null;v.save(),v.scale(d*f,d*f),C.call(v,y,0,0,a,l),v.restore();let M;try{M=v.getImageData(0,0,Math.min(64,h),Math.min(64,m)).data}catch{return D(e,`html-in-canvas: ${n} tainted the canvas; used the SVG engine.`),null}let T=!1;for(let F=3;F0){T=!0;break}if(!T){let F=v.getImageData(0,0,h,m).data,A=!1;for(let x=3;x0){A=!0;break}if(!A)return null}b=document.createElement("canvas"),b.width=h,b.height=m,b.getContext("2d").drawImage(p,0,0),b.style.width=`${u*f}px`,b.style.height=`${c*f}px`}catch(v){return D(e,"html-in-canvas: the browser couldn't paint it; used the SVG engine.",v),null}finally{try{p.remove()}catch{}}let w=Object.freeze({w0:a,h0:l,vbW:u,vbH:c,targetW:a,targetH:l,contentX:0,contentY:0,clip:null});Object.defineProperty(e,"meta",{value:w,enumerable:!0,writable:!1,configurable:!0}),e.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},t.clone=t.nodeMap=t.styleCache=t.svgString=null;let S=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);return S&&S.style.position==="absolute"&&S.remove(),b}var Il=st(()=>{"use strict";wt();At();Me()});var mc={};re(mc,{MAX_RASTER_AREA:()=>he,MAX_RASTER_SIDE:()=>jt,WEBP_MAX_SIDE:()=>$i,__setDecodeFrameIdleMs:()=>Yh,cropSvgText:()=>Ko,decodeSvgFromDataURL:()=>Ee,encodeSvgToDataURL:()=>Re,fixSafariShadows:()=>Qo,peekSvgHeader:()=>Jo,toCanvas:()=>te});function Oh(t,e){let n=e.__session;try{let o=t.match(/]*>/i);if(!o)return t;let r=o[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),s=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(s)||i<=0||s<=0)return t;let a=Math.min(1,jt/i,jt/s,Math.sqrt(he/(i*s)));if(a>=1)return t;let l=Math.max(1,Math.floor(i*a)),u=Math.max(1,Math.floor(s*a));return nt(n,"raster-clamp",`capture ${Math.round(i)}x${Math.round(s)}px exceeds decode limits; downscaled to ${l}x${u}px`),D(e,`${Math.round(i)}\xD7${Math.round(s)}px is too large for the browser to draw; scaled down to ${l}\xD7${u}px. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${l}`).replace(/(\bheight=")[\d.]+/i,`$1${u}`))}catch{return t}}function Ko(t,e,{shiftContent:n=Y()}={}){let o=["x","y","width","height"].map(F=>Number(e?.[F]));if(!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],s=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(s||"").trim().split(/[\s,]+/).map(Number);if(a.length!==4||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[l,u,c,f]=a,d=Math.max(l,o[0]),h=Math.max(u,o[1]),m=Math.min(l+c,o[0]+o[2]),g=Math.min(u+f,o[1]+o[3]);if(!(m>d)||!(g>h))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(p)&&p>0?p/c:1,w=Number.isFinite(y)&&y>0?y/f:1,S=Math.max(1,(m-d)*b),v=Math.max(1,(g-h)*w),C=i.replace(/(\bwidth=")[^"]*/i,`$1${S}`).replace(/(\bheight=")[^"]*/i,`$1${v}`),M=n?Dh(t,i,d,h):null;if(M)return C.replace(/(\bviewBox=")[^"]*/i,(A,x)=>`${x}0 0 ${m-d} ${g-h}`)+M.slice(i.length);let T=C.replace(/(\bviewBox=")[^"]*/i,`$1${d} ${h} ${m-d} ${g-h}`);return t.replace(i,T)}function Dh(t,e,n,o){if(!t.startsWith(e))return null;let r=/^\s*]*>/i.exec(t.slice(e.length,e.length+2048));if(!r)return null;let i=r[0],s=(u,c,f)=>{let d=new RegExp(`(\\s${c}=")([^"]*)`),h=u.match(d),m=h?parseFloat(h[2]):0;return Number.isFinite(m)?h?u.replace(d,(g,p)=>`${p}${m-f}`):u.replace(/^(\s*`${p} ${c}="${-f}"`):null},a=s(i,"x",n),l=a&&s(a,"y",o);return l?e+l+t.slice(e.length+i.length):null}function Ei(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Ee(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Jo(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function Re(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function uc(t){let e=[],n="",o=0;for(let r=0;rr.trim()).filter(Boolean)}function Bh(t){let e=[],n="",o=0;for(let i=0;i`${a}:${l}`).join(";")}function zh(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${dc(o)}}`)}function Uh(t){return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,zh(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${dc(o)}${n}`),t}function Hh(){return Go||(Go=(async()=>{try{let t='
',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let r=o.getImageData(2,18,1,1).data[3]>128,i=o.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),Go)}function jh(t){let e=[],n=0,o=0;for(let r=0;r{let i=0,s=0,a="",l=0;for(;luc(o).map(r=>{let i=r.indexOf(":");if(i<0)return r;let s=r.slice(0,i).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${jh(r.slice(i+1))}`:r}).join(";");return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(o,r)=>o.replace(r,r.replace(/([^{}]+)\{([^}]*)\}/g,(i,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,r,i)=>`style=${r}${n(i)}${r}`),t}async function Qo(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await Hh();try{let r=t;return n||(r=Uh(r)),o&&(r=Vh(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Gh(t,e,n){let o=t.naturalWidth,r=t.naturalHeight,i=Math.min(8,r),s=document.createElement("canvas");s.width=Math.max(1,Math.ceil(o*e)),s.height=Math.max(1,Math.ceil(i*6*n));let a=s.getContext("2d",{willReadFrequently:!0});return!a||!(o>0&&r>0)?null:()=>{a.clearRect(0,0,s.width,s.height);for(let f=0;f<6;f++){let d=Math.floor((r-i)*f/5);a.drawImage(t,0,d,o,i,0,f*i*n,o*e,i*n)}let l=a.getImageData(0,0,s.width,s.height).data,u=!1,c=0;for(let f=3;f0&&(u=!0),c=c*31+l[f-3]+l[f-2]*7+l[f-1]*13+l[f]|0;return{ink:u,sig:c}}}async function qh(t,e,n){tt(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await qo(),await qo(),!1;let o=performance.now()+(e?600:150),r=null;for(;;){let i;try{i=n()}catch{return!1}if(i.ink&&(!e||i.sig===r))return!0;if(r=i.sig,performance.now()>o)return i.ink;await qo()}}finally{try{t.remove()}catch{}}}function Yo(){clearTimeout(Pi),pe?.remove(),pe=null,Xo=0}function Yh(t){hc=t??pc}function cc(t){if(typeof document>"u"||!document.body)return new Image;if(clearTimeout(Pi),pe&&!pe.contentDocument&&Yo(),pe&&Xo>Xh&&On===0&&Yo(),!pe){let n=document.createElement("iframe");tt(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)pe=n,Xo=0;else{try{n.remove()}catch{}return new Image}}Xo+=t.length,On+=1;let e=pe.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Fi(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,On=Math.max(0,On-1),e&&(Ri=!0),!(On>0)&&(Ri?(Ri=!1,Yo()):Pi=setTimeout(Yo,hc)))}function fc(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function tm(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),o=0,r=0;for(let i=e;i+48<=t.length;i+=n){let s=t.slice(i,i+48);o++,Zh.some(a=>s.includes(a))||r++}return r*2>o}function Ti(t,e,n,o,r){if(!e.naturalWidth){t.drawImage(e,0,0,n,o);return}let i=n*o,s=i>Kh&&!tm(r)?Math.min(Qh,Math.ceil(i/Jh)):1;if(s===1){t.drawImage(e,0,0,n,o);return}let a=e.naturalWidth,l=e.naturalHeight/o;for(let u=0;u]*>/i)||[])[0]||"",g=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&Number.isFinite(p)&&g>0&&p>0&&Math.min(1,jt/g,jt/p,Math.sqrt(he/(g*p)))<1;if(l||y||Y())try{let b=Ee(t);if(l&&(b=Ko(b,l)),Y()){let w=await Qo(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||l)&&(b=Oh(b,e)),c=Re(b)}catch(b){if(l)throw b;c=t}}let h=u||cc(c);try{u||await fc(h,c)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let g=h;h=cc(c),Fi(g);try{await fc(h,c)}catch(p){throw Fi(h,e.__releaseDecodeFrame),p}}try{!u&&!Y()&&Ei(c)&&(_t()?/.data(?:%3A|:)image(?:%2F|\/)svg/i:/(?:%40|@)font-face/i).test(c)&&await new Promise(N=>{let U=new MessageChannel;U.port1.onmessage=()=>{U.port1.close(),U.port2.close(),N()},U.port2.postMessage(0)});let m=u?u.width:h.naturalWidth,g=u?u.height:h.naturalHeight,p=l?m:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:m,y=l?g:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:g,b,w,S=Number.isFinite(n),v=Number.isFinite(o);if(S&&v)b=Math.max(1,n),w=Math.max(1,o);else if(S){let N=n/Math.max(1,p);b=n,w=y*N}else if(v){let N=o/Math.max(1,y);w=o,b=p*N}else{let N=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);b=N?s.vbW:m,w=N?s.vbH:g}!S&&!v&&(b=b*r,w=w*r);let C=b*i,M=w*i,T=Math.max(C/jt,M/jt,Math.sqrt(C*M/he)),F=e.__encodeFormat==="webp"?Math.max(C,M)/$i:0,A=Math.max(T,F);if(A>1){let N=T<=1;nt(e.__session,"canvas-clamp",`output ${Math.round(C)}x${Math.round(M)}px exceeds ${N?"WebP":"canvas"} limits; downscaled`),D(e,N?`${Math.round(C)}\xD7${Math.round(M)}px is larger than WebP can encode (${$i}px per side); scaled down. For full size, export a PNG, an SVG, or crop.`:`${Math.round(C)}\xD7${Math.round(M)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),b/=A,w/=A}let x=Pt(e.canvas)&&ft(e.canvas,"canvas")?e.canvas:document.createElement("canvas");x.width=Math.max(1,b*i),x.height=Math.max(1,w*i),x.style.width=`${b}px`,x.style.height=`${w}px`;let _=x.getContext("2d");if(!_)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let P=null,E=e.__layoutZoom||1;if(!u&&_t()){let N=E*p/(b*i),U=Math.round(b*i*N),z=Math.round(w*i*N);N>1.01&&U<=jt&&z<=jt&&U*z<=he&&(P={w:U,h:z})}let R=f&&(Math.round(b*i)!==m||Math.round(w*i)!==g),L=R?m:P?P.w:b*i,k=R?g:P?P.h:w*i,I=Y()&&!u?Gh(h,L/Math.max(1,m),k/Math.max(1,g)):null,W=!1;I&&(W=await qh(h,d,I));let $=()=>{if(_.save(),i!==1&&_.scale(i,i),a&&(_.save(),_.fillStyle=a,_.fillRect(0,0,b,w),_.restore()),R){let N=document.createElement("canvas");N.width=m,N.height=g,Ti(N.getContext("2d"),h,m,g,c),_.drawImage(N,0,0,b,w)}else{if(_.save(),_.setTransform(1,0,0,1,0,0),P){let N=document.createElement("canvas");for(N.width=P.w,N.height=P.h,Ti(N.getContext("2d"),h,P.w,P.h,c);N.width>b*i*2;){let U=document.createElement("canvas");U.width=Math.ceil(N.width/2),U.height=Math.ceil(N.height/2),U.getContext("2d").drawImage(N,0,0,U.width,U.height),N=U}_.imageSmoothingQuality="high",_.drawImage(N,0,0,b*i,w*i)}else Ti(_,h,b*i,w*i,c);_.restore()}_.restore()};if($(),I&&W&&d){let N=!0;try{N=I().ink}catch{}if(!N){let U=performance.now()+600;do{await qo();try{N=I().ink}catch{break}}while(!N&&performance.now(){"use strict";dt();wt();vt();At();jt=Y()?16384:32767,he=16384*16384,$i=16383;Go=null;qo=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Xh=24*1024*1024,pc=5e3,pe=null,Xo=0,On=0,Ri=!1,hc=pc,Pi=0;Kh=4e6,Jh=2e6,Qh=8,Zh=["%3C","%3E","%20","%7B","%7D","%3B"]});var Dn={};re(Dn,{rasterize:()=>Ni});async function Ni(t,e){let n=await te(t,{...e,__encodeFormat:e.format}),i=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let l=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return l();let c=new FileReader;c.onload=()=>a(String(c.result||"")),c.onerror=l,c.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{l()}}),s=new Image;return s.src=i,Y()?await s.decode():await new Promise((a,l)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=l}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var fn=st(()=>{"use strict";Fe();dt()});var Li={};re(Li,{toImg:()=>em,toSvg:()=>em});async function em(t,e){let{scale:n=1,width:o,height:r,meta:i={}}=e,s=Number.isFinite(o),a=Number.isFinite(r),l=Number.isFinite(n)&&n!==1||s||a;if(Y()&&l)try{let{svg:d}=await Qo(Ee(t)),h=(d.match(/]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(g))throw new Error("The SVG has no size.");let p=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:m,y=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:g,b,w;s&&a?(b=o,w=r):s?(b=o,w=Math.max(1,Math.round(y*(o/Math.max(1,p))))):a?(w=r,b=Math.max(1,Math.round(p*(r/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(g*n)));let S=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=Re(S),await v.decode(),v.style.width=`${b}px`,v.style.height=`${w}px`,v}catch(d){return nt(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),D(e,"Safari couldn't show the SVG; used a PNG.",d),Ni(t,{...e,format:"png",quality:1,meta:i})}let u=t,c=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=Ee(t),h=(d.match(/]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),g=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&g>0){let p=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(g*n))}"`);u=Re(d.replace(h,p)),c=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!c)throw d;f.src=t,c=!1,await f.decode()}if(s&&a)f.style.width=`${o}px`,f.style.height=`${r}px`;else if(s){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=o/Math.max(1,d);f.style.width=`${o}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=r/Math.max(1,h);f.style.height=`${r}px`,f.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(f.naturalWidth*(c?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(c?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!c&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let g=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,await f.decode()}catch(m){D(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var Ii=st(()=>{"use strict";Et();wt();fn();Fe()});var yc={};re(yc,{encodePng:()=>nm});function Zo(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),o=new DataView(n.buffer);o.setUint32(0,e.length);for(let i=0;i<4;i++)n[i+4]=t.charCodeAt(i);n.set(e,8);let r=4294967295;for(let i=4;i>>8;return o.setUint32(n.length-4,(r^4294967295)>>>0),n}async function nm(t,e,n){if(![t,e].every(g=>Number.isInteger(g)&&g>0&&g<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let o=new Uint8Array(13),r=new DataView(o.buffer);r.setUint32(0,t),r.setUint32(4,e),o[8]=8,o[9]=6;let i=[new Uint8Array([137,80,78,71,13,10,26,10]),Zo("IHDR",o),Zo("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),l=new Uint8Array(s),u=0,c=new CompressionStream("deflate"),f=c.writable.getWriter(),d=c.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:g,value:p}=await d.read();if(g)return;i.push(Zo("IDAT",p))}}catch(g){h=g,await f.abort(g).catch(()=>{})}})();try{for await(let g of n){if(!(g instanceof Uint8Array||g instanceof Uint8ClampedArray)||!g.length||g.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let p=g.length/s;if(u+p>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y{"use strict";gc=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;gc[t]=e}});var Ac={};re(Ac,{encodeJpeg:()=>sm});function Sc(t){let e=[0,240];for(let n=0;n<16;n++)for(let o=1;o<=10;o++)e.push(n<<4|o);return t.concat(e.filter(n=>!t.includes(n)).sort((n,o)=>n-o))}function im(t){for(let e=0;e<64;e+=8)kc(t,e,1);for(let e=0;e<8;e++)kc(t,e,8)}function kc(t,e,n){let o=t[e]+t[e+7*n],r=t[e]-t[e+7*n],i=t[e+n]+t[e+6*n],s=t[e+n]-t[e+6*n],a=t[e+2*n]+t[e+5*n],l=t[e+2*n]-t[e+5*n],u=t[e+3*n]+t[e+4*n],c=t[e+3*n]-t[e+4*n],f=o+u,d=o-u,h=i+a,m=i-a;t[e]=f+h,t[e+4*n]=f-h;let g=(m+d)*.707106781;t[e+2*n]=d+g,t[e+6*n]=d-g,f=c+l,h=l+s,m=s+r;let p=(f-m)*.382683433,y=.5411961*f+p,b=1.306562965*m+p,w=h*.707106781,S=r+w,v=r-w;t[e+5*n]=v+y,t[e+3*n]=v-y,t[e+n]=S+b,t[e+7*n]=S-b}async function sm(t,e,n,o){if(![t,e].every(R=>Number.isInteger(R)&&R>0&&R<=65535))throw new RangeError("[SnapDOM] JPEG dimensions must be integers from 1 to 65535");let r=Math.min(100,Math.max(1,Math.round((typeof o=="number"&&o>=0&&o<=1?o:.92)*100))),i=r<50?5e3/r:200-r*2,s=r<90?1:0,a=8<{let k=new Uint8Array(64),I=new Float32Array(64);for(let W=0;W<64;W++){let $=Math.min(255,Math.max(1,Math.floor((R[W]*i+50)/100)));k[wc[W]]=$,I[W]=1/($*xc[W>>3]*xc[W&7]*8)}return l.push(...L?[1]:[],...k),I}),c=(R,L)=>[255,R,L.length+2>>8,L.length+2&255,...L],f=[255,216,...c(224,[74,70,73,70,0,1,1,0,0,1,0,1,0,0]),...c(219,l),...c(192,[8,e>>8,e&255,t>>8,t&255,3,1,s?34:17,0,2,17,1,3,17,1]),...c(196,Mc.flatMap(([R,,L,k])=>[R,...L,...k])),...c(218,[3,1,0,2,17,3,17,0,63,0])],d=[new Uint8Array(f)],h=new Uint8Array(65536),m=0,g=0,p=0;function y(R,L){for(g=g<=8;){p-=8;let k=g>>>p&255;m>=h.length-1&&(d.push(h.subarray(0,m)),h=new Uint8Array(65536),m=0),h[m++]=k,k===255&&(h[m++]=0)}g&=(1<15;U-=16)y(W[240][0],W[240][1]);N=32-Math.clz32(Math.abs($));let V=W[U<<4|N];y(V[0],V[1]),y(($<0?$-1:$)&(1<>s)*8+(W>>s);F[V]+=(-.168736*N-.331264*U+.5*z)*x,A[V]+=(.5*N-.418688*U-.081312*z)*x}}for(let k=0;k<(s?4:1);k++){let I=(k>>1)*128+(k&1)*8;for(let W=0;W<64;W++)b[W]=T[I+(W>>3)*a+(W&7)];v(0,0)}b.set(F),v(1,1),b.set(A),v(2,1)}}let P=0,E=0;for await(let R of n){if(!(R instanceof Uint8Array||R instanceof Uint8ClampedArray)||!R.length||R.length%C)throw new RangeError("[SnapDOM] JPEG input must contain complete RGBA rows");let L=R.length/C;if(P+L>e)throw new RangeError("[SnapDOM] JPEG input exceeds the declared height");for(let k=0;k{"use strict";wc=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],om=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],rm=Array.from({length:64},(t,e)=>(e&7)<4&&e<32?[17,18,24,47,18,21,26,66,24,26,56,99,47,66,99,99][(e>>3)*4+(e&7)]:99),xc=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];vc=[0,1,2,3,4,5,6,7,8,9,10,11],Mc=[[0,0,[0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],vc],[16,0,[0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Sc([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130])],[1,1,[0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],vc],[17,1,[0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],Sc([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241])]],Cc=Mc.map(([,,t,e])=>{let n=[],o=0,r=0;for(let i=1;i<=16;i++,o<<=1)for(let s=0;s]*>/i)?.[0];if(!o)return null;let r=e.crop?Ko(o,e.crop):o,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),s=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),a=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&s>0)||a.length!==4||!a.every(Number.isFinite)||!(a[2]>0&&a[3]>0))return null;let l=Number.isFinite(e.width),u=Number.isFinite(e.height),c=e.meta||{},f=Math.max(1,Math.floor(i)),d=Math.max(1,Math.floor(s)),h=e.crop?f:Number.isFinite(c.vbW)?c.vbW:Number.isFinite(c.w0)?c.w0:f,m=e.crop?d:Number.isFinite(c.vbH)?c.vbH:Number.isFinite(c.h0)?c.h0:d,g=e.dpr??1,p=e.scale??1,y=(l&&u?Math.max(1,e.width):l?e.width:u?e.height*h/Math.max(1,m):f*p)*g,b=(l&&u?Math.max(1,e.height):u?e.height:l?e.width*m/Math.max(1,h):d*p)*g;if(Math.max(i,s,y,b)<=jt&&i*s<=he&&y*b<=he||(n==="png"?typeof CompressionStream!="function":Math.max(y,b)>=65536))return null;return w();async function w(){let S=Math.max(1,Math.floor(y)),v=Math.max(1,Math.floor(b)),C=Ee(t),M=C.slice(C.indexOf(o)+o.length,C.lastIndexOf("")),T=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",F=i/a[2],A=s/a[3],x=0,_=0;/\bnone\b/.test(T)||(F=A=/\bslice\b/.test(T)?Math.max(F,A):Math.min(F,A),x=(i-a[2]*F)*(/xMin/.test(T)?0:/xMax/.test(T)?1:.5),_=(s-a[3]*A)*(/YMin/.test(T)?0:/YMax/.test(T)?1:.5)),x-=a[0]*F,_-=a[1]*A;let P=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),E=Y()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(C),R=i/y,L=s/b,k=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/S),E?Math.floor(2046/L):8192)),I=Math.max(1,Math.min(8192,S,E?Math.floor(2046/R):8192));async function*W(){for(let $=0;$${M}`,X=await te(Re(q),{width:at,height:pt,dpr:1,backgroundColor:E?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),G=X;try{if(E){G=document.createElement("canvas"),G.width=V,G.height=N;let Z=G.getContext("2d");e.backgroundColor&&(Z.fillStyle=e.backgroundColor,Z.fillRect(0,0,V,N)),Z.drawImage(X,z*R-B,$*L-rt,V*R,N*L,0,0,V,N)}let ht=G.getContext("2d").getImageData(0,0,V,N).data;for(let Z=0;Z(bc(),yc))).encodePng(S,v,W()):(await Promise.resolve().then(()=>(_c(),Ac))).encodeJpeg(S,v,W(),e.quality)}}var Wi=st(()=>{"use strict";Fe();dt()});var Ec={};re(Ec,{toBlob:()=>Oi});async function Oi(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let s=Hn(decodeURIComponent(t.split(",")[1]),e.__fileSvg);return new Blob([s],{type:"image/svg+xml"})}let o=n==="jpg"?"jpeg":n,r=(o==="png"||o==="jpeg")&&tr(t,e,o);if(r)return r;let i=await te(t,{...e,__encodeFormat:o});return new Promise(s=>i.toBlob(a=>s(a),`image/${o}`,e.quality))}var Di=st(()=>{"use strict";Fe();Wi();vt()});var Fc={};re(Fc,{download:()=>am});async function Rc(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(o){if(o.name!=="AbortError")return!1}return!0}async function am(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),r=n.has(o)?o:"",i=(e?.format||r||"").toLowerCase(),s=i==="jpg"?"jpeg":i||"png",a=e?.filename||"snapdom",l=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let c=wn(),f=(s==="png"||s==="jpeg")&&tr(t,u,s);if(s==="svg"||f){let m=f?await f:await Oi(t,{...u,type:"svg"});if(c&&await Rc(m,l))return;let g=URL.createObjectURL(m),p=document.createElement("a");p.href=g,p.download=l,document.body.appendChild(p),p.click(),setTimeout(()=>URL.revokeObjectURL(g),1e3),p.remove();return}let d=await te(t,{...u,__encodeFormat:s});if(c){let m=`image/${s}`,g=await new Promise(p=>d.toBlob(p,m,e?.quality));if(g&&await Rc(g,l))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=l,document.body.appendChild(h),h.click(),h.remove()}var Tc=st(()=>{"use strict";Di();Fe();Wi();dt()});Et();Et();dt();Mt();Gn();At();ye();var ce=new WeakMap,ms=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Sr=new Map,Sf=2e3,Ue=0;function zt(){Ue++}function Kn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Xt(e))return!0;e.parentElement?e=e.parentElement:e=Bt(e)}return!1}function Qn(t){for(let e of t)if(xe(e))return!0;return!1}function xe(t){if(Kn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!Kn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!Kn(n)){e=!1;break}}if(e)return!1}return!0}var ze=new WeakMap;function Cs(t){for(let e of t){if(!xe(e))continue;let n=e.target.ownerDocument||document;ze.set(n,(ze.get(n)||0)+1);let o=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;o;o=o.parentElement||Bt(o))ze.set(o,(ze.get(o)||0)+1)}}function Cn(t){let e=t.ownerDocument||document;return Ve(e),(ze.get(e)||0)-(ze.get(t)||0)}var Rt=0;function He(t=document){return Ve(t),Rt}function Se(){return Ve(),Ue}function kn(t){return t?(Ve(t.ownerDocument||document),Zn(t,Er(t))):0}function je(){zt(),Rt++}var we=new WeakMap,ae=0,le=0;function vf(t){we.set(t,++ae)}function Ar(t){if(!t||t.nodeType!==1)return;ae++,we.set(t,ae);let e=t.querySelectorAll("*");for(let n=0;nn?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let o=n.target,r=o&&(o.nodeType===1?o:o.parentElement);if(r&&(r.tagName==="STYLE"||r.tagName==="LINK"))return r.ownerDocument||document;for(let i of n.addedNodes)if(e(i))return i.ownerDocument||document;for(let i of n.removedNodes)if(e(i))return i.ownerDocument||o&&o.ownerDocument||document}return null}var Cr=new WeakSet,xn=[];function ks(t){if(!Qn(t))return;Cs(t),zt();let e=new Set;for(let n of t){if(!xe(n))continue;let o=n.target.getRootNode&&n.target.getRootNode();if(!o||o.nodeType!==11||e.has(o))continue;e.add(o),o.host?Ar(o.host):ae++;let r=o.querySelectorAll("*");for(let i=0;i{Qn(r)&&(zt(),Rt++)},o=()=>{zt(),Rt++};try{let r=new MutationObserver(Ms);r.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),vn.push({o:r,env:!1,doc:t})}catch{}try{let r=new MutationObserver(n);r.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),vn.push({o:r,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",o,{passive:!0})}catch{}try{let r=i=>{zt();let s=i.composedPath?.()[0]||i.target;s&&s.nodeType===1&&!Kn(s)&&Rr(s.ownerDocument||t)?_r(s):le++};t.addEventListener("focusin",r,{capture:!0,passive:!0}),t.addEventListener("focusout",r,{capture:!0,passive:!0}),t.addEventListener("change",r,{capture:!0,passive:!0}),t.addEventListener("pointerdown",r,{capture:!0,passive:!0}),t.addEventListener("pointerup",r,{capture:!0,passive:!0}),t.addEventListener("pointercancel",r,{capture:!0,passive:!0}),t.addEventListener("keydown",r,{capture:!0,passive:!0}),t.addEventListener("keyup",r,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",r,{capture:!0,passive:!0}),t.addEventListener("toggle",r,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{zt(),le++},{passive:!0})}catch{}try{let r=t.fonts;r&&(r.addEventListener?.("loadingdone",o),r.status==="loading"&&r.ready?.then(o).catch(()=>{}))}catch{}}var gs=new WeakMap;function ys(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let o=gs.get(t)||[];if(o.length===n.length&&o.every((i,s)=>i===n[s]))return;if(gs.set(t,n),zt(),t.nodeType===11){t.host?Ar(t.host):ae++;for(let i of t.querySelectorAll("*"))we.set(i,ae);return}let r=o.filter(i=>!n.includes(i)).concat(n.filter(i=>!o.includes(i)));for(let i of r)if(i.isConnected)if(Rr(e))_r(i);else{le++;return}}function to(t,e=null){if(!t)return;ys(t,t);let n=e||xn.filter(({root:o})=>o.host?.isConnected).map(({root:o})=>o);for(let o of n)ys(o,t)}function Ut(){Ve();try{for(let t=vn.length-1;t>=0;t--){let{o:e,env:n,doc:o}=vn[t];if(o!==document&&!o.defaultView){try{e.disconnect()}catch{}kr.delete(o),Sn===o&&(Sn=null),vn.splice(t,1);continue}let r=e.takeRecords();r.length&&(n?Qn(r)&&(zt(),Rt++):Ms(r))}for(let t=xn.length-1;t>=0;t--){let{o:e,root:n}=xn[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Cr.delete(n),xn.splice(t,1);continue}let o=e.takeRecords();o.length&&ks(o)}}catch{}}function ve(t){if(!(!t||t.nodeType!==1)){ce.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ce.delete(e.currentNode)}catch{}}}var kf=["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"];function Tr(t){let e=ce.get(t);if(e&&eo(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function As(t){let e=ce.get(t);if(!e||!eo(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var bs=new WeakMap,Yn=new Map;function Mf(t){let e=t.href;return!e||typeof CSSStyleSheet!="function"?null:Yn.has(e)?Yn.get(e):(Yn.set(e,null),ut(e,{as:"text"}).then(n=>{if(!n.ok||typeof n.data!="string"||/@import/i.test(n.data))return;let o=new CSSStyleSheet;o.replaceSync(n.data),Yn.set(e,o.cssRules),zt(),Rt++}).catch(()=>{}),null)}function Yt(t){let e=bs.get(t);if(!e||e.epoch!==Ue){let n=e&&e.universe;e={epoch:Ue,...ls(t,Mf)};let o=e.universe;if(n&&o&&n.size===o.size){let r=!0;for(let i of o)if(!n.has(i)){r=!1;break}r&&(e.universe=n)}bs.set(t,e)}return e}function $r(t,e){return e?(e.__scan||(e.__scan=Yt(t),e.__scanEnv=Rt),e.__scan):Yt(t)}function _s(t){return Yt(t).leaksAcrossSubtrees}function Es(t){try{let e=Yt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,o=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let l=0;l{for(;Jt(a)&&!r.roots.has(a);a=a.host.getRootNode()){r.roots.add(a);for(let l of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=ws.get(l);if((!u||u.epoch!==Ue)&&ws.set(l,u={epoch:Ue,props:as(l)}),!u.props)return!1;for(let c of u.props)r.universe.add(c)}pr(a.getAnimations(),r.universe)}return!0},s=i(e)&&(!t.shadowRoot||i(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=i(a.getRootNode());return s?r.universe:o.__shadowUniverse=null}function Jn(t,e){let n=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==n?null:$r(n,e).pseudoUniverse}function Rs(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Yt(e).svgGeometry}function Fs(t){let e=Yt(t.ownerDocument||document).svgGeometrySel;if(e==null)return!0;if(!e)return!1;try{return t.matches(e)}catch{return!0}}var Ef={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function fe(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Ef:Yt(e).pseudoGates}function Rf(t,e={},n=null,o=null){let r={},i=e.excludeStyleProps,s=h=>{if(r[h]!==void 0||We(h)||i&&(i instanceof RegExp&&i.test(h)||typeof i=="function"&&i(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[h]=m)};if(o){for(let m of o)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;mi==="transparent"||i==="rgba(0, 0, 0, 0)",o=t["-webkit-text-fill-color"];if(!n(o!==void 0?o:t.color))return;let r=Pf(t["background-image"],t["background-color"]);r&&(n(t.color)&&(t.color=r),o!==void 0&&(t["-webkit-text-fill-color"]=r),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:r,enumerable:!1}))}function Tf(t,e,n){let o=n.textShadow;if(!o||o==="none"||!(parseFloat(n.webkitTextStrokeWidth)>0)||t.firstElementChild||n.backgroundImage!=="none"||n.boxShadow!=="none"||Ts(n.backgroundColor)[3]!==0||["Top","Right","Bottom","Left"].some(u=>parseFloat(n[`border${u}Width`])>0)||o.replace(/\([^)]*\)/g,"").includes(","))return;let r=(o.match(/(?:rgba?|hsla?|color|oklch|oklab|lab|lch)\([^)]*\)|#[\da-f]+|\b[a-z]+\b/i)||[])[0],[i=0,s=0,a=0]=(o.match(/-?[\d.]+px/g)||[]).map(parseFloat);if(!r)return;let l=n.filter&&n.filter!=="none"?`${n.filter} `:"";e.style.setProperty("text-shadow","none","important"),e.style.setProperty("filter",`${l}drop-shadow(${i}px ${s}px ${a/2}px ${r})`,"important")}var $f=/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^()]*\)/g,be;function Ts(t){if(!be){let e=document.createElement("canvas");e.width=e.height=1,be=e.getContext("2d",{willReadFrequently:!0})}return be.clearRect(0,0,1,1),be.fillStyle="transparent",be.fillStyle=t,be.fillRect(0,0,1,1),be.getImageData(0,0,1,1).data}function Pf(t,e){let n=i=>{let s=[];for(let a of(i||"").match($f)||[]){let[l,u,c,f]=Ts(a);f>13&&s.push([l,u,c])}return s},o=n(t);if(o.length||(o=n(e)),!o.length)return null;let r=[0,0,0];for(let[i,s,a]of o)r[0]+=i,r[1]+=s,r[2]+=a;return`rgb(${r.map(i=>Math.round(i/o.length)).join(", ")})`}function $s(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let r of kf){let i=t.getPropertyValue(r);if(i&&i!=="none")return!0}let o=t.getPropertyValue("background");return!!(o&&/url\s*\(/i.test(o))}function Nf(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function Lf(t,e,n){try{if(typeof t.computedStyleMap=="function"){let r=t.computedStyleMap().get("width");if(r!=null)return!xs(String(r).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!xs(String(o).trim().toLowerCase())?!0:Wf(t,e)?n||Of(t,e):!1}var If=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function xs(t){return If.has(t)||t.startsWith("fit-content")}function Wf(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let o=1/0,r=-1/0,i=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(i=i||document.createRange(),i.selectNode(s),a=i.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let l=O(s);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.leftr&&(r=a.right)}return r===-1/0?!1:r-o0?Math.abs(t.getBoundingClientRect().width-r)>.5:!1}var Mr=new WeakMap;function Df(t,e){let n=Mr.get(t);if(n)return n;let o=[e];for(let r in t)o.push(r,t[r]);return n=o.join(""),Mr.set(t,n),n}function eo(t,e){return t.env===Rt&&t.stamp===Zn(e,t.hosts)}var Bf=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,zf=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Uf=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Hf(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function jf(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let o=t.parentElement,r;if(!o)r="R";else if(r=e.ids.get(o),r===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;r="R"}if(e.rootSeen=!0,r===-1)return e.ids.set(t,-1),-1;let i="",s=t.attributes;if(s&&s.length)if(s.length===1)i=s[0].name+"="+s[0].value;else{let l=[];for(let u=0;uu[g])),h&&c.push(""+h),Mr.set(u,f.sig+""+c.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Er(t);return ce.set(t,{env:r?.__scanEnv??Rt,stamp:Zn(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function Gf(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:Sr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Sr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:t||e||{}}}var qf=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Xf=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Yf(t,e,n){if(!t.style||t.style.length===0)return;let o=Af(t),r=o!=null&&!qf.test(t.getAttribute("style")||""),i;for(let s=0;sf.snapshot[d]===c)||n.borderWidth===c}if(r&&!o.has(a)&&(!l||i)&&!(a.startsWith("background")&&Xf(t)))continue;let u=n.getPropertyValue(a);u&&(!l||u!==t.style.getPropertyValue(a))&&e.style.setProperty(a,u,t.style.getPropertyPriority(a))}}function xt(t,e,n,o){if(t.tagName==="STYLE")return;let r=Gf(n,o),i=r.options&&r.options.cache||"soft";i!=="disabled"&&Ve(t.ownerDocument),i==="disabled"&&!r.session.__bumpedForDisabled&&(zt(),Sr.clear(),r.session.__bumpedForDisabled=!0);let{session:s,persist:a}=r;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let l=s.styleCache.get(t);t.getAttribute?.("style")&&Yf(t,e,l);let u=l.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let c=t.tagName?.toLowerCase()||"div";if(mn.has(c)){let y={};Object.defineProperty(y,"__needsBgInline",{value:$s(l),enumerable:!1});let b=Er(t);ce.set(t,{env:Rt,stamp:Zn(t,b),hosts:b,snapshot:y,embedFonts:!!(r.options&&r.options.embedFonts),excludeStyleProps:r.options&&r.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let f=null;if(r.options&&r.options.__styleShare&&s.styleMap){let y=Hf(s),b=jf(t,y),w=t.ownerDocument||document,S=w.activeElement;b!==-1&&!Uf.has(t.tagName)&&!(S&&S!==w.body&&S!==w.documentElement&&S===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=Vf(t,l,r.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important"),(s.bgClipText||=[]).push([t,e])),Y()&&Tf(t,e,l),Kf(t,l,d),e.style?.length&&d["box-sizing"]==="border-box"&&l.getPropertyValue("box-sizing")!=="border-box"&&tu(t,e,d);let h=Ds(t);if(nu(t,e,d,h,s),h){let y=l.getPropertyValue("min-width");if(!y||y==="auto"||y==="0px"){d["min-width"]="0px";let b=l.getPropertyValue("overflow-x"),w=t.parentElement;if(y==="auto"&&(b==="visible"||b==="clip")&&w&&O(w).display.includes("flex")){let S=s.flexOverflow||(s.flexOverflow=new WeakMap),v=S.get(w);if(v===void 0){if(v=w.scrollWidth>w.clientWidth,!v){let C=O(w),M=P=>parseFloat(C.getPropertyValue(P))||0,T=M("width")-(C.boxSizing==="border-box"?M("padding-left")+M("padding-right")+M("border-left-width")+M("border-right-width"):0),A=C.flexDirection.startsWith("row")===(C.writingMode==="horizontal-tb")&&C.flexWrap==="nowrap",x=0,_=0;for(let P of w.children){s.styleCache.has(P)||s.styleCache.set(P,getComputedStyle(P));let E=s.styleCache.get(P);if(E.display==="none"||E.position==="absolute"||E.position==="fixed")continue;let R=k=>parseFloat(E.getPropertyValue(k))||0,L=R("width")+R("margin-left")+R("margin-right")+(E.boxSizing==="border-box"?0:R("padding-left")+R("padding-right")+R("border-left-width")+R("border-right-width"));x=A?x+L:Math.max(x,L),_++}v=x+(A?Math.max(0,_-1)*M("column-gap"):0)>T+_/60}S.set(w,v)}v&&(d["min-width"]=d.width)}}}let m=Df(d,c),g=!0;if(qn(c,(d.display||"").toLowerCase())){g=Nf(t),g&&gr(c,d,h)&&Lf(t,l,h)&&(g=!1),m=`${m}${g?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";g&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let p=a.snapshotKeyCache.get(m);p===void 0&&(p=Oe(d,c,g,h),a.snapshotKeyCache.size>=Sf&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,p)),s.styleMap.set(e,p)}function Kf(t,e,n){let o=e.getPropertyValue("overflow-x"),r=e.getPropertyValue("overflow-y");if((o==="visible"||!o)&&(r==="visible"||!r)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let i=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-i(e.getPropertyValue("border-left-width"))-i(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-i(e.getPropertyValue("border-top-width"))-i(e.getPropertyValue("border-bottom-width")),l=(u,c)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+c)*1e3)/1e3}px`)};s>=2&&(l("width",s),l("inline-size",s)),a>=2&&(l("height",a),l("block-size",a))}var Ls=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Is=["width","inline-size","height","block-size"];function Jf(t,e,n){if(!Ls.some(l=>n[l]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let l of["width","height"]){let u=n[`min-${l}`],c=n[`max-${l}`];if(u&&u!=="0px"&&u!=="auto"||c&&c!=="none")return""}let o=l=>parseFloat(n[l])||0,r=o("padding-left")+o("padding-right")+o("border-left-width")+o("border-right-width"),i=o("padding-top")+o("padding-bottom")+o("border-top-width")+o("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let l of Is){let u=n[l];if(!u||!u.endsWith("px"))continue;let f=l==="width"||l==="inline-size"&&!s||l==="block-size"&&s?r:i;n[l]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let l=t.scrollWidth<=t.clientWidth;n["overflow-x"]=l?"hidden":"auto",l&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let l=t.scrollHeight<=t.clientHeight;n["overflow-y"]=l?"hidden":"auto",l&&(a+="y")}return a}var Qf=["box-sizing",...Is,"overflow-x","overflow-y"],Zf=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function tu(t,e,n){if(Zf.test(t.getAttribute("style")))for(let o of Qf)e.style.getPropertyValue(o)&&n[o]&&e.style.setProperty(o,n[o],e.style.getPropertyPriority(o))}function eu(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}var Ss=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function nu(t,e,n,o,r){let i=n.display||"";if(!o&&!i.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed")return;let s=n["text-wrap-mode"]||n["white-space"]||"";if(s==="nowrap"||s==="pre"||Ss==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=r.__oneLine||=new WeakSet;for(let l=t.parentElement;l;l=l.parentElement)if(a.has(l))return;ou(t,n,r)&&(a.add(t),e.style.setProperty(Ss,"nowrap"))}function ou(t,e,n){let o=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(o>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let r=t.ownerDocument||document,i=r.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=r.createRange(),a=null,l=0,u=0;for(let d=i.nextNode();d;d=i.nextNode()){if(d.nodeType===1){if(d.shadowRoot||d.localName==="br"||d.localName==="textarea")return!1;continue}if(/\S/.test(d.data)){if(++u>64)return!1;s.selectNodeContents(d);for(let h of s.getClientRects())if(h.height){if(a||=h,Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)2||(delete n.height,delete n["block-size"])}Be();var lu=new Set(["symbol","defs"]),cu=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Pr=new WeakMap,Bs=-1;function no(t){let e=Se();return e!==Bs&&(Pr=new WeakMap,Bs=e),zs(t)}function zs(t){let e=Pr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(cu.has(t.localName)?n=!1:lu.has(t.localName)&&(n=!0)),n===void 0){let o=t.parentNode;n=!!(o&&o.nodeType===1)&&zs(o)}return Pr.set(t,n),n}function Us(t,e){if(t?.nodeType!==1||e?.nodeType!==1||no(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let i=t.attributes;for(let s=0;si.d-s.d);let r=window.devicePixelRatio||1;return(o.find(i=>i.d>=r)||o[o.length-1]).url}function Hs(t,e){let n=t.currentSrc||"";if(n&&!qe(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let i of o){let s=i.getAttribute("srcset");if(!s||qe(s))continue;let a=i.getAttribute("type");if(a&&!rr.test(a.trim()))continue;let l=i.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Xe(s,t)}catch{}r||(r=Xe(s,t))}return r}function js(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!qe(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!qe(o))return o}return null}At();dt();function fu(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var uu=/::[a-zA-Z-]+(?:\([^)]*\))?$|(?r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")&&r.includes("data-sd")||r.startsWith("@"))return r;let i=r.match(uu);if(i&&du.test(i[0]))return":not(*)";let s=i?r.slice(0,i.index).trim():r,a=n?fu(s,o):s;return`:where(${e} ${a})${i?i[0]:""}`}).join(", ")}function Xs(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(o,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(o,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(o,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(o,r,i,s)=>{let a=pu(s,e,!0,n);return`${r}${i}${a}{`}),t):""}function Ys(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Ce(t){let e="";for(let n of t)if(n.media&&n.cssRules){let o=!1;try{o=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}o&&(e+=Ce(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${Ce(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let o=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=o+(n.style?n.style.cssText:"")+Ce(n.cssRules)+"}"}else e+=n.cssText+` -`;return e}function Ks(t){let e="";try{t.querySelectorAll("style").forEach(o=>{let r=null;try{r=o.sheet&&o.sheet.cssRules}catch{}e+=(r?Ce(r):o.textContent||"")+` -`});let n=t.adoptedStyleSheets||[];for(let o of n)try{o&&o.cssRules&&(e+=Ce(o.cssRules))}catch{}}catch{}return e}function Js(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Qs(t,e,n={}){try{let o=null,r=O(t).content;if(r&&r.includes("url(")){let u=r.match(/url\(["']?([^"')]+)["']?\)/);u&&(o=u[1])}let i=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",l=o||(i?Hs(t,i):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Xe(a,t)||t.src||"";if((!l||qe(l))&&n.resolvePicturePlaceholders!==!1){let u=js(t);u&&(l=u)}if(!l)return;e.getAttribute("src")!==l&&e.setAttribute("src",l),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Zs(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function hu(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function ta(t,e,n){let o=[];for(let r of e){let i=hu(t,r);i&&o.push(`${r}: ${i};`)}return o.length?`${n}{${o.join("")}} -`:""}function ea(t,e){if(!t)return;let n=o=>{let r=o.getAttribute("data-sd-slotted")||"";e?` ${r} `.includes(` ${e} `)||o.setAttribute("data-sd-slotted",r?`${r} ${e}`:e):o.setAttribute("data-sd-slotted",r)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function mu(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;rsetTimeout(i,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function gu(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,i=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,o=parseFloat(l.borderRightWidth)||0,r=parseFloat(l.borderTopWidth)||0,i=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(r+i)));return{contentWidth:s,contentHeight:a,rect:e}}function Ft(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let o=getComputedStyle(t);if(e===0){let r=parseFloat(o.width);!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(o.height);!isNaN(r)&&r>0&&(n=r)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}var Vs=new WeakMap;function yu(t,e,n){let o=t.defaultView,r=o?o.scrollX:0,i=o?o.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,c=0,f=0,d=0,h=0;try{let p=o&&t.body?o.getComputedStyle(t.body):null;p&&(c=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),f=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${f}px ${d}px ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,g;try{let p=Vs.get(t);p||Vs.set(t,p=new o.CSSStyleSheet),p.replaceSync(m),t.adoptedStyleSheets=[...t.adoptedStyleSheets,p],g=()=>{t.adoptedStyleSheets=t.adoptedStyleSheets.filter(y=>y!==p)}}catch{let p=t.createElement("style");p.setAttribute("data-sd-iframe-pin",""),tt(p),p.textContent=m,(t.head||t.documentElement).appendChild(p),g=()=>p.remove()}if(ve(t.documentElement),r||i)try{t.body&&(t.body.scrollLeft=r,t.body.scrollTop=i),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=r),t.documentElement.scrollTop||(t.documentElement.scrollTop=i))}catch{}return()=>{try{g()}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(r,i),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}ve(t.documentElement)}}async function Nr(t,e,n){let o=await mu(t,3);if(!o)throw new Error("The iframe document isn't ready.");let{contentWidth:r,contentHeight:i,rect:s}=gu(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let l={...n,scale:1,clip:null,__pinned:!0},u=yu(o,r,i),c;try{c=await a.toPng(o.documentElement,l)}finally{u()}c.style.display="block",c.style.width=`${r}px`,c.style.height=`${i}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),xt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(c),f}function na(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function oa(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Number.isFinite(i)&&i>0?i:e||o.width||128,l=Number.isFinite(s)&&s>0?s:n||o.height||16,u=Number.parseFloat(t.min)||0,c=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=c-u,h=d>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/d)):.5,m="middle";try{r&&r.verticalAlign&&(m=r.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement","range"),g.style.cssText=`display:inline-block;width:${a}px;height:${l}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",String(a)),p.setAttribute("height",String(l)),p.setAttribute("viewBox",`0 0 ${a} ${l}`),p.style.cssText=`width:${a}px;height:${l}px;overflow:visible`,g.appendChild(p);function y(){let b=na(r),w=!!t.disabled,S=Math.max(2,Math.min(4,l)),v=(l-S)/2,C=Math.max(10,Math.min(14,Math.max(l,10))),M=C/2,T=M+h*Math.max(0,a-C);p.innerHTML="";let F=(x,_,P,E)=>{let R=document.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("x",String(x)),R.setAttribute("y",String(v)),R.setAttribute("width",String(Math.max(0,_))),R.setAttribute("height",String(S)),R.setAttribute("rx",String(S/2)),R.setAttribute("fill",P),E&&R.setAttribute("fill-opacity",E),p.appendChild(R)};F(0,a,"#808080","0.4"),F(0,T,b);let A=document.createElementNS("http://www.w3.org/2000/svg","circle");A.setAttribute("cx",String(T)),A.setAttribute("cy",String(l/2)),A.setAttribute("r",String(M)),A.setAttribute("fill",b),p.appendChild(A),w&&p.setAttribute("opacity","0.5"),g.style.setProperty("width",`${a}px`,"important"),g.style.setProperty("height",`${l}px`,"important"),g.style.setProperty("min-width",`${a}px`,"important"),g.style.setProperty("min-height",`${l}px`,"important")}return y(),{el:g,applyVisual:y}}function ra(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Math.round(e||o.width||0),l=Math.round(n||o.height||0),u=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,a||16),c=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,g=Math.max(Math.min(u,c),12),p=Math.max(u,g),y=Math.max(c,g),b="middle";try{r&&r.verticalAlign&&(b=r.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${p}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("width",String(p)),S.setAttribute("height",String(y)),S.setAttribute("viewBox",`0 0 ${g} ${g}`),S.style.cssText=`width:${p}px;height:${y}px`,w.appendChild(S);function v(){let C=na(r),M=2,T=M/2,F=g-M;if(S.innerHTML="",f){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(T)),A.setAttribute("y",String(T)),A.setAttribute("width",String(F)),A.setAttribute("height",String(F)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${T+2} ${g/2} L ${g/2-1} ${g-T-2} L ${g-T-2} ${T+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,M))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),S.appendChild(x)}else if(h){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),_=Math.max(6,F-4);x.setAttribute("x",String((g-_)/2)),x.setAttribute("y",String((g-M)/2)),x.setAttribute("width",String(_)),x.setAttribute("height",String(M)),x.setAttribute("fill",C),x.setAttribute("rx","1"),S.appendChild(x)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(g/2)),A.setAttribute("cy",String(g/2)),A.setAttribute("r",String((g-M)/2)),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),_=Math.max(2,(g-M*2)*.35);x.setAttribute("cx",String(g/2)),x.setAttribute("cy",String(g/2)),x.setAttribute("r",String(_)),x.setAttribute("fill","white"),S.appendChild(x)}}w.style.setProperty("width",`${p}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${p}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return v(),{el:w,applyVisual:v}}var Mn=new gt(80);async function bu(t){if(j.resource?.has(t))return j.resource.get(t);if(Mn.has(t))return Mn.get(t);let e=(async()=>{let n=await ut(t,{as:"dataURL"});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return j.resource?.set(t,n.data),n.data})();Mn.set(t,e);try{let n=await e;return Mn.set(t,n),n}catch(n){throw Mn.delete(t),n}}var Gs=/\bblob:[^)"'\s]+/g;function oo(t){return typeof t=="string"&&t.startsWith("blob:")}function wu(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function xu(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function An(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function ro(t,e=null){if(!t)return;let n=e,o=new Set,r=[],i=new Map,s=(g,p,y,b)=>{o.add(y),r.push(()=>{i.has(y)&&(g.setAttribute(p,i.get(y)),b?.())})},a=(g,p)=>{if(!g||!g.includes("blob:"))return;let y=g.match(Gs)||[];if(y.length){for(let b of y)o.add(b);r.push(()=>{let b=g.replace(Gs,w=>i.get(w)||w);b!==g&&p(b)})}},l=An(t,"img");for(let g of l)try{let y=g.getAttribute("src")||g.currentSrc||"";oo(y)&&s(g,"src",y);let b=g.getAttribute("srcset");if(b&&b.includes("blob:")){let w=wu(b);for(let S of w)oo(S.url)&&o.add(S.url);r.push(()=>{let S=!1;for(let v of w)i.has(v.url)&&(v.url=i.get(v.url),S=!0);S&&g.setAttribute("srcset",xu(w))})}}catch(p){D(n,"Couldn't inline a blob: image.",p)}let u=An(t,"image");for(let g of u)try{let p="http://www.w3.org/1999/xlink",y=g.getAttribute("href")||g.getAttributeNS?.(p,"href");oo(y)&&s(g,"href",y,()=>g.removeAttributeNS?.(p,"href"))}catch(p){D(n,"Couldn't inline a blob: SVG image.",p)}let c=An(t,"[style*='blob:']");for(let g of c)try{let p=g.getAttribute("style");a(p,y=>g.setAttribute("style",y))}catch(p){D(n,"Couldn't inline blob: URLs in a style attribute.",p)}let f=An(t,"style");for(let g of f)try{let p=g.textContent||"";a(p,y=>{g.textContent=y})}catch(p){D(n,"Couldn't inline blob: URLs in a "),d=/]*?( style=")([^"]*)"/i.exec(c.slice(f<0?0:f));if(!d)return null;let h=(f<0?0:f)+d.index,m=c.slice(0,h)+d[0].slice(0,-1)+`;zoom:${s} !important"`+c.slice(h+d[0].length);return r.replace(/(\bwidth=")[^"]*/i,`$1${e}`).replace(/(\bheight=")[^"]*/i,`$1${n}`).replace(/(\bviewBox=")[^"]*/i,`$10 0 ${e} ${n}`)+l+m}function Ri(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Ee(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Qo(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function Re(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function pc(t){let e=[],n="",o=0;for(let r=0;rr.trim()).filter(Boolean)}function zh(t){let e=[],n="",o=0;for(let i=0;i`${a}:${l}`).join(";")}function Uh(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${hc(o)}}`)}function Hh(t){return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Uh(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${hc(o)}${n}`),t}function jh(){return qo||(qo=(async()=>{try{let t='
',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let r=o.getImageData(2,18,1,1).data[3]>128,i=o.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),qo)}function Vh(t){let e=[],n=0,o=0;for(let r=0;r{let i=0,s=0,a="",l=0;for(;lpc(o).map(r=>{let i=r.indexOf(":");if(i<0)return r;let s=r.slice(0,i).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Vh(r.slice(i+1))}`:r}).join(";");return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(o,r)=>o.replace(r,r.replace(/([^{}]+)\{([^}]*)\}/g,(i,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,r,i)=>`style=${r}${n(i)}${r}`),t}async function Zo(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await jh();try{let r=t;return n||(r=Hh(r)),o&&(r=Gh(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function qh(t,e,n){let o=t.naturalWidth,r=t.naturalHeight,i=Math.min(8,r),s=document.createElement("canvas");s.width=Math.max(1,Math.ceil(o*e)),s.height=Math.max(1,Math.ceil(i*6*n));let a=s.getContext("2d",{willReadFrequently:!0});return!a||!(o>0&&r>0)?null:()=>{a.clearRect(0,0,s.width,s.height);for(let f=0;f<6;f++){let d=Math.floor((r-i)*f/5);a.drawImage(t,0,d,o,i,0,f*i*n,o*e,i*n)}let l=a.getImageData(0,0,s.width,s.height).data,u=!1,c=0;for(let f=3;f0&&(u=!0),c=c*31+l[f-3]+l[f-2]*7+l[f-1]*13+l[f]|0;return{ink:u,sig:c}}}async function Xh(t,e,n){tt(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await Xo(),await Xo(),!1;let o=performance.now()+(e?600:150),r=null;for(;;){let i;try{i=n()}catch{return!1}if(i.ink&&(!e||i.sig===r))return!0;if(r=i.sig,performance.now()>o)return i.ink;await Xo()}}finally{try{t.remove()}catch{}}}function Ko(){clearTimeout(Li),pe?.remove(),pe=null,Yo=0}function Kh(t){gc=t??mc}function uc(t){if(typeof document>"u"||!document.body)return new Image;if(clearTimeout(Li),pe&&!pe.contentDocument&&Ko(),pe&&Yo>Yh&&Dn===0&&Ko(),!pe){let n=document.createElement("iframe");tt(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)pe=n,Yo=0;else{try{n.remove()}catch{}return new Image}}Yo+=t.length,Dn+=1;let e=pe.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function $i(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,Dn=Math.max(0,Dn-1),e&&(Fi=!0),!(Dn>0)&&(Fi?(Fi=!1,Ko()):Li=setTimeout(Ko,gc)))}function dc(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function em(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),o=0,r=0;for(let i=e;i+48<=t.length;i+=n){let s=t.slice(i,i+48);o++,tm.some(a=>s.includes(a))||r++}return r*2>o}function Ti(t,e,n,o,r){if(!e.naturalWidth){t.drawImage(e,0,0,n,o);return}let i=n*o,s=i>Jh&&!em(r)?Math.min(Zh,Math.ceil(i/Qh)):1;if(s===1){t.drawImage(e,0,0,n,o);return}let a=e.naturalWidth,l=e.naturalHeight/o;for(let u=0;u]*>/i)||[])[0]||"",g=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&Number.isFinite(p)&&g>0&&p>0&&Math.min(1,jt/g,jt/p,Math.sqrt(he/(g*p)))<1;if(l||y||Y())try{let b=Ee(t);if(l&&(b=Jo(b,l)),Y()){let w=await Zo(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||l)&&(b=Dh(b,e)),c=Re(b)}catch(b){if(l)throw b;c=t}}let h=u||uc(c);try{u||await dc(h,c)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let g=h;h=uc(c),$i(g);try{await dc(h,c)}catch(p){throw $i(h,e.__releaseDecodeFrame),p}}try{!u&&!Y()&&Ri(c)&&(_t()?/.data(?:%3A|:)image(?:%2F|\/)svg/i:/(?:%40|@)font-face/i).test(c)&&await new Promise(N=>{let U=new MessageChannel;U.port1.onmessage=()=>{U.port1.close(),U.port2.close(),N()},U.port2.postMessage(0)});let m=u?u.width:h.naturalWidth,g=u?u.height:h.naturalHeight,p=l?m:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:m,y=l?g:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:g,b,w,S=Number.isFinite(n),v=Number.isFinite(o);if(S&&v)b=Math.max(1,n),w=Math.max(1,o);else if(S){let N=n/Math.max(1,p);b=n,w=y*N}else if(v){let N=o/Math.max(1,y);w=o,b=p*N}else{let N=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);b=N?s.vbW:m,w=N?s.vbH:g}!S&&!v&&(b=b*r,w=w*r);let C=b*i,M=w*i,$=Math.max(C/jt,M/jt,Math.sqrt(C*M/he)),F=e.__encodeFormat==="webp"?Math.max(C,M)/Pi:0,A=Math.max($,F);if(A>1){let N=$<=1;nt(e.__session,"canvas-clamp",`output ${Math.round(C)}x${Math.round(M)}px exceeds ${N?"WebP":"canvas"} limits; downscaled`),D(e,N?`${Math.round(C)}\xD7${Math.round(M)}px is larger than WebP can encode (${Pi}px per side); scaled down. For full size, export a PNG, an SVG, or crop.`:`${Math.round(C)}\xD7${Math.round(M)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),b/=A,w/=A}let x=Pt(e.canvas)&&ft(e.canvas,"canvas")?e.canvas:document.createElement("canvas");x.width=Math.max(1,b*i),x.height=Math.max(1,w*i),x.style.width=`${b}px`,x.style.height=`${w}px`;let _=x.getContext("2d");if(!_)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let P=null,E=e.__layoutZoom||1;if(!u&&_t()){let N=E*p/(b*i),U=Math.round(b*i*N),z=Math.round(w*i*N);N>1.01&&U<=jt&&z<=jt&&U*z<=he&&(P={w:U,h:z})}let R=f&&(Math.round(b*i)!==m||Math.round(w*i)!==g),L=R?m:P?P.w:b*i,k=R?g:P?P.h:w*i,I=Y()&&!u?qh(h,L/Math.max(1,m),k/Math.max(1,g)):null,W=!1;I&&(W=await Xh(h,d,I));let T=()=>{if(_.save(),i!==1&&_.scale(i,i),a&&(_.save(),_.fillStyle=a,_.fillRect(0,0,b,w),_.restore()),R){let N=document.createElement("canvas");N.width=m,N.height=g,Ti(N.getContext("2d"),h,m,g,c),_.drawImage(N,0,0,b,w)}else{if(_.save(),_.setTransform(1,0,0,1,0,0),P){let N=document.createElement("canvas");for(N.width=P.w,N.height=P.h,Ti(N.getContext("2d"),h,P.w,P.h,c);N.width>b*i*2;){let U=document.createElement("canvas");U.width=Math.ceil(N.width/2),U.height=Math.ceil(N.height/2),U.getContext("2d").drawImage(N,0,0,U.width,U.height),N=U}_.imageSmoothingQuality="high",_.drawImage(N,0,0,b*i,w*i)}else Ti(_,h,b*i,w*i,c);_.restore()}_.restore()};if(T(),I&&W&&d){let N=!0;try{N=I().ink}catch{}if(!N){let U=performance.now()+600;do{await Xo();try{N=I().ink}catch{break}}while(!N&&performance.now(){"use strict";dt();wt();vt();At();jt=Y()?16384:32767,he=16384*16384,Pi=16383;qo=null;Xo=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Yh=24*1024*1024,mc=5e3,pe=null,Yo=0,Dn=0,Fi=!1,gc=mc,Li=0;Jh=4e6,Qh=2e6,Zh=8,tm=["%3C","%3E","%20","%7B","%7D","%3B"]});var Bn={};re(Bn,{rasterize:()=>Ii});async function Ii(t,e){let n=await te(t,{...e,__encodeFormat:e.format}),i=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let l=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return l();let c=new FileReader;c.onload=()=>a(String(c.result||"")),c.onerror=l,c.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{l()}}),s=new Image;return s.src=i,Y()?await s.decode():await new Promise((a,l)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=l}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var un=st(()=>{"use strict";Fe();dt()});var Wi={};re(Wi,{toImg:()=>nm,toSvg:()=>nm});async function nm(t,e){let{scale:n=1,width:o,height:r,meta:i={}}=e,s=Number.isFinite(o),a=Number.isFinite(r),l=Number.isFinite(n)&&n!==1||s||a;if(Y()&&l)try{let{svg:d}=await Zo(Ee(t)),h=(d.match(/]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(g))throw new Error("The SVG has no size.");let p=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:m,y=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:g,b,w;s&&a?(b=o,w=r):s?(b=o,w=Math.max(1,Math.round(y*(o/Math.max(1,p))))):a?(w=r,b=Math.max(1,Math.round(p*(r/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(g*n)));let S=Ni(d,b,w)||d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=Re(S),await v.decode(),v.style.width=`${b}px`,v.style.height=`${w}px`,v}catch(d){return nt(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),D(e,"Safari couldn't show the SVG; used a PNG.",d),Ii(t,{...e,format:"png",quality:1,meta:i})}let u=t,c=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=Ee(t),h=(d.match(/]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),g=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&g>0){let p=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(g*n))}"`);u=Re(d.replace(h,p)),c=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!c)throw d;f.src=t,c=!1,await f.decode()}if(s&&a)f.style.width=`${o}px`,f.style.height=`${r}px`;else if(s){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=o/Math.max(1,d);f.style.width=`${o}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=r/Math.max(1,h);f.style.height=`${r}px`,f.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(f.naturalWidth*(c?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(c?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!c&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let g=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,await f.decode()}catch(m){D(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var Oi=st(()=>{"use strict";Et();wt();un();Fe()});var wc={};re(wc,{encodePng:()=>om});function tr(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),o=new DataView(n.buffer);o.setUint32(0,e.length);for(let i=0;i<4;i++)n[i+4]=t.charCodeAt(i);n.set(e,8);let r=4294967295;for(let i=4;i>>8;return o.setUint32(n.length-4,(r^4294967295)>>>0),n}async function om(t,e,n){if(![t,e].every(g=>Number.isInteger(g)&&g>0&&g<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let o=new Uint8Array(13),r=new DataView(o.buffer);r.setUint32(0,t),r.setUint32(4,e),o[8]=8,o[9]=6;let i=[new Uint8Array([137,80,78,71,13,10,26,10]),tr("IHDR",o),tr("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),l=new Uint8Array(s),u=0,c=new CompressionStream("deflate"),f=c.writable.getWriter(),d=c.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:g,value:p}=await d.read();if(g)return;i.push(tr("IDAT",p))}}catch(g){h=g,await f.abort(g).catch(()=>{})}})();try{for await(let g of n){if(!(g instanceof Uint8Array||g instanceof Uint8ClampedArray)||!g.length||g.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let p=g.length/s;if(u+p>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y{"use strict";bc=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;bc[t]=e}});var Ec={};re(Ec,{encodeJpeg:()=>am});function Cc(t){let e=[0,240];for(let n=0;n<16;n++)for(let o=1;o<=10;o++)e.push(n<<4|o);return t.concat(e.filter(n=>!t.includes(n)).sort((n,o)=>n-o))}function sm(t){for(let e=0;e<64;e+=8)Ac(t,e,1);for(let e=0;e<8;e++)Ac(t,e,8)}function Ac(t,e,n){let o=t[e]+t[e+7*n],r=t[e]-t[e+7*n],i=t[e+n]+t[e+6*n],s=t[e+n]-t[e+6*n],a=t[e+2*n]+t[e+5*n],l=t[e+2*n]-t[e+5*n],u=t[e+3*n]+t[e+4*n],c=t[e+3*n]-t[e+4*n],f=o+u,d=o-u,h=i+a,m=i-a;t[e]=f+h,t[e+4*n]=f-h;let g=(m+d)*.707106781;t[e+2*n]=d+g,t[e+6*n]=d-g,f=c+l,h=l+s,m=s+r;let p=(f-m)*.382683433,y=.5411961*f+p,b=1.306562965*m+p,w=h*.707106781,S=r+w,v=r-w;t[e+5*n]=v+y,t[e+3*n]=v-y,t[e+n]=S+b,t[e+7*n]=S-b}async function am(t,e,n,o){if(![t,e].every(R=>Number.isInteger(R)&&R>0&&R<=65535))throw new RangeError("[SnapDOM] JPEG dimensions must be integers from 1 to 65535");let r=Math.min(100,Math.max(1,Math.round((typeof o=="number"&&o>=0&&o<=1?o:.92)*100))),i=r<50?5e3/r:200-r*2,s=r<90?1:0,a=8<{let k=new Uint8Array(64),I=new Float32Array(64);for(let W=0;W<64;W++){let T=Math.min(255,Math.max(1,Math.floor((R[W]*i+50)/100)));k[Sc[W]]=T,I[W]=1/(T*vc[W>>3]*vc[W&7]*8)}return l.push(...L?[1]:[],...k),I}),c=(R,L)=>[255,R,L.length+2>>8,L.length+2&255,...L],f=[255,216,...c(224,[74,70,73,70,0,1,1,0,0,1,0,1,0,0]),...c(219,l),...c(192,[8,e>>8,e&255,t>>8,t&255,3,1,s?34:17,0,2,17,1,3,17,1]),...c(196,_c.flatMap(([R,,L,k])=>[R,...L,...k])),...c(218,[3,1,0,2,17,3,17,0,63,0])],d=[new Uint8Array(f)],h=new Uint8Array(65536),m=0,g=0,p=0;function y(R,L){for(g=g<=8;){p-=8;let k=g>>>p&255;m>=h.length-1&&(d.push(h.subarray(0,m)),h=new Uint8Array(65536),m=0),h[m++]=k,k===255&&(h[m++]=0)}g&=(1<15;U-=16)y(W[240][0],W[240][1]);N=32-Math.clz32(Math.abs(T));let V=W[U<<4|N];y(V[0],V[1]),y((T<0?T-1:T)&(1<>s)*8+(W>>s);F[V]+=(-.168736*N-.331264*U+.5*z)*x,A[V]+=(.5*N-.418688*U-.081312*z)*x}}for(let k=0;k<(s?4:1);k++){let I=(k>>1)*128+(k&1)*8;for(let W=0;W<64;W++)b[W]=$[I+(W>>3)*a+(W&7)];v(0,0)}b.set(F),v(1,1),b.set(A),v(2,1)}}let P=0,E=0;for await(let R of n){if(!(R instanceof Uint8Array||R instanceof Uint8ClampedArray)||!R.length||R.length%C)throw new RangeError("[SnapDOM] JPEG input must contain complete RGBA rows");let L=R.length/C;if(P+L>e)throw new RangeError("[SnapDOM] JPEG input exceeds the declared height");for(let k=0;k{"use strict";Sc=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],rm=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],im=Array.from({length:64},(t,e)=>(e&7)<4&&e<32?[17,18,24,47,18,21,26,66,24,26,56,99,47,66,99,99][(e>>3)*4+(e&7)]:99),vc=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];kc=[0,1,2,3,4,5,6,7,8,9,10,11],_c=[[0,0,[0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],kc],[16,0,[0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Cc([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130])],[1,1,[0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],kc],[17,1,[0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],Cc([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241])]],Mc=_c.map(([,,t,e])=>{let n=[],o=0,r=0;for(let i=1;i<=16;i++,o<<=1)for(let s=0;s]*>/i)?.[0];if(!o)return null;let r=e.crop?Jo(o,e.crop):o,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),s=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),a=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&s>0)||a.length!==4||!a.every(Number.isFinite)||!(a[2]>0&&a[3]>0))return null;let l=Number.isFinite(e.width),u=Number.isFinite(e.height),c=e.meta||{},f=Math.max(1,Math.floor(i)),d=Math.max(1,Math.floor(s)),h=e.crop?f:Number.isFinite(c.vbW)?c.vbW:Number.isFinite(c.w0)?c.w0:f,m=e.crop?d:Number.isFinite(c.vbH)?c.vbH:Number.isFinite(c.h0)?c.h0:d,g=e.dpr??1,p=e.scale??1,y=(l&&u?Math.max(1,e.width):l?e.width:u?e.height*h/Math.max(1,m):f*p)*g,b=(l&&u?Math.max(1,e.height):u?e.height:l?e.width*m/Math.max(1,h):d*p)*g;if(Math.max(i,s,y,b)<=jt&&i*s<=he&&y*b<=he||(n==="png"?typeof CompressionStream!="function":Math.max(y,b)>=65536))return null;return w();async function w(){let S=Math.max(1,Math.floor(y)),v=Math.max(1,Math.floor(b)),C=Ee(t),M=C.slice(C.indexOf(o)+o.length,C.lastIndexOf("")),$=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",F=i/a[2],A=s/a[3],x=0,_=0;/\bnone\b/.test($)||(F=A=/\bslice\b/.test($)?Math.max(F,A):Math.min(F,A),x=(i-a[2]*F)*(/xMin/.test($)?0:/xMax/.test($)?1:.5),_=(s-a[3]*A)*(/YMin/.test($)?0:/YMax/.test($)?1:.5)),x-=a[0]*F,_-=a[1]*A;let P=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),E=Y()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(C),R=i/y,L=s/b,k=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/S),E?Math.floor(2046/L):8192)),I=Math.max(1,Math.min(8192,S,E?Math.floor(2046/R):8192));async function*W(){for(let T=0;T${M}`,X=await te(Re(q),{width:at,height:pt,dpr:1,backgroundColor:E?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),G=X;try{if(E){G=document.createElement("canvas"),G.width=V,G.height=N;let Z=G.getContext("2d");e.backgroundColor&&(Z.fillStyle=e.backgroundColor,Z.fillRect(0,0,V,N)),Z.drawImage(X,z*R-B,T*L-rt,V*R,N*L,0,0,V,N)}let ht=G.getContext("2d").getImageData(0,0,V,N).data;for(let Z=0;Z(xc(),wc))).encodePng(S,v,W()):(await Promise.resolve().then(()=>(Rc(),Ec))).encodeJpeg(S,v,W(),e.quality)}}var Di=st(()=>{"use strict";Fe();dt()});var Fc={};re(Fc,{toBlob:()=>Bi});async function Bi(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let s=jn(decodeURIComponent(t.split(",")[1]),e.__fileSvg);return new Blob([s],{type:"image/svg+xml"})}let o=n==="jpg"?"jpeg":n,r=(o==="png"||o==="jpeg")&&er(t,e,o);if(r)return r;let i=await te(t,{...e,__encodeFormat:o});return new Promise(s=>i.toBlob(a=>s(a),`image/${o}`,e.quality))}var zi=st(()=>{"use strict";Fe();Di();vt()});var Tc={};re(Tc,{download:()=>lm});async function $c(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(o){if(o.name!=="AbortError")return!1}return!0}async function lm(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),r=n.has(o)?o:"",i=(e?.format||r||"").toLowerCase(),s=i==="jpg"?"jpeg":i||"png",a=e?.filename||"snapdom",l=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let c=xn(),f=(s==="png"||s==="jpeg")&&er(t,u,s);if(s==="svg"||f){let m=f?await f:await Bi(t,{...u,type:"svg"});if(c&&await $c(m,l))return;let g=URL.createObjectURL(m),p=document.createElement("a");p.href=g,p.download=l,document.body.appendChild(p),p.click(),setTimeout(()=>URL.revokeObjectURL(g),1e3),p.remove();return}let d=await te(t,{...u,__encodeFormat:s});if(c){let m=`image/${s}`,g=await new Promise(p=>d.toBlob(p,m,e?.quality));if(g&&await $c(g,l))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=l,document.body.appendChild(h),h.click(),h.remove()}var Pc=st(()=>{"use strict";zi();Fe();Di();dt()});Et();Et();dt();Mt();qn();At();ye();var ce=new WeakMap,ys=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],vr=new Map,Cf=2e3,He=0;function zt(){He++}function Jn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Xt(e))return!0;e.parentElement?e=e.parentElement:e=Bt(e)}return!1}function Zn(t){for(let e of t)if(xe(e))return!0;return!1}function xe(t){if(Jn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!Jn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!Jn(n)){e=!1;break}}if(e)return!1}return!0}var ze=new WeakMap;function ks(t){for(let e of t){if(!xe(e))continue;let n=e.target.ownerDocument||document;ze.set(n,(ze.get(n)||0)+1);let o=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;o;o=o.parentElement||Bt(o))ze.set(o,(ze.get(o)||0)+1)}}function kn(t){let e=t.ownerDocument||document;return Ge(e),(ze.get(e)||0)-(ze.get(t)||0)}var Rt=0;function je(t=document){return Ge(t),Rt}function Se(){return Ge(),He}function Mn(t){return t?(Ge(t.ownerDocument||document),to(t,Rr(t))):0}function Ve(){zt(),Rt++}var we=new WeakMap,ae=0,le=0;function kf(t){we.set(t,++ae)}function _r(t){if(!t||t.nodeType!==1)return;ae++,we.set(t,ae);let e=t.querySelectorAll("*");for(let n=0;nn?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let o=n.target,r=o&&(o.nodeType===1?o:o.parentElement);if(r&&(r.tagName==="STYLE"||r.tagName==="LINK"))return r.ownerDocument||document;for(let i of n.addedNodes)if(e(i))return i.ownerDocument||document;for(let i of n.removedNodes)if(e(i))return i.ownerDocument||o&&o.ownerDocument||document}return null}var kr=new WeakSet,Sn=[];function Ms(t){if(!Zn(t))return;ks(t),zt();let e=new Set;for(let n of t){if(!xe(n))continue;let o=n.target.getRootNode&&n.target.getRootNode();if(!o||o.nodeType!==11||e.has(o))continue;e.add(o),o.host?_r(o.host):ae++;let r=o.querySelectorAll("*");for(let i=0;i{Zn(r)&&(zt(),Rt++)},o=()=>{zt(),Rt++};try{let r=new MutationObserver(As);r.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Cn.push({o:r,env:!1,doc:t})}catch{}try{let r=new MutationObserver(n);r.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Cn.push({o:r,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",o,{passive:!0})}catch{}try{let r=i=>{zt();let s=i.composedPath?.()[0]||i.target;s&&s.nodeType===1&&!Jn(s)&&Fr(s.ownerDocument||t)?Er(s):le++};t.addEventListener("focusin",r,{capture:!0,passive:!0}),t.addEventListener("focusout",r,{capture:!0,passive:!0}),t.addEventListener("change",r,{capture:!0,passive:!0}),t.addEventListener("pointerdown",r,{capture:!0,passive:!0}),t.addEventListener("pointerup",r,{capture:!0,passive:!0}),t.addEventListener("pointercancel",r,{capture:!0,passive:!0}),t.addEventListener("keydown",r,{capture:!0,passive:!0}),t.addEventListener("keyup",r,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",r,{capture:!0,passive:!0}),t.addEventListener("toggle",r,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{zt(),le++},{passive:!0})}catch{}try{let r=t.fonts;r&&(r.addEventListener?.("loadingdone",o),r.status==="loading"&&r.ready?.then(o).catch(()=>{}))}catch{}}var bs=new WeakMap;function ws(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let o=bs.get(t)||[];if(o.length===n.length&&o.every((i,s)=>i===n[s]))return;if(bs.set(t,n),zt(),t.nodeType===11){t.host?_r(t.host):ae++;for(let i of t.querySelectorAll("*"))we.set(i,ae);return}let r=o.filter(i=>!n.includes(i)).concat(n.filter(i=>!o.includes(i)));for(let i of r)if(i.isConnected)if(Fr(e))Er(i);else{le++;return}}function eo(t,e=null){if(!t)return;ws(t,t);let n=e||Sn.filter(({root:o})=>o.host?.isConnected).map(({root:o})=>o);for(let o of n)ws(o,t)}function Ut(){Ge();try{for(let t=Cn.length-1;t>=0;t--){let{o:e,env:n,doc:o}=Cn[t];if(o!==document&&!o.defaultView){try{e.disconnect()}catch{}Mr.delete(o),vn===o&&(vn=null),Cn.splice(t,1);continue}let r=e.takeRecords();r.length&&(n?Zn(r)&&(zt(),Rt++):As(r))}for(let t=Sn.length-1;t>=0;t--){let{o:e,root:n}=Sn[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}kr.delete(n),Sn.splice(t,1);continue}let o=e.takeRecords();o.length&&Ms(o)}}catch{}}function ve(t){if(!(!t||t.nodeType!==1)){ce.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ce.delete(e.currentNode)}catch{}}}var Af=["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"];function Tr(t){let e=ce.get(t);if(e&&no(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function _s(t){let e=ce.get(t);if(!e||!no(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var xs=new WeakMap,Kn=new Map;function _f(t){let e=t.href;return!e||typeof CSSStyleSheet!="function"?null:Kn.has(e)?Kn.get(e):(Kn.set(e,null),ut(e,{as:"text"}).then(n=>{if(!n.ok||typeof n.data!="string"||/@import/i.test(n.data))return;let o=new CSSStyleSheet;o.replaceSync(n.data),Kn.set(e,o.cssRules),zt(),Rt++}).catch(()=>{}),null)}function Yt(t){let e=xs.get(t);if(!e||e.epoch!==He){let n=e&&e.universe;e={epoch:He,...fs(t,_f)};let o=e.universe;if(n&&o&&n.size===o.size){let r=!0;for(let i of o)if(!n.has(i)){r=!1;break}r&&(e.universe=n)}xs.set(t,e)}return e}function Pr(t,e){return e?(e.__scan||(e.__scan=Yt(t),e.__scanEnv=Rt),e.__scan):Yt(t)}function Es(t){return Yt(t).leaksAcrossSubtrees}function Rs(t){try{let e=Yt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,o=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let l=0;l{for(;Jt(a)&&!r.roots.has(a);a=a.host.getRootNode()){r.roots.add(a);for(let l of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=Ss.get(l);if((!u||u.epoch!==He)&&Ss.set(l,u={epoch:He,props:cs(l)}),!u.props)return!1;for(let c of u.props)r.universe.add(c)}hr(a.getAnimations(),r.universe)}return!0},s=i(e)&&(!t.shadowRoot||i(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=i(a.getRootNode());return s?r.universe:o.__shadowUniverse=null}function Qn(t,e){let n=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==n?null:Pr(n,e).pseudoUniverse}function Fs(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Yt(e).svgGeometry}function $s(t){let e=Yt(t.ownerDocument||document).svgGeometrySel;if(e==null)return!0;if(!e)return!1;try{return t.matches(e)}catch{return!0}}var Ff={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function fe(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Ff:Yt(e).pseudoGates}function $f(t,e={},n=null,o=null){let r={},i=e.excludeStyleProps,s=h=>{if(r[h]!==void 0||We(h)||i&&(i instanceof RegExp&&i.test(h)||typeof i=="function"&&i(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[h]=m)};if(o){for(let m of o)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;mi==="transparent"||i==="rgba(0, 0, 0, 0)",o=t["-webkit-text-fill-color"];if(!n(o!==void 0?o:t.color))return;let r=Lf(t["background-image"],t["background-color"]);r&&(n(t.color)&&(t.color=r),o!==void 0&&(t["-webkit-text-fill-color"]=r),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:r,enumerable:!1}))}function Pf(t,e,n){let o=n.textShadow;if(!o||o==="none"||!(parseFloat(n.webkitTextStrokeWidth)>0)||t.firstElementChild||n.backgroundImage!=="none"||n.boxShadow!=="none"||Ts(n.backgroundColor)[3]!==0||["Top","Right","Bottom","Left"].some(u=>parseFloat(n[`border${u}Width`])>0)||o.replace(/\([^)]*\)/g,"").includes(","))return;let r=(o.match(/(?:rgba?|hsla?|color|oklch|oklab|lab|lch)\([^)]*\)|#[\da-f]+|\b[a-z]+\b/i)||[])[0],[i=0,s=0,a=0]=(o.match(/-?[\d.]+px/g)||[]).map(parseFloat);if(!r)return;let l=n.filter&&n.filter!=="none"?`${n.filter} `:"";e.style.setProperty("text-shadow","none","important"),e.style.setProperty("filter",`${l}drop-shadow(${i}px ${s}px ${a/2}px ${r})`,"important")}var Nf=/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^()]*\)/g,be;function Ts(t){if(!be){let e=document.createElement("canvas");e.width=e.height=1,be=e.getContext("2d",{willReadFrequently:!0})}return be.clearRect(0,0,1,1),be.fillStyle="transparent",be.fillStyle=t,be.fillRect(0,0,1,1),be.getImageData(0,0,1,1).data}function Lf(t,e){let n=i=>{let s=[];for(let a of(i||"").match(Nf)||[]){let[l,u,c,f]=Ts(a);f>13&&s.push([l,u,c])}return s},o=n(t);if(o.length||(o=n(e)),!o.length)return null;let r=[0,0,0];for(let[i,s,a]of o)r[0]+=i,r[1]+=s,r[2]+=a;return`rgb(${r.map(i=>Math.round(i/o.length)).join(", ")})`}function Ps(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let r of Af){let i=t.getPropertyValue(r);if(i&&i!=="none")return!0}let o=t.getPropertyValue("background");return!!(o&&/url\s*\(/i.test(o))}function If(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function Wf(t,e,n){try{if(typeof t.computedStyleMap=="function"){let r=t.computedStyleMap().get("width");if(r!=null)return!vs(String(r).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!vs(String(o).trim().toLowerCase())?!0:Df(t,e)?n||Bf(t,e):!1}var Of=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function vs(t){return Of.has(t)||t.startsWith("fit-content")}function Df(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let o=1/0,r=-1/0,i=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(i=i||document.createRange(),i.selectNode(s),a=i.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let l=O(s);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.leftr&&(r=a.right)}return r===-1/0?!1:r-o0?Math.abs(t.getBoundingClientRect().width-r)>.5:!1}var Ar=new WeakMap;function zf(t,e){let n=Ar.get(t);if(n)return n;let o=[e];for(let r in t)o.push(r,t[r]);return n=o.join(""),Ar.set(t,n),n}function no(t,e){return t.env===Rt&&t.stamp===to(e,t.hosts)}var Uf=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Hf=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,jf=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Vf(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function Gf(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let o=t.parentElement,r;if(!o)r="R";else if(r=e.ids.get(o),r===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;r="R"}if(e.rootSeen=!0,r===-1)return e.ids.set(t,-1),-1;let i="",s=t.attributes;if(s&&s.length)if(s.length===1)i=s[0].name+"="+s[0].value;else{let l=[];for(let u=0;uu[g])),h&&c.push(""+h),Ar.set(u,f.sig+""+c.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Rr(t);return ce.set(t,{env:r?.__scanEnv??Rt,stamp:to(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function Xf(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:vr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:vr,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:t||e||{}}}var Yf=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Kf=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Jf(t,e,n){if(!t.style||t.style.length===0)return;let o=Ef(t),r=o!=null&&!Yf.test(t.getAttribute("style")||""),i;for(let s=0;sf.snapshot[d]===c)||n.borderWidth===c}if(r&&!o.has(a)&&(!l||i)&&!(a.startsWith("background")&&Kf(t)))continue;let u=n.getPropertyValue(a);u&&(!l||u!==t.style.getPropertyValue(a))&&e.style.setProperty(a,u,t.style.getPropertyPriority(a))}}function xt(t,e,n,o){if(t.tagName==="STYLE")return;let r=Xf(n,o),i=r.options&&r.options.cache||"soft";i!=="disabled"&&Ge(t.ownerDocument),i==="disabled"&&!r.session.__bumpedForDisabled&&(zt(),vr.clear(),r.session.__bumpedForDisabled=!0);let{session:s,persist:a}=r;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let l=s.styleCache.get(t);t.getAttribute?.("style")&&Jf(t,e,l);let u=l.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let c=t.tagName?.toLowerCase()||"div";if(gn.has(c)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Ps(l),enumerable:!1});let b=Rr(t);ce.set(t,{env:Rt,stamp:to(t,b),hosts:b,snapshot:y,embedFonts:!!(r.options&&r.options.embedFonts),excludeStyleProps:r.options&&r.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let f=null;if(r.options&&r.options.__styleShare&&s.styleMap){let y=Vf(s),b=Gf(t,y),w=t.ownerDocument||document,S=w.activeElement;b!==-1&&!jf.has(t.tagName)&&!(S&&S!==w.body&&S!==w.documentElement&&S===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=qf(t,l,r.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important"),(s.bgClipText||=[]).push([t,e])),Y()&&Pf(t,e,l),Qf(t,l,d),e.style?.length&&d["box-sizing"]==="border-box"&&l.getPropertyValue("box-sizing")!=="border-box"&&nu(t,e,d);let h=zs(t);if(ru(t,e,d,h,s),h){let y=l.getPropertyValue("min-width");if(!y||y==="auto"||y==="0px"){d["min-width"]="0px";let b=l.getPropertyValue("overflow-x"),w=t.parentElement;if(y==="auto"&&(b==="visible"||b==="clip")&&w&&O(w).display.includes("flex")){let S=s.flexOverflow||(s.flexOverflow=new WeakMap),v=S.get(w);if(v===void 0){if(v=w.scrollWidth>w.clientWidth,!v){let C=O(w),M=P=>parseFloat(C.getPropertyValue(P))||0,$=M("width")-(C.boxSizing==="border-box"?M("padding-left")+M("padding-right")+M("border-left-width")+M("border-right-width"):0),A=C.flexDirection.startsWith("row")===(C.writingMode==="horizontal-tb")&&C.flexWrap==="nowrap",x=0,_=0;for(let P of w.children){s.styleCache.has(P)||s.styleCache.set(P,getComputedStyle(P));let E=s.styleCache.get(P);if(E.display==="none"||E.position==="absolute"||E.position==="fixed")continue;let R=k=>parseFloat(E.getPropertyValue(k))||0,L=R("width")+R("margin-left")+R("margin-right")+(E.boxSizing==="border-box"?0:R("padding-left")+R("padding-right")+R("border-left-width")+R("border-right-width"));x=A?x+L:Math.max(x,L),_++}v=x+(A?Math.max(0,_-1)*M("column-gap"):0)>$+_/60}S.set(w,v)}v&&(d["min-width"]=d.width)}}}let m=zf(d,c),g=!0;if(Xn(c,(d.display||"").toLowerCase())){g=If(t),g&&yr(c,d,h)&&Wf(t,l,h)&&(g=!1),m=`${m}${g?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";g&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let p=a.snapshotKeyCache.get(m);p===void 0&&(p=Oe(d,c,g,h),a.snapshotKeyCache.size>=Cf&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,p)),s.styleMap.set(e,p)}function Qf(t,e,n){let o=e.getPropertyValue("overflow-x"),r=e.getPropertyValue("overflow-y");if((o==="visible"||!o)&&(r==="visible"||!r)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let i=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-i(e.getPropertyValue("border-left-width"))-i(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-i(e.getPropertyValue("border-top-width"))-i(e.getPropertyValue("border-bottom-width")),l=(u,c)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+c)*1e3)/1e3}px`)};s>=2&&(l("width",s),l("inline-size",s)),a>=2&&(l("height",a),l("block-size",a))}var Is=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Ws=["width","inline-size","height","block-size"];function Zf(t,e,n){if(!Is.some(l=>n[l]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let l of["width","height"]){let u=n[`min-${l}`],c=n[`max-${l}`];if(u&&u!=="0px"&&u!=="auto"||c&&c!=="none")return""}let o=l=>parseFloat(n[l])||0,r=o("padding-left")+o("padding-right")+o("border-left-width")+o("border-right-width"),i=o("padding-top")+o("padding-bottom")+o("border-top-width")+o("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let l of Ws){let u=n[l];if(!u||!u.endsWith("px"))continue;let f=l==="width"||l==="inline-size"&&!s||l==="block-size"&&s?r:i;n[l]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let l=t.scrollWidth<=t.clientWidth;n["overflow-x"]=l?"hidden":"auto",l&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let l=t.scrollHeight<=t.clientHeight;n["overflow-y"]=l?"hidden":"auto",l&&(a+="y")}return a}var tu=["box-sizing",...Ws,"overflow-x","overflow-y"],eu=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function nu(t,e,n){if(eu.test(t.getAttribute("style")))for(let o of tu)e.style.getPropertyValue(o)&&n[o]&&e.style.setProperty(o,n[o],e.style.getPropertyPriority(o))}function ou(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}var Ue=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function ru(t,e,n,o,r){let i=n["text-wrap-mode"]||n["white-space"]||"",s=i==="nowrap"||i==="pre"||Ue==="white-space"&&i!=="normal",a=r.__oneLine||=new WeakSet;if(a.has(t.parentElement)){a.add(t),!s&&e.style&&e.style.setProperty(Ue,"nowrap");return}let l=n.display||"";!o&&!l.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed"||s||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style||iu(t,n,r)&&(a.add(t),e.style.setProperty(Ue,"nowrap"))}function iu(t,e,n){let o=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(o>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let r=t.ownerDocument||document,i=r.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=r.createRange(),a=null,l=0,u=0,c=0;for(let h=i.nextNode();h;h=i.nextNode()){if(h.nodeType===1){if(h.shadowRoot||h.localName==="br"||h.localName==="textarea")return!1;continue}if(/\S/.test(h.data)){if(++u>64)return!1;s.selectNodeContents(h);for(let m of s.getClientRects())if(m.height){if(c++,a||=m,Math.min(a.bottom,m.bottom)-Math.max(a.top,m.top)2||(delete n.height,delete n["block-size"])}Be();var cu=new Set(["symbol","defs"]),fu=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Nr=new WeakMap,Us=-1;function oo(t){let e=Se();return e!==Us&&(Nr=new WeakMap,Us=e),Hs(t)}function Hs(t){let e=Nr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(fu.has(t.localName)?n=!1:cu.has(t.localName)&&(n=!0)),n===void 0){let o=t.parentNode;n=!!(o&&o.nodeType===1)&&Hs(o)}return Nr.set(t,n),n}function js(t,e){if(t?.nodeType!==1||e?.nodeType!==1||oo(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let i=t.attributes;for(let s=0;si.d-s.d);let r=window.devicePixelRatio||1;return(o.find(i=>i.d>=r)||o[o.length-1]).url}function Vs(t,e){let n=t.currentSrc||"";if(n&&!Xe(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let i of o){let s=i.getAttribute("srcset");if(!s||Xe(s))continue;let a=i.getAttribute("type");if(a&&!ir.test(a.trim()))continue;let l=i.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Ye(s,t)}catch{}r||(r=Ye(s,t))}return r}function Gs(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!Xe(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!Xe(o))return o}return null}At();dt();function uu(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var du=/::[a-zA-Z-]+(?:\([^)]*\))?$|(?r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")&&r.includes("data-sd")||r.startsWith("@"))return r;let i=r.match(du);if(i&&pu.test(i[0]))return":not(*)";let s=i?r.slice(0,i.index).trim():r,a=n?uu(s,o):s;return`:where(${e} ${a})${i?i[0]:""}`}).join(", ")}function Ks(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(o,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(o,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(o,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(o,r,i,s)=>{let a=hu(s,e,!0,n);return`${r}${i}${a}{`}),t):""}function Js(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Ce(t){let e="";for(let n of t)if(n.media&&n.cssRules){let o=!1;try{o=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}o&&(e+=Ce(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${Ce(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let o=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=o+(n.style?n.style.cssText:"")+Ce(n.cssRules)+"}"}else e+=n.cssText+` +`;return e}function Qs(t){let e="";try{t.querySelectorAll("style").forEach(o=>{let r=null;try{r=o.sheet&&o.sheet.cssRules}catch{}e+=(r?Ce(r):o.textContent||"")+` +`});let n=t.adoptedStyleSheets||[];for(let o of n)try{o&&o.cssRules&&(e+=Ce(o.cssRules))}catch{}}catch{}return e}function Zs(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function ta(t,e,n={}){try{let o=null,r=O(t).content;if(r&&r.includes("url(")){let u=r.match(/url\(["']?([^"')]+)["']?\)/);u&&(o=u[1])}let i=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",l=o||(i?Vs(t,i):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Ye(a,t)||t.src||"";if((!l||Xe(l))&&n.resolvePicturePlaceholders!==!1){let u=Gs(t);u&&(l=u)}if(!l)return;e.getAttribute("src")!==l&&e.setAttribute("src",l),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function ea(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function mu(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function na(t,e,n){let o=[];for(let r of e){let i=mu(t,r);i&&o.push(`${r}: ${i};`)}return o.length?`${n}{${o.join("")}} +`:""}function oa(t,e){if(!t)return;let n=o=>{let r=o.getAttribute("data-sd-slotted")||"";e?` ${r} `.includes(` ${e} `)||o.setAttribute("data-sd-slotted",r?`${r} ${e}`:e):o.setAttribute("data-sd-slotted",r)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function gu(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;rsetTimeout(i,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function yu(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,i=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,o=parseFloat(l.borderRightWidth)||0,r=parseFloat(l.borderTopWidth)||0,i=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(r+i)));return{contentWidth:s,contentHeight:a,rect:e}}function Ft(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let o=getComputedStyle(t);if(e===0){let r=parseFloat(o.width);!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(o.height);!isNaN(r)&&r>0&&(n=r)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}var qs=new WeakMap;function bu(t,e,n){let o=t.defaultView,r=o?o.scrollX:0,i=o?o.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,c=0,f=0,d=0,h=0;try{let p=o&&t.body?o.getComputedStyle(t.body):null;p&&(c=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),f=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${f}px ${d}px ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,g;try{let p=qs.get(t);p||qs.set(t,p=new o.CSSStyleSheet),p.replaceSync(m),t.adoptedStyleSheets=[...t.adoptedStyleSheets,p],g=()=>{t.adoptedStyleSheets=t.adoptedStyleSheets.filter(y=>y!==p)}}catch{let p=t.createElement("style");p.setAttribute("data-sd-iframe-pin",""),tt(p),p.textContent=m,(t.head||t.documentElement).appendChild(p),g=()=>p.remove()}if(ve(t.documentElement),r||i)try{t.body&&(t.body.scrollLeft=r,t.body.scrollTop=i),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=r),t.documentElement.scrollTop||(t.documentElement.scrollTop=i))}catch{}return()=>{try{g()}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(r,i),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}ve(t.documentElement)}}async function Lr(t,e,n){let o=await gu(t,3);if(!o)throw new Error("The iframe document isn't ready.");let{contentWidth:r,contentHeight:i,rect:s}=yu(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let l={...n,scale:1,clip:null,__pinned:!0},u=bu(o,r,i),c;try{c=await a.toPng(o.documentElement,l)}finally{u()}c.style.display="block",c.style.width=`${r}px`,c.style.height=`${i}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),xt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(c),f}function ra(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function ia(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Number.isFinite(i)&&i>0?i:e||o.width||128,l=Number.isFinite(s)&&s>0?s:n||o.height||16,u=Number.parseFloat(t.min)||0,c=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=c-u,h=d>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/d)):.5,m="middle";try{r&&r.verticalAlign&&(m=r.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement","range"),g.style.cssText=`display:inline-block;width:${a}px;height:${l}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",String(a)),p.setAttribute("height",String(l)),p.setAttribute("viewBox",`0 0 ${a} ${l}`),p.style.cssText=`width:${a}px;height:${l}px;overflow:visible`,g.appendChild(p);function y(){let b=ra(r),w=!!t.disabled,S=Math.max(2,Math.min(4,l)),v=(l-S)/2,C=Math.max(10,Math.min(14,Math.max(l,10))),M=C/2,$=M+h*Math.max(0,a-C);p.innerHTML="";let F=(x,_,P,E)=>{let R=document.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("x",String(x)),R.setAttribute("y",String(v)),R.setAttribute("width",String(Math.max(0,_))),R.setAttribute("height",String(S)),R.setAttribute("rx",String(S/2)),R.setAttribute("fill",P),E&&R.setAttribute("fill-opacity",E),p.appendChild(R)};F(0,a,"#808080","0.4"),F(0,$,b);let A=document.createElementNS("http://www.w3.org/2000/svg","circle");A.setAttribute("cx",String($)),A.setAttribute("cy",String(l/2)),A.setAttribute("r",String(M)),A.setAttribute("fill",b),p.appendChild(A),w&&p.setAttribute("opacity","0.5"),g.style.setProperty("width",`${a}px`,"important"),g.style.setProperty("height",`${l}px`,"important"),g.style.setProperty("min-width",`${a}px`,"important"),g.style.setProperty("min-height",`${l}px`,"important")}return y(),{el:g,applyVisual:y}}function sa(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Math.round(e||o.width||0),l=Math.round(n||o.height||0),u=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,a||16),c=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,g=Math.max(Math.min(u,c),12),p=Math.max(u,g),y=Math.max(c,g),b="middle";try{r&&r.verticalAlign&&(b=r.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${p}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("width",String(p)),S.setAttribute("height",String(y)),S.setAttribute("viewBox",`0 0 ${g} ${g}`),S.style.cssText=`width:${p}px;height:${y}px`,w.appendChild(S);function v(){let C=ra(r),M=2,$=M/2,F=g-M;if(S.innerHTML="",f){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String($)),A.setAttribute("y",String($)),A.setAttribute("width",String(F)),A.setAttribute("height",String(F)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${$+2} ${g/2} L ${g/2-1} ${g-$-2} L ${g-$-2} ${$+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,M))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),S.appendChild(x)}else if(h){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),_=Math.max(6,F-4);x.setAttribute("x",String((g-_)/2)),x.setAttribute("y",String((g-M)/2)),x.setAttribute("width",String(_)),x.setAttribute("height",String(M)),x.setAttribute("fill",C),x.setAttribute("rx","1"),S.appendChild(x)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(g/2)),A.setAttribute("cy",String(g/2)),A.setAttribute("r",String((g-M)/2)),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),_=Math.max(2,(g-M*2)*.35);x.setAttribute("cx",String(g/2)),x.setAttribute("cy",String(g/2)),x.setAttribute("r",String(_)),x.setAttribute("fill","white"),S.appendChild(x)}}w.style.setProperty("width",`${p}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${p}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return v(),{el:w,applyVisual:v}}var An=new gt(80);async function wu(t){if(j.resource?.has(t))return j.resource.get(t);if(An.has(t))return An.get(t);let e=(async()=>{let n=await ut(t,{as:"dataURL"});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return j.resource?.set(t,n.data),n.data})();An.set(t,e);try{let n=await e;return An.set(t,n),n}catch(n){throw An.delete(t),n}}var Xs=/\bblob:[^)"'\s]+/g;function ro(t){return typeof t=="string"&&t.startsWith("blob:")}function xu(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Su(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function _n(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function io(t,e=null){if(!t)return;let n=e,o=new Set,r=[],i=new Map,s=(g,p,y,b)=>{o.add(y),r.push(()=>{i.has(y)&&(g.setAttribute(p,i.get(y)),b?.())})},a=(g,p)=>{if(!g||!g.includes("blob:"))return;let y=g.match(Xs)||[];if(y.length){for(let b of y)o.add(b);r.push(()=>{let b=g.replace(Xs,w=>i.get(w)||w);b!==g&&p(b)})}},l=_n(t,"img");for(let g of l)try{let y=g.getAttribute("src")||g.currentSrc||"";ro(y)&&s(g,"src",y);let b=g.getAttribute("srcset");if(b&&b.includes("blob:")){let w=xu(b);for(let S of w)ro(S.url)&&o.add(S.url);r.push(()=>{let S=!1;for(let v of w)i.has(v.url)&&(v.url=i.get(v.url),S=!0);S&&g.setAttribute("srcset",Su(w))})}}catch(p){D(n,"Couldn't inline a blob: image.",p)}let u=_n(t,"image");for(let g of u)try{let p="http://www.w3.org/1999/xlink",y=g.getAttribute("href")||g.getAttributeNS?.(p,"href");ro(y)&&s(g,"href",y,()=>g.removeAttributeNS?.(p,"href"))}catch(p){D(n,"Couldn't inline a blob: SVG image.",p)}let c=_n(t,"[style*='blob:']");for(let g of c)try{let p=g.getAttribute("style");a(p,y=>g.setAttribute("style",y))}catch(p){D(n,"Couldn't inline blob: URLs in a style attribute.",p)}let f=_n(t,"style");for(let g of f)try{let p=g.textContent||"";a(p,y=>{g.textContent=y})}catch(p){D(n,"Couldn't inline blob: URLs in a ");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,r=[],i=n,s;for(o.lastIndex=n;s=o.exec(t);)r.push({text:t.slice(i,s.index),intern:!0}),r.push({text:s[0],intern:!1}),i=o.lastIndex;r.push({text:t.slice(i),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of r)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=fh(e,r.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},p="";for(let y of r)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function fh(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let r=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(r),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(r)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let i=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&i.add(u[1])}return i}async function Bo(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:r,rootTransform2D:i,fontsCSS:s,universe:a}=e,l=t.options;if(t!==l){let{options:K,...Q}=t;t=Object.assign(l,Q),Object.defineProperty(t,"options",{value:t,configurable:!0})}let u,c;Ao(t,s,a),await Zt("beforeRender",t);let f=O(t.element),d=t.element.getBoundingClientRect(),h=Math.max(1,H(t.element.offsetWidth||parseFloat(f.width)||d.width||1)),m=Math.max(1,H(t.element.offsetHeight||parseFloat(f.height)||d.height||1)),g=t.element.ownerDocument||document,p=!n&&(t.element===g.body||t.element===g.documentElement)&&!t.__pinned,y=null,b=null,w=0;if(p){let K=Math.max(t.element.scrollHeight||0,g.documentElement?.scrollHeight||0,g.body?.scrollHeight||0),Q=Math.max(t.element.scrollWidth||0,g.documentElement?.scrollWidth||0,g.body?.scrollWidth||0),ot=Math.max(h,H(Q)),it=t.element===g.body,$t=it&&O(g.documentElement).direction==="rtl",mt=J=>{J>0&&($t?w=Math.max(w,H(J-d.width)):h=Math.max(h,H(J)))};if(it&&g.documentElement){let J=g.documentElement.getBoundingClientRect(),ct={top:Math.max(0,d.top-J.top),right:Math.max(0,J.right-d.right),bottom:Math.max(0,J.bottom-d.bottom),left:Math.max(0,d.left-J.left)};if(y=ct,r!=="subtree"&&(ct.top||ct.right||ct.bottom||ct.left)){let bt=t.__session?.styleMap,dn=new Map,Un=new Map;for(let[oe,Ot]of t.nodeMap){let Dt=bt?.get(oe);if(Dt){let or=dn.get(Dt);if(or===void 0&&dn.set(Dt,or=lh.test(Dt)),!or)continue}Un.set(oe,Ot)}let qt=Zr(t.element,Un,t.styleCache,d.width>0?h/d.width:1,d.height>0?m/d.height:1);b={top:Math.min(qt.top,ct.top),right:Math.min(qt.right,ct.right),bottom:Math.min(qt.bottom,ct.bottom),left:Math.min(qt.left,ct.left)}}K=Math.max(t.element.scrollHeight||0,sn(K,J.height,d.top-J.top,d.bottom-J.top)),Q=Math.max(t.element.scrollWidth||0,$t?sn(Q,J.width,J.right-d.right,J.right-d.left):sn(Q,J.width,d.left-J.left,d.right-J.left))}K>0&&(m=Math.max(m,H(K))),mt(Q);try{let J=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,ct=j.measureHints.get(t.element);if(ct&&ct.cssLen===J&&ct.w0===ot&&ct.docH===K&&ct.docW===Q)ct.csh>0&&(m=Math.max(m,H(ct.csh))),mt(ct.csw);else{let bt=g.createElement("div");tt(bt),bt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+ot+"px!important;overflow:visible!important;visibility:hidden!important;";let dn=bt.attachShadow({mode:"open"});Nn(dn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let Un=dn.appendChild(ii(t.clone));g.body.appendChild(bt);let qt=bt.scrollHeight,oe=bt.scrollWidth;if(it){let Ot=bt.getBoundingClientRect(),Dt=Un.getBoundingClientRect();qt=sn(qt,Ot.height,Dt.top-Ot.top,Dt.bottom-Ot.top),oe=$t?sn(oe,Ot.width,Ot.right-Dt.right,Ot.right-Dt.left):sn(oe,Ot.width,Dt.left-Ot.left,Dt.right-Ot.left)}g.body.removeChild(bt),j.measureHints.set(t.element,{cssLen:J,w0:ot,docH:K,docW:Q,csh:qt,csw:oe}),qt>0&&(m=Math.max(m,H(qt))),mt(oe)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=ri(t.element,t.options),Q=1,ot=ri(t.element,{}),it=Math.max(2,m*.15);Number.isFinite(ot)&&ot>=m-it&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,H(K+Q))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;cl(t.element,t.clone,K,t.nodeMap,h,m)}catch(K){nt(t.options.__session,"reconcile-failed","reconcile pass failed",K),D(t.options,"reconcile couldn't run; captured without it.",K)}let S=(K,Q=NaN)=>{let ot=typeof K=="string"?parseFloat(K):K;return Number.isFinite(ot)?ot:Q},v=S(t.options.width),C=S(t.options.height),M=n?H(n.width):h,T=n?H(n.height):m,F=M,A=T,x=Number.isFinite(v),_=Number.isFinite(C),P=T>0?M/T:1;x&&_?(F=Math.max(1,H(v)),A=Math.max(1,H(C))):x?(F=Math.max(1,H(v)),A=Math.max(1,H(F/(P||1)))):_&&(A=Math.max(1,H(C)),F=Math.max(1,H(A*(P||1))));let E=0,R=0,L=h,k=m;if(n){let K=0,Q=0;if(hi(t.element)){let it=null;if(!o&&i&&Number.isFinite(i.a))it={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0};else{let $t=ke(t.element),mt=oi(f.transform&&f.transform!=="none"?f.transform:"",$t);mt&&mt.is2D&&(it={a:mt.a,b:mt.b,c:mt.c,d:mt.d,e:0,f:0})}if(it&&!(it.a===1&&it.b===0&&it.c===0&&it.d===1)){let{ox:$t,oy:mt}=Tn(f,h,m),J=Ze(h,m,it,$t,mt);K=J.minX,Q=J.minY}}let ot=Y()?0:(l.dpr||1)*(x||_?F/M:l.scale||1);E=H(ot?Math.round((n.x+K)*ot)/ot:n.x+K),R=H(ot?Math.round((n.y+Q)*ot)/ot:n.y+Q),L=H(E+n.width),k=H(R+n.height)}else if(!o&&i&&Number.isFinite(i.a)){let K={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0},Q=Ze(h,m,K,0,0);E=H(Q.minX),R=H(Q.minY),L=H(Q.maxX),k=H(Q.maxY)}else if(o&&hi(t.element)){let Q=f.transform&&f.transform!=="none"?f.transform:"",ot=ke(t.element),it=de({baseTransform:Q,rotate:ot.rotate||"0deg",scale:ot.scale,translate:ot.translate,width:h,height:m}),{ox:$t,oy:mt}=Tn(f,h,m),J=it.is2D?it:new DOMMatrix(it.toString()),ct={a:J.a,b:J.b,c:J.c,d:J.d,e:0,f:0},bt=Ze(h,m,ct,$t,mt);E=H(bt.minX),R=H(bt.minY),L=H(bt.maxX),k=H(bt.maxY)}let I=Xr(f),W=Yr(f),$=Kr(f),N=Jr(f),U=Qr(f),z=d.width>0?(L-E)/d.width:1,V=d.height>0?(k-R)/d.height:1,B=r==="subtree"&&!n?Zr(t.element,t.nodeMap,t.styleCache,z,V):{top:0,right:0,bottom:0,left:0};b&&(B={top:b.top,right:Math.max(0,b.right-(h-d.width)),bottom:Math.max(0,b.bottom-(m-d.height)),left:b.left}),w>0&&(B={...B,left:Math.max(B.left,w)});let rt=n?{top:0,right:0,bottom:0,left:0}:r?{top:H(Math.max(I.top,W.top,B.top)+$.top+N.top+U.bleed.top),right:H(Math.max(I.right,W.right,B.right)+$.right+N.right+U.bleed.right),bottom:H(Math.max(I.bottom,W.bottom,B.bottom)+$.bottom+N.bottom+U.bleed.bottom),left:H(Math.max(I.left,W.left,B.left)+$.left+N.left+U.bleed.left)}:{top:H($.top+B.top),right:H($.right+B.right),bottom:H($.bottom+B.bottom),left:H($.left+B.left)};E=H(E-rt.left),R=H(R-rt.top),L=H(L+rt.right),k=H(k+rt.bottom);let at=Math.max(1,H(L-E)),pt=Math.max(1,H(k-R)),St="http://www.w3.org/2000/svg",ee=hi(t.element)?2:0,It=H(ee+(o?0:1)),Te=l.__subpixel?.x||0,q=l.__subpixel?.y||0,X=Math.ceil(at+It*2+Te),G=Math.ceil(pt+It*2+q),ht=H(-(H(E)-It)),Z=H(-(H(R)-It)),Bn=g.defaultView||window,lt=!Y()&&CSS.supports("zoom","2")?uh(Bn):1;l.__layoutZoom=lt;let un=n&&!Y(),ne=un?H(ht-Math.floor(ht*lt+.01)/lt):0,Tt=un?H(Z-Math.floor(Z*lt+.01)/lt):0,$e=Math.min(0,ht-ne)-(ne?1/lt:0),Vt=Math.min(0,Z-Tt)-(Tt?1/lt:0),me=ht-ne-$e+Te,Pe=Z-Tt-Vt+q,Ne=H(X-$e),Gt=H(G-Vt),Wt=document.createElementNS(St,"foreignObject");Wt.setAttribute("x",String($e*lt)),Wt.setAttribute("y",String(Vt*lt)),Wt.setAttribute("width",String(Ne*lt)),Wt.setAttribute("height",String(Gt*lt)),Wt.style.overflow="visible";let Ui=document.createElement("style"),Nc="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Ui.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Nc+t.classCSS,Wt.appendChild(Ui);let Le=document.createElement("div");Le.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Le.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${l.__subpixel?H(me+d.width):Ne}px;height:${Gt}px`+(me!==0||Pe!==0?`;padding:${Pe}px 0 0 ${me}px !important`:"")+(lt!==1?`;zoom:${lt} !important`:"")+";direction:ltr !important"+(y?ah(g):""),y&&(me!==y.left||Pe!==y.top)&&t.__session&&nl(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,me-y.left,Pe-y.top),Le.appendChild(t.clone),Wt.appendChild(Le);let Hi=new XMLSerializer,Lc=Hi.serializeToString(Wt),ji=x||_,Ic=Object.freeze({w0:M,h0:T,vbW:X,vbH:G,targetW:F,targetH:A,contentX:H(ht+(n?E:0)),contentY:H(Z+(n?R:0)),clip:n?Object.freeze({x:H(E),y:H(R),width:M,height:T}):null});Object.defineProperty(l,"meta",{value:Ic,enumerable:!0,writable:!1,configurable:!0});let Wc=!ji||Y()?X:x?F:H(X*(A/G)),Oc=!ji||Y()?G:_?A:H(G*(F/X)),Dc=parseFloat(O(g.documentElement)?.fontSize)||16,er=[ne||Tt?`translate(${ne} ${Tt})`:"",lt!==1?`scale(${1/lt})`:""].join(" ").trim(),zn=`${er?``:""}`,Vi=er?"":"";if(c=zn+ch(Lc,Wt)+Vi,l.__fileSvg=null,lt!==1){let K=mt=>{let J=Hi.serializeToString(mt.cloneNode(!1));return J.slice(0,J.indexOf(">")+1).replace(/\/>$/,">")},Q=Wt.cloneNode(!1);Q.setAttribute("x",String($e)),Q.setAttribute("y",String(Vt)),Q.setAttribute("width",String(Ne)),Q.setAttribute("height",String(Gt));let ot=Le.cloneNode(!1);ot.style.removeProperty("zoom");let it=ne||Tt?`translate(${ne} ${Tt})`:"",$t=zn.slice(0,zn.indexOf(">")+1)+(it?``:"");l.__fileSvg={zoomed:[zn+K(Wt),K(Le),Vi],flat:[$t+K(Q),K(ot),it?"":""]}}u=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,t.svgString=c,t.dataURL=u,l.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Zt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let nr=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);return nr&&nr.style.position==="absolute"&&nr.remove(),t.dataURL}function hi(t){return Qa(t)}function uh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let r=n.createElement("div");tt(r),r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(r);let i=parseFloat(t.getComputedStyle(r).borderTopWidth);r.remove(),i>=1&&(o=1)}catch{}return o}Me();$n();function hh(t){let e=Array.isArray(t.plugins)?t.plugins:ui(),n=[];for(let o of e){let r=rn(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}async function Wl(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=li(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=hh(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,r,i,s,a,l,u,c,f,d="",h=null,m=e.needs||kt,g=n.format,p=n.type;await Zt("beforeSnap",n);let y=n.format!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),b=n.type!==p&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(y||b){let E=String(y?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Zt("beforeClone",n);let w=n.outerTransforms!==!1,S=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,v=n.clip?ko(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Es(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let C=hs(e.fast);for(;;){e.__slicer=C;let E=$o(n.element,v);try{({clone:o,classCSS:r,classPrefixCSS:i,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c,universe:f}=await ul(n.element,n.options)),l>0&&!e.reconcile&&(nt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,D(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!w&&o&&(h=Ja(n.element,o)),!S&&o&&rl(n.element,o,n.options),o&&(al(n.element,o,a,c),il(n.element,o))}finally{E()}if(!C?.yielded||!e.__tornSinceStart?.())break;C=null,e.__session=li(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=r,n.styleCache=s,n.nodeMap=a,await Zt("afterClone",n),!nn(m,"render"))return null;if(C?.due()&&await C.pause(),Mo(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{ll(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){nt(e.__session,"shrink-failed","shrink pass failed",E),D(e,"Couldn't close the gaps left by removed elements.",E)}try{await fo(n.clone,n.element,n.nodeMap)}catch{}try{let E=e.__session?.styleMap;E&&uo(E.keys(),E,n.nodeMap,n.options.__iconMatchers)}catch{}let M=E=>Promise.resolve().then(E),T=(async()=>{await Promise.all([M(()=>Eo(n.clone,n.options)),M(()=>Fo(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{hl(n.element,n.clone,n.nodeMap)}catch(E){nt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),D(e,"Couldn't reproduce a backdrop-filter; captured without it.",E)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=h,await M(()=>Do(n.clone,n.options,n.nodeMap))),e.captureSelection)try{fa(n.nodeMap)}catch(E){nt(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=M(async()=>{let E=n.element.ownerDocument||document,R=v?$=>{try{let N=$.getBoundingClientRect();return N.right>=v.left-200&&N.left<=v.right+200&&N.bottom>=v.top-200&&N.top<=v.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:k}=!v&&e.__fontUsage||wo(n.element,R),I=L,W=L;if(e.embedFonts==="auto"){let{declared:$,drawn:N}=bo(E),U=z=>Rn(z).toLowerCase();if(I=new Set(Array.from(L).filter(z=>N.has(U(z)))),!I.size)return;W=new Set(Array.from(L).filter(z=>N.has(U(z))||!$.has(U(z))))}Y()&&await xo(I,k,E),d=await Pa({required:W,usedCodepoints:k,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E,debug:n.options.debug})})),await Promise.all([T,F]);let x=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!x){let{tryCanvasEngine:E}=await Promise.resolve().then(()=>(Il(),Ll));Ao(n,d,f);let R=await E(n,n.options);if(R)return R}C?.due()&&await C.pause();let _=n.clone;Oo(_,e.__compressedAssets);let P=await Bo(n,{clipWindow:u,outerTransforms:w,outerShadows:S,rootTransform2D:h,fontsCSS:d,universe:f});if(e.__compressedSnapshot=Wo(_,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:i,fontsCSS:d,clipWindow:u,outerTransforms:w,outerShadows:S,rootTransform2D:h,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return P}Mt();vt();wt();var mh=new Set(["png","jpeg","jpg","webp","svg"]);function Ol(t={}){let e=typeof t.type=="string"&&mh.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,r=Gi(t.cache),i=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of i)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{D(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&D(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ft(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Ca(t.iconFonts,t),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:r,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:o,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}dt();wt();Et();Me();var Dl="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function gh(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var yh=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function bh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(yh.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function wh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(i=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(i.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let r of o){let i=getComputedStyle(r),s=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var xh=1/16;function Sh(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=xh}var zo=new Map,vh=["width","height","min-width","min-height"];function Ch(t){let e=zo.get(t);if(e===void 0){e=null;for(let n of vh){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}zo.size>5e3&&zo.clear(),zo.set(t,e)}return e}function kh(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Mh(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let r=e.nodeMap.get(o);r!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(r)===o&&e.srcToClone.delete(r)),e.styleMap.delete(o)}for(let r=o.firstChild;r;r=r.nextSibling)n.push(r)}}var mi={attempts:0,served:0,reconciled:0};async function Bl(t,e,n){mi.attempts++;try{let o=await Ah(t,e,n);return o&&mi.served++,o}catch{return null}}async function Ah(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||gh(t)||bh(o)||o.fontsCSS||No(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let r=t.ownerDocument||document,i=Ge(t);if(!i||_s(r))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Dl)||d.querySelector?.(Dl)||wh(d,i))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=$o(d,null),y=Co(d),b;try{b=await ue(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Qe(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await ro(b,g),Mo(b);try{await fo(b,d,m)}catch{}try{uo([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([Eo(b,n),Fo(d,b,o.styleCache,n,m)]),n.compress)try{await Do(b,n,m)}catch{}for(let[w,S]of m.entries())ai(w,S,m,o.styleCache);h.replaceWith(b),Mh(h,o);for(let[w,S]of m.entries())o.nodeMap.set(w,S),o.srcToClone.set(S,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=Ch(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let S=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(S+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((v,C)=>v+(parseFloat(p.getPropertyValue(C))||0),0)),w=`${S}px`}if(!Sh(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),mi.reconciled++,await xt(h,d,a,n)}}let u=gn(o.styleMap);for(let[d,h]of o.styleMap.entries())kh(d),si(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");if(Ge(t)!==i)return null;Oo(o.clone,n.__compressedAssets);let f=await Bo({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||"",universe:i});return n.__compressedSnapshot=Wo(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}vt();dt();var yi=new WeakMap,Ho=new WeakMap,Jl=new WeakSet,gi=new WeakMap,_h=64,In=new Map,Ql=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Eh=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Rh(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Eh.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function zl(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Bt(n)||null}return e.join("|")}function Ul(t,e){if(e.disposed||(In.delete(t),In.set(t,e),In.size<=_h))return;let[n,o]=In.entries().next().value;Zl(n,o)}function Zl(t,e){e.disposed=!0,In.delete(t),yi.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Ql)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of wi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function tc(t){if(Jl.has(t))return!1;Ho.delete(t);let e=[t],n=[],o=[];for(let r=0;r=0&&e.observers.splice(s,1)}for(let r of o)if(!e.trackedShadowRoots.has(r))try{let i=new MutationObserver(e.markDirty);i.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),i.__flush=e.markDirty,e.observers.push(i),e.trackedShadowRoots.set(r,i);for(let s of wi)r.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var wi=["scroll","change","beforetoggle","toggle"];function jo(t,e){return[t,...e.trackedShadowRoots.keys()]}function xi(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of jo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[r,i]of e.trackedImages)o.has(r)||(r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let r=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",r),o.removeEventListener("error",r),e.trackedImages.delete(o)};e.trackedImages.set(o,r),o.addEventListener("load",r),o.addEventListener("error",r)}}function Hl(t){let e=new Map,n=new Map,o=new Map;for(let r of t)if(xe(r))if(r.type==="attributes"){let i=e.get(r.target);i||e.set(r.target,i=new Map),i.has(r.attributeName)||i.set(r.attributeName,r.oldValue)}else if(r.type==="characterData")n.has(r.target)||n.set(r.target,r.oldValue);else if(r.type==="childList"){let i=o.get(r.target);i||o.set(r.target,i=new Map);for(let s of r.addedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)+1)}for(let s of r.removedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)-1)}}else return!0;for(let[r,i]of e)for(let[s,a]of i)if(r.getAttribute(s)!==a)return!0;for(let[r,i]of n)if(r.data!==i)return!0;for(let r of o.values())for(let i of r.values())if(i!==0)return!0;return!1}var Fh=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,ln=t=>t&&(typeof t=="object"||typeof t=="function")?Uo(t):"-";function Th(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),r=t.slice(n+1);try{if(/;base64/i.test(o)){let i=Math.ceil(e/3)*4;return atob(r.slice(0,i-i%4))}return r.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(i,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function $h(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Th(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function jl(t){let e=String(t||"").trim();return e?Fh.test(e)?!0:/^data:/i.test(e)?$h(e):!1:!1}function cn(t){let e=String(t||"");if(jl(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(jl(n[1]??n[2]??n[3]))return!0;return!1}function Vl(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(r=>t.srcToClone?.get(r)).filter(Boolean):[n];for(let r of o)for(let i of ec(r))if(cn(i.getAttribute?.("src"))||cn(i.getAttribute?.("href"))||cn(i.getAttribute?.("style"))||cn(t.styleMap?.get(i)))return!0;return!1}function ec(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Si(t,e){let n=[],o=new Set,r=i=>{i&&!o.has(i)&&(o.add(i),n.push(i))};t.matches?.("input,textarea,select,option")&&r(t);for(let i of jo(t,e))try{for(let s of i.querySelectorAll("input,textarea,select,option"))r(s)}catch{}e.controls=n}function vi(t,e){let n=[],o=new Set,r=(i,s=!1)=>{if(!(!i||o.has(i))){o.add(i);try{(s||i.scrollLeft||i.scrollTop||i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&n.push(i)}catch{}}};for(let i=t;i;i=i.parentElement)r(i,!0);for(let i of jo(t,e))for(let s of ec(i))r(s);e.scrollNodes=n}function Gl(t,e){let n=t.ownerDocument||document,o=n.defaultView,r=[o?.location?.hash||"",Rh(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{r.push(...[...n.adoptedStyleSheets||[]].map(ln))}catch{}for(let c of e.trackedShadowRoots.keys())try{r.push("#shadow",...[...c.adoptedStyleSheets||[]].map(ln))}catch{}let i=n.activeElement,s=n.fullscreenElement;(i?.contains(t)||t.contains(i))&&r.push(ln(i)),(s?.contains(t)||t.contains(s))&&r.push(ln(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,hn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:r.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function an(t,e,n){if(!t)return!1;let o=t[n],r=e[n];if(o===r)return!0;if(!Array.isArray(o)||o.length!==r.length)return!1;for(let i=0;i[ln(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Ph(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Nh(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:He(),styleEpoch:Se(),styleStamp:kn(t),outsideMutations:Cn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},r=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)xe(l)&&(e.dirty=!0,o(l.target))},i=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(r);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=r,e.observers.push(a)}catch{}e.markDirty=r,e.onMediaDirty=i;try{for(let a of Ql)t.addEventListener(a,i,{capture:!0,passive:!0})}catch{}return bi(t,e)||Si(t,e),vi(t,e),xi(t,e),e}var Lh=0,Yl=new WeakMap;function Uo(t){let e=Yl.get(t);return e||(e="@"+ ++Lh,Yl.set(t,e)),e}function Ci(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(Uo(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Uo(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let i=[];for(let s of t){let a=Ci(s,e);if(a===null)return null;i.push(a)}return"["+i.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Uo(t));let r=[];for(let i of Object.keys(t).sort()){let s=t[i];if(s===void 0)continue;let a=Ci(s,e);if(a===null)return null;r.push(JSON.stringify(i)+":"+a)}return"{"+r.join(",")+"}"}finally{e.delete(t)}}function Kl(t,e){let{burst:n,invalidate:o,...r}=t||{};try{let i=Ci(r,new Set);return i===null?null:`${(e||[]).map(ln).join(",")}:${i}`}catch{return null}}function nc(t,e,n,o,r=null){let i=yi.get(t);i||(i=Nh(t),i.baselineSignature=Kl(e,n.plugins),yi.set(t,i));let s=Kl(e,n.plugins),a=async()=>{if(await Xn(),i.disposed)return o();let u=s===null||s!==i.baselineSignature;u&&s!==null?i.pendingSig===s?(i.baselineSignature=s,i.last=null,i.dirty=!0,i.dirtyRoots=null,i.pendingSig=null,u=!1):i.pendingSig=s:i.pendingSig=null,bi(t,i),xi(t,i);for(let M of i.observers)M.__flush(M.takeRecords());Ut();let c=Cn(t);i.dirty&&i.outsideMutations!==c&&i.dirtyAll(),i.outsideMutations=c;let f=t.getRootNode?.(),d=[...i.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),to(t.ownerDocument||document,d);let h=kn(t);i.styleStamp!==h&&(i.styleStamp=h,i.dirty||i.dirtyAll());let m=Gl(t,i),g=ql(t,i);m.animation=Xl(g),i.renderState&&(!an(i.renderState,m,"style")&&(je(),i.dirtyAll()),an(i.renderState,m,"scroll")||i.dirtyAll(),an(i.renderState,m,"controls")||(ve(t),i.dirtyAll()),!an(i.renderState,m,"images")&&!i.dirty&&i.dirtyAll());let p=He();i.envEpoch!==p&&(i.dirtyAll(),i.envEpoch=p);let y=Se();if(i.styleEpoch!==y&&(i.styleEpoch=y,!i.dirty)){let M=zl(t);i.geometry!==null&&M!==i.geometry&&(ve(t),i.dirtyAll()),i.geometry=M}n.invalidate&&i.dirtyAll();let b=!1,w=!!i.renderState&&!an(i.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let T of g){let F=T.playState==="running";if(!F&&!w)continue;F&&(b=!0),w=!0;let A=T.effect?.target;if(Ph(t,i,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&i.retained){i.dirty=!0;for(let T of M)i.dirtyRoots&&i.dirtyRoots.add(T),ve(T)}else w&&!M&&i.dirtyAll()}catch{}let S=m.frameDriven,v=b||S;if(v&&(i.last=null),S&&i.dirtyAll(),!u&&!v&&!i.dirty&&i.last)return Ul(t,i),i.last;i.capturing=!0;let C=null;try{let M=null,T=!1,F=null;if(!u&&i.dirty&&i.retained&&i.dirtyRoots&&i.dirtyRoots.size&&r){F=[...i.dirtyRoots];let A=await Bl(t,i,n);A&&(M=await r(A),T=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[_,P]of A.nodeMap.entries())x.set(P,_);C={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of i.observers)for(let x of A.takeRecords())i.pending.push(x);return Ut(),i.torn||Hl(i.pending)||Cn(t)!==c},M=await o()),!u&&!i.disposed){i.dirty=!1,i.dirtyRoots=new Set,C?(i.retained=C,i.retainedFrameDriven=Vl(C),Si(t,i),vi(t,i)):T&&(i.retainedFrameDriven||=Vl(i.retained,F),Si(t,i),vi(t,i));let A=Gl(t,i);A.animation=Xl(ql(t,i));let x=["style","scroll","controls","images"];b||x.push("animation");let _=x.every(P=>an(m,A,P));i.renderState=A,i.styleEpoch=Se(),i.styleStamp=kn(t),i.geometry=zl(t),i.renderState.frameDriven?(Jl.add(t),Zl(t,i)):_?!v&&!i.renderState.frameDriven&&(i.last=M,Ul(t,i)):(i.dirtyAll(),i.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let T of i.observers)for(let F of T.takeRecords())i.pending.push(F);Ut();let M=Cn(t);(i.torn||Hl(i.pending)||M!==c)&&(i.dirtyAll(),i.last=null),i.outsideMutations=M,i.styleEpoch=Se(),i.styleStamp=kn(t),i.pending.length=0,i.torn=!1,i.capturing=!1,i.disposed||(bi(t,i),xi(t,i))}},l=i.inflight.then(a,a);return i.inflight=l.catch(()=>{}),l}var Vo=null;function ic(t){Vo=t}var Ih='button, a[href], [role="button"], input, select, summary, label, [tabindex]',ki=!1,Wn=null,Mi=new WeakMap,oc=!1;function sc(t,e){!ki||!Wn||e&&e.burst===!1||Mi.set(Wn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function ac(t){let e={control:t};Wn=e,setTimeout(()=>{Wn===e&&(Wn=null)},0)}function _i(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Ih):null}function rc(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=_i(t);e&&(ac(e),Ai(t,!1))}function Wh(t){let e=_i(t);e&&ac(e)}function Ai(t,e=!0){if(!Vo||document.visibilityState==="hidden")return;let n=_i(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=Mi.get(n);if(o){if(!o.element.isConnected){Mi.delete(n);return}Vo(o.element,o.options).catch(()=>{});return}e&&!oc&&(oc=!0,Vo(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function lc(){if(ki||typeof document>"u"||typeof document.addEventListener!="function")return;ki=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",rc,t),document.addEventListener("keydown",rc,t),document.addEventListener("click",Wh,t),document.addEventListener("pointerenter",Ai,t),document.addEventListener("focusin",Ai,t)}At();vt();function lm(...t){return fi(...t),et}async function cm(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");tt(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await Ct();let o=Array.from(n.childNodes).some(i=>i.nodeType===3&&i.textContent.trim()),r=n.children.length===1&&!o?n.firstElementChild:n;return await zi(r,{...e||{},burst:!1})}finally{n.remove()}}var fm="3.7.2",et=Object.assign(zi,{plugins:lm,fromString:cm,version:fm,preCapture:lc});ic(zi);var Bi=Symbol("snapdom.internal"),um=Symbol("snapdom.internal.silent"),$c=new Set(["png","jpeg","jpg","webp","svg"]);async function zi(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Ol(e);n.element=t,n.invalidate&&je(),kl(n,e&&e.plugins);let{stage:o,loweredBy:r}=xl(n);n.needs=o,n.__needsLoweredBy=r;let i=nn(o,"render"),s=n.burst===!0||!No(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=i&&!n.captureSelection&&n.burst!==!1&&s&&!a&&tc(t);return u&&sc(t,e),n.snap||(n.snap={toPng:(c,f)=>et.toPng(c,f),toSvg:(c,f)=>et.toSvg(c,f)}),u?nc(t,e,n,()=>et.capture(t,n,Bi),c=>Pc(c,n)):(await Xn(),et.capture(t,n,Bi))}et.capture=async(t,e,n)=>{if(n!==Bi)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(nn(e.needs||kt,"render")&&Y()){if(e.embedFonts)try{let i=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=bo(i).drawn,s.size===0))throw null;let a=wo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(Rn(u).toLowerCase()))),l.size===0))throw null;await xo(l,a.usedCodepoints,i)}catch{}let r=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&r.unshift(t);for(let i of r)try{if(En(i))continue;let s=i.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"Couldn't prepare canvases for Safari.",s)}}let o=await Wl(t,e);return Pc(o,e)};async function Pc(t,e){let n=e.needs||kt,o=nn(n,"render"),r=k=>vl(n,e.__needsLoweredBy||[],k),i=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=i?null:t,a=()=>s??=i.toDataURL(),l=i||t;i&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(i||!u?.size)return l;let I=d.vbW,W=d.vbH,$=k.crop;$&&(I=Math.max(1,Math.min(I,$.x+$.width)-Math.max(0,$.x)),W=Math.max(1,Math.min(W,$.y+$.height)-Math.max(0,$.y)));let N=Number.isFinite(k.width),U=Number.isFinite(k.height);return(N&&U?Math.max(k.width/I,k.height/W):N?k.width/I*($?Math.max(1,p/g):1):U?k.height/W*($?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Fl(a(),u)},b=async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(fn(),Dn));return W(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw r("svgString");if(i)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?Hn(decodeURIComponent(t.slice(k+1)),e.__fileSvg):""},S=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw r("export.url")},enumerable:!1,configurable:!0}),v={img:async(k,I)=>{if(i)return b(k,I);let{toImg:W}=await Promise.resolve().then(()=>(Ii(),Li)),$={...k,...I||{}};return W(y($),$)},svg:async(k,I)=>{if(i)return b(k,I);let{toSvg:W}=await Promise.resolve().then(()=>(Ii(),Li)),$={...k,...I||{}};return W(y($),$)},canvas:async(k,I)=>{let{toCanvas:W}=await Promise.resolve().then(()=>(Fe(),mc)),$={...k,...I||{}};return W(y($),$)},blob:async(k,I)=>{let{toBlob:W}=await Promise.resolve().then(()=>(Di(),Ec)),$={...k,...I||{}};return W(y($),$)},png:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(fn(),Dn)),$={...k,...I||{},format:"png"};return W(y($),$)},jpeg:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(fn(),Dn)),$={...k,...I||{},format:"jpeg"};return W(y($),$)},webp:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(fn(),Dn)),$={...k,...I||{},format:"webp"};return W(y($),$)},download:async(k,I)=>{let{download:W}=await Promise.resolve().then(()=>(Tc(),Fc)),$={...k,...I||{}};return W(y($),$)}};if(!o)for(let k of Object.keys(v)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;v[k]=async()=>{throw r(I)}}let C={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])C[k]=async I=>v[k](e,{..._(k,I||{}),[um]:!0});C.jpg=C.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),T=M({artifacts:e.__artifacts||null,export:S(),exports:C}),F=await Po("defineExports",T),A=Object.assign({},...F.filter(k=>k&&typeof k=="object").reverse()),x={...v,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function _(k,I){let W=I||{},$={...e,...W},N=typeof W.type=="string"?W.type.toLowerCase():"",U=typeof W.format=="string"?W.format.toLowerCase():$c.has(N)?N:"";U&&($.format=U==="jpg"?"jpeg":U),$.__explicitFormat=U?$.format:e.__explicitFormat??null,k==="blob"&&!$.__explicitFormat&&($.format=i?"png":"svg"),$.type=$.format;let z=B=>B==="jpeg"||B==="jpg"||B==="webp";return[k,$.format,N].map(B=>typeof B=="string"?B.toLowerCase():"").find(z)&&($.backgroundColor==null||$.backgroundColor==="transparent")&&($.backgroundColor="#ffffff"),$.scale!==1&&(Number.isFinite($.width)||Number.isFinite($.height))&&D($,"scale ignored: width/height already set the size."),$}let P=!1,E=Promise.resolve();async function R(k,I){let W=Object.freeze(I&&typeof I=="object"?{...I}:{}),$=async()=>{let U=x[k];if(!U)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let z=_(k,W),V=M({artifacts:e.__artifacts||null,export:S({type:k,options:z,requestedOptions:W})}),B=z.format,rt=z.type;await Po("beforeExport",V,{format:k,options:z});let at=z.format!==B?z.format:z.type!==rt?z.type:"",pt=typeof at=="string"?at.toLowerCase():"";$c.has(pt)&&(z.format=pt==="jpg"?"jpeg":pt,z.type=z.format,z.__explicitFormat=z.format,/^(?:jpeg|webp)$/.test(z.format)&&(z.backgroundColor==null||z.backgroundColor==="transparent")&&(z.backgroundColor="#ffffff"));let St=await U(V,z);return await Po("afterExport",V,{format:k,options:z,result:St}),P||(P=!0,await Zt("afterSnap",e)),St},N=E.then($);return E=N.catch(()=>{}),N}let L={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw r("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?i&&Object.defineProperty(L,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(L,"url",{get(){throw r("url")},enumerable:!1,configurable:!0}),Object.defineProperty(L,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw r("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);L[I]||(L[I]=W=>R(k,W))}return L}et.toRaw=(t,e)=>et(t,e).then(n=>n.toRaw());et.toImg=(t,e)=>et(t,e).then(n=>n.toImg());et.toSvg=(t,e)=>et(t,e).then(n=>n.toSvg());et.toCanvas=(t,e)=>et(t,e).then(n=>n.toCanvas());et.toBlob=(t,e)=>et(t,e).then(n=>n.toBlob());et.toPng=(t,e)=>et(t,{...e,format:"png"}).then(n=>n.toPng());et.toJpg=(t,e)=>et(t,{...e,format:"jpeg"}).then(n=>n.toJpg());et.toWebp=(t,e)=>et(t,{...e,format:"webp"}).then(n=>n.toWebp());et.download=(t,e)=>et(t,e).then(n=>n.download());export{kt as DEFAULT_STAGE,en as STAGES,Sl as assertNeeds,Wp as clearPlugins,ui as getGlobalPlugins,rn as normalizePlugin,fi as registerPlugins,et as snapdom}; +}`,Kp=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Kt=null,Jp=0,Qp=0,Ae=new Map;function Ll(){for(let t of Ae.values())t(void 0);if(Ae.clear(),Array.isArray(Kt))for(let t of Kt)try{t?.terminate()}catch{}Kt=!1}function Zp(){let t,e=null;try{t=URL.createObjectURL(new Blob([Yp],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let o=Ae.get(n.data.id);o&&(Ae.delete(n.data.id),o(n.data.error?void 0:n.data.url??null))},e.onerror=Ll}catch{e=null}return t&&URL.revokeObjectURL(t),e}function th(){if(Kt===!1)return!1;if(Kt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Kt=!1;Kt=[]}let t=Jp++%Kp;if(!Kt[t]){let e=Zp();if(!e)return Ll(),!1;Kt[t]=e}return Kt[t]}var eh=5e3;function nh(t,e,n,o,r){let i=th();return i?new Promise(s=>{let a=++Qp,l=setTimeout(()=>{Ae.delete(a),s(void 0)},eh);Ae.set(a,u=>{clearTimeout(l),s(u)});try{i.postMessage({id:a,dataURL:r?"":t,blob:r,srcLength:t.length,targetW:e,targetH:n,resFactor:Nl,quality:Pl,mime:o})}catch{clearTimeout(l),Ae.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function hi(t,e,n,o){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let r=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,i=j.compress,s=i.get(r);if(s?.source===t)return s.result;let a=Io.get(r);if(a?.source===t&&a.cache===i)return a.promise;let l=(async()=>{let c=jp(t),f=c==="image/jpeg"?"image/jpeg":c==="image/webp"?"image/webp":"image/png",d=Xp(t);if(d&&d.w>0&&d.h>0&&!Rl(d.w,d.h,e,n))return null;if(t.length>=Vp){let C=await nh(t,e,n,f,o);if(C!==void 0)return C}let h;try{h=await Hp(t)}catch{return null}let m=h.naturalWidth||h.width,g=h.naturalHeight||h.height;if(!m||!g)return null;let p=Rl(m,g,e,n);if(!p)return null;let y=p*Nl,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(g*y)),S=document.createElement("canvas");S.width=b,S.height=w;let v=S.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,w);try{let C=S.toDataURL(f,Pl);if(typeof C=="string"&&C.startsWith("data:image")&&C.length{let f=c.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(c.dataset.snapdomWidth)||parseFloat(c.style.width)||c.width||0,h=parseFloat(c.dataset.snapdomHeight)||parseFloat(c.style.height)||c.height||0;if(!d||!h)return;let m=o.value||=pi(t,e),g=m.density*m.stretch(n.get(c)||c),p=await hi(f,d*g,h*g,c.__snapdomBlob);p&&(i++,s+=f.length,a+=p.length,c.setAttribute("src",p),Wo(c,"attribute","src",f,p,e))},u=6;for(let c=0;c{let c=n.get(u);if(!c||!c.isConnected)return;let f;try{f=getComputedStyle(c)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some($=>$.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some($=>!rh.test($.trim())))return;let{w:m,h:g}=ih(c);if(!m||!g)return;let p=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map($=>parseFloat($)/100)),y=o.value||=pi(t,e),b=y.density*y.stretch(c)*p,w=m*b,S=g*b,v=u.style.backgroundImage,C=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=v;for(let $ of C){let F=$[2];if(F.startsWith("data:image/svg"))continue;let A=await hi(F,w,S);A&&(M=M.split(F).join(A),s++)}M!==v&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),Wo(u,"style","background-image",v,u.style.backgroundImage,e))},l=6;for(let u=0;u{let u=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let c=l.getAttribute("width")||"",f=l.getAttribute("height")||"";if(c.includes("%")||f.includes("%"))return;let d=n.get(l),h=d?O(d):l.style,m=(S,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[S]||""))return parseFloat(h[S]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return d?.[S]?.baseVal?.value||0}catch{return 0}},g=m("width",c),p=m("height",f);if(!g||!p)return;let y=o.value||=pi(t,e),b=y.density*y.stretch(d||l),w=await hi(u,g*b,p*b);w&&(l.setAttribute("href",w),Wo(l,"attribute","href",u,w,e),l.hasAttribute("xlink:href")&&(l.setAttributeNS(Fl,"xlink:href",w),Wo(l,"attribute","xlink:href",u,w,e)),i++)},a=6;for(let l=0;le+.5?t-n:o-n}function lh(t){let e=r=>r&&r!=="transparent"&&!/^rgba\(.*,\s*0\)$/.test(r),n=O(t.documentElement).backgroundColor,o=e(n)?n:O(t.body).backgroundColor;return e(o)?`;background-color:${o} !important`:""}var ch=/(?:^|;)(?:box-shadow|text-shadow|outline-style|filter|-webkit-filter):/;function fh(t,e){if(Y())return t;let n=t.indexOf("");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,r=[],i=n,s;for(o.lastIndex=n;s=o.exec(t);)r.push({text:t.slice(i,s.index),intern:!0}),r.push({text:s[0],intern:!1}),i=o.lastIndex;r.push({text:t.slice(i),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of r)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=uh(e,r.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},p="";for(let y of r)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function uh(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let r=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(r),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(r)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let i=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&i.add(u[1])}return i}async function zo(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:r,rootTransform2D:i,fontsCSS:s,universe:a}=e,l=t.options;if(t!==l){let{options:K,...Q}=t;t=Object.assign(l,Q),Object.defineProperty(t,"options",{value:t,configurable:!0})}let u,c;_o(t,s,a),await Zt("beforeRender",t);let f=O(t.element),d=t.element.getBoundingClientRect(),h=Math.max(1,H(t.element.offsetWidth||parseFloat(f.width)||d.width||1)),m=Math.max(1,H(t.element.offsetHeight||parseFloat(f.height)||d.height||1)),g=t.element.ownerDocument||document,p=!n&&(t.element===g.body||t.element===g.documentElement)&&!t.__pinned,y=null,b=null,w=0;if(p){let K=Math.max(t.element.scrollHeight||0,g.documentElement?.scrollHeight||0,g.body?.scrollHeight||0),Q=Math.max(t.element.scrollWidth||0,g.documentElement?.scrollWidth||0,g.body?.scrollWidth||0),ot=Math.max(h,H(Q)),it=t.element===g.body,Tt=it&&O(g.documentElement).direction==="rtl",mt=J=>{J>0&&(Tt?w=Math.max(w,H(J-d.width)):h=Math.max(h,H(J)))};if(it&&g.documentElement){let J=g.documentElement.getBoundingClientRect(),ct={top:Math.max(0,d.top-J.top),right:Math.max(0,J.right-d.right),bottom:Math.max(0,J.bottom-d.bottom),left:Math.max(0,d.left-J.left)};if(y=ct,r!=="subtree"&&(ct.top||ct.right||ct.bottom||ct.left)){let bt=t.__session?.styleMap,pn=new Map,Hn=new Map;for(let[oe,Ot]of t.nodeMap){let Dt=bt?.get(oe);if(Dt){let rr=pn.get(Dt);if(rr===void 0&&pn.set(Dt,rr=ch.test(Dt)),!rr)continue}Hn.set(oe,Ot)}let qt=ti(t.element,Hn,t.styleCache,d.width>0?h/d.width:1,d.height>0?m/d.height:1);b={top:Math.min(qt.top,ct.top),right:Math.min(qt.right,ct.right),bottom:Math.min(qt.bottom,ct.bottom),left:Math.min(qt.left,ct.left)}}K=Math.max(t.element.scrollHeight||0,an(K,J.height,d.top-J.top,d.bottom-J.top)),Q=Math.max(t.element.scrollWidth||0,Tt?an(Q,J.width,J.right-d.right,J.right-d.left):an(Q,J.width,d.left-J.left,d.right-J.left))}K>0&&(m=Math.max(m,H(K))),mt(Q);try{let J=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,ct=j.measureHints.get(t.element);if(ct&&ct.cssLen===J&&ct.w0===ot&&ct.docH===K&&ct.docW===Q)ct.csh>0&&(m=Math.max(m,H(ct.csh))),mt(ct.csw);else{let bt=g.createElement("div");tt(bt),bt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+ot+"px!important;overflow:visible!important;visibility:hidden!important;";let pn=bt.attachShadow({mode:"open"});Ln(pn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let Hn=pn.appendChild(si(t.clone));g.body.appendChild(bt);let qt=bt.scrollHeight,oe=bt.scrollWidth;if(it){let Ot=bt.getBoundingClientRect(),Dt=Hn.getBoundingClientRect();qt=an(qt,Ot.height,Dt.top-Ot.top,Dt.bottom-Ot.top),oe=Tt?an(oe,Ot.width,Ot.right-Dt.right,Ot.right-Dt.left):an(oe,Ot.width,Dt.left-Ot.left,Dt.right-Ot.left)}g.body.removeChild(bt),j.measureHints.set(t.element,{cssLen:J,w0:ot,docH:K,docW:Q,csh:qt,csw:oe}),qt>0&&(m=Math.max(m,H(qt))),mt(oe)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=ii(t.element,t.options),Q=1,ot=ii(t.element,{}),it=Math.max(2,m*.15);Number.isFinite(ot)&&ot>=m-it&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,H(K+Q))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;ul(t.element,t.clone,K,t.nodeMap,h,m)}catch(K){nt(t.options.__session,"reconcile-failed","reconcile pass failed",K),D(t.options,"reconcile couldn't run; captured without it.",K)}let S=(K,Q=NaN)=>{let ot=typeof K=="string"?parseFloat(K):K;return Number.isFinite(ot)?ot:Q},v=S(t.options.width),C=S(t.options.height),M=n?H(n.width):h,$=n?H(n.height):m,F=M,A=$,x=Number.isFinite(v),_=Number.isFinite(C),P=$>0?M/$:1;x&&_?(F=Math.max(1,H(v)),A=Math.max(1,H(C))):x?(F=Math.max(1,H(v)),A=Math.max(1,H(F/(P||1)))):_&&(A=Math.max(1,H(C)),F=Math.max(1,H(A*(P||1))));let E=0,R=0,L=h,k=m;if(n){let K=0,Q=0;if(mi(t.element)){let it=null;if(!o&&i&&Number.isFinite(i.a))it={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0};else{let Tt=ke(t.element),mt=ri(f.transform&&f.transform!=="none"?f.transform:"",Tt);mt&&mt.is2D&&(it={a:mt.a,b:mt.b,c:mt.c,d:mt.d,e:0,f:0})}if(it&&!(it.a===1&&it.b===0&&it.c===0&&it.d===1)){let{ox:Tt,oy:mt}=Tn(f,h,m),J=tn(h,m,it,Tt,mt);K=J.minX,Q=J.minY}}let ot=Y()?0:(l.dpr||1)*(x||_?F/M:l.scale||1);E=H(ot?Math.round((n.x+K)*ot)/ot:n.x+K),R=H(ot?Math.round((n.y+Q)*ot)/ot:n.y+Q),L=H(E+n.width),k=H(R+n.height)}else if(!o&&i&&Number.isFinite(i.a)){let K={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0},Q=tn(h,m,K,0,0);E=H(Q.minX),R=H(Q.minY),L=H(Q.maxX),k=H(Q.maxY)}else if(o&&mi(t.element)){let Q=f.transform&&f.transform!=="none"?f.transform:"",ot=ke(t.element),it=de({baseTransform:Q,rotate:ot.rotate||"0deg",scale:ot.scale,translate:ot.translate,width:h,height:m}),{ox:Tt,oy:mt}=Tn(f,h,m),J=it.is2D?it:new DOMMatrix(it.toString()),ct={a:J.a,b:J.b,c:J.c,d:J.d,e:0,f:0},bt=tn(h,m,ct,Tt,mt);E=H(bt.minX),R=H(bt.minY),L=H(bt.maxX),k=H(bt.maxY)}let I=Yr(f),W=Kr(f),T=Jr(f),N=Qr(f),U=Zr(f),z=d.width>0?(L-E)/d.width:1,V=d.height>0?(k-R)/d.height:1,B=r==="subtree"&&!n?ti(t.element,t.nodeMap,t.styleCache,z,V):{top:0,right:0,bottom:0,left:0};b&&(B={top:b.top,right:Math.max(0,b.right-(h-d.width)),bottom:Math.max(0,b.bottom-(m-d.height)),left:b.left}),w>0&&(B={...B,left:Math.max(B.left,w)});let rt=n?{top:0,right:0,bottom:0,left:0}:r?{top:H(Math.max(I.top,W.top,B.top)+T.top+N.top+U.bleed.top),right:H(Math.max(I.right,W.right,B.right)+T.right+N.right+U.bleed.right),bottom:H(Math.max(I.bottom,W.bottom,B.bottom)+T.bottom+N.bottom+U.bleed.bottom),left:H(Math.max(I.left,W.left,B.left)+T.left+N.left+U.bleed.left)}:{top:H(T.top+B.top),right:H(T.right+B.right),bottom:H(T.bottom+B.bottom),left:H(T.left+B.left)};E=H(E-rt.left),R=H(R-rt.top),L=H(L+rt.right),k=H(k+rt.bottom);let at=Math.max(1,H(L-E)),pt=Math.max(1,H(k-R)),St="http://www.w3.org/2000/svg",ee=mi(t.element)?2:0,It=H(ee+(o?0:1)),$e=l.__subpixel?.x||0,q=l.__subpixel?.y||0,X=Math.ceil(at+It*2+$e),G=Math.ceil(pt+It*2+q),ht=H(-(H(E)-It)),Z=H(-(H(R)-It)),zn=g.defaultView||window,lt=!Y()&&CSS.supports("zoom","2")?dh(zn):1;l.__layoutZoom=lt;let dn=n&&!Y(),ne=dn?H(ht-Math.floor(ht*lt+.01)/lt):0,$t=dn?H(Z-Math.floor(Z*lt+.01)/lt):0,Te=Math.min(0,ht-ne)-(ne?1/lt:0),Vt=Math.min(0,Z-$t)-($t?1/lt:0),me=ht-ne-Te+$e,Pe=Z-$t-Vt+q,Ne=H(X-Te),Gt=H(G-Vt),Wt=document.createElementNS(St,"foreignObject");Wt.setAttribute("x",String(Te*lt)),Wt.setAttribute("y",String(Vt*lt)),Wt.setAttribute("width",String(Ne*lt)),Wt.setAttribute("height",String(Gt*lt)),Wt.style.overflow="visible";let ji=document.createElement("style"),Ic="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ji.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Ic+t.classCSS,Wt.appendChild(ji);let Le=document.createElement("div");Le.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Le.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${l.__subpixel?H(me+d.width):Ne}px;height:${Gt}px`+(me!==0||Pe!==0?`;padding:${Pe}px 0 0 ${me}px !important`:"")+(lt!==1?`;zoom:${lt} !important`:"")+";direction:ltr !important"+(y?lh(g):""),y&&(me!==y.left||Pe!==y.top)&&t.__session&&rl(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,me-y.left,Pe-y.top),Le.appendChild(t.clone),Wt.appendChild(Le);let Vi=new XMLSerializer,Wc=Vi.serializeToString(Wt),Gi=x||_,Oc=Object.freeze({w0:M,h0:$,vbW:X,vbH:G,targetW:F,targetH:A,contentX:H(ht+(n?E:0)),contentY:H(Z+(n?R:0)),clip:n?Object.freeze({x:H(E),y:H(R),width:M,height:$}):null});Object.defineProperty(l,"meta",{value:Oc,enumerable:!0,writable:!1,configurable:!0});let Dc=!Gi||Y()?X:x?F:H(X*(A/G)),Bc=!Gi||Y()?G:_?A:H(G*(F/X)),zc=parseFloat(O(g.documentElement)?.fontSize)||16,nr=[ne||$t?`translate(${ne} ${$t})`:"",lt!==1?`scale(${1/lt})`:""].join(" ").trim(),Un=`${nr?``:""}`,qi=nr?"":"";if(c=Un+fh(Wc,Wt)+qi,l.__fileSvg=null,lt!==1){let K=mt=>{let J=Vi.serializeToString(mt.cloneNode(!1));return J.slice(0,J.indexOf(">")+1).replace(/\/>$/,">")},Q=Wt.cloneNode(!1);Q.setAttribute("x",String(Te)),Q.setAttribute("y",String(Vt)),Q.setAttribute("width",String(Ne)),Q.setAttribute("height",String(Gt));let ot=Le.cloneNode(!1);ot.style.removeProperty("zoom");let it=ne||$t?`translate(${ne} ${$t})`:"",Tt=Un.slice(0,Un.indexOf(">")+1)+(it?``:"");l.__fileSvg={zoomed:[Un+K(Wt),K(Le),qi],flat:[Tt+K(Q),K(ot),it?"":""]}}u=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,t.svgString=c,t.dataURL=u,l.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Zt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let or=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);return or&&or.style.position==="absolute"&&or.remove(),t.dataURL}function mi(t){return tl(t)}function dh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let r=n.createElement("div");tt(r),r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(r);let i=parseFloat(t.getComputedStyle(r).borderTopWidth);r.remove(),i>=1&&(o=1)}catch{}return o}Me();Pn();function mh(t){let e=Array.isArray(t.plugins)?t.plugins:di(),n=[];for(let o of e){let r=sn(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}async function Dl(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ci(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=mh(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,r,i,s,a,l,u,c,f,d="",h=null,m=e.needs||kt,g=n.format,p=n.type;await Zt("beforeSnap",n);let y=n.format!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),b=n.type!==p&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(y||b){let E=String(y?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Zt("beforeClone",n);let w=n.outerTransforms!==!1,S=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,v=n.clip?Mo(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Rs(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let C=gs(e.fast);for(;;){e.__slicer=C;let E=Po(n.element,v);try{({clone:o,classCSS:r,classPrefixCSS:i,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c,universe:f}=await pl(n.element,n.options)),l>0&&!e.reconcile&&(nt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,D(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!w&&o&&(h=Za(n.element,o)),!S&&o&&sl(n.element,o,n.options),o&&(cl(n.element,o,a,c),al(n.element,o))}finally{E()}if(!C?.yielded||!e.__tornSinceStart?.())break;C=null,e.__session=ci(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=r,n.styleCache=s,n.nodeMap=a,await Zt("afterClone",n),!on(m,"render"))return null;if(C?.due()&&await C.pause(),Ao(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{fl(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){nt(e.__session,"shrink-failed","shrink pass failed",E),D(e,"Couldn't close the gaps left by removed elements.",E)}try{await uo(n.clone,n.element,n.nodeMap)}catch{}try{let E=e.__session?.styleMap;E&&po(E.keys(),E,n.nodeMap,n.options.__iconMatchers)}catch{}let M=E=>Promise.resolve().then(E),$=(async()=>{await Promise.all([M(()=>Ro(n.clone,n.options)),M(()=>$o(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{gl(n.element,n.clone,n.nodeMap)}catch(E){nt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),D(e,"Couldn't reproduce a backdrop-filter; captured without it.",E)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=h,await M(()=>Bo(n.clone,n.options,n.nodeMap))),e.captureSelection)try{da(n.nodeMap)}catch(E){nt(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=M(async()=>{let E=n.element.ownerDocument||document,R=v?T=>{try{let N=T.getBoundingClientRect();return N.right>=v.left-200&&N.left<=v.right+200&&N.bottom>=v.top-200&&N.top<=v.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:k}=!v&&e.__fontUsage||xo(n.element,R),I=L,W=L;if(e.embedFonts==="auto"){let{declared:T,drawn:N}=wo(E),U=z=>Fn(z).toLowerCase();if(I=new Set(Array.from(L).filter(z=>N.has(U(z)))),!I.size)return;W=new Set(Array.from(L).filter(z=>N.has(U(z))||!T.has(U(z))))}Y()&&await So(I,k,E),d=await La({required:W,usedCodepoints:k,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E,debug:n.options.debug})})),await Promise.all([$,F]);let x=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!x){let{tryCanvasEngine:E}=await Promise.resolve().then(()=>(Ol(),Wl));_o(n,d,f);let R=await E(n,n.options);if(R)return R}C?.due()&&await C.pause();let _=n.clone;Do(_,e.__compressedAssets);let P=await zo(n,{clipWindow:u,outerTransforms:w,outerShadows:S,rootTransform2D:h,fontsCSS:d,universe:f});if(e.__compressedSnapshot=Oo(_,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:i,fontsCSS:d,clipWindow:u,outerTransforms:w,outerShadows:S,rootTransform2D:h,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return P}Mt();vt();wt();var gh=new Set(["png","jpeg","jpg","webp","svg"]);function Bl(t={}){let e=typeof t.type=="string"&&gh.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,r=Xi(t.cache),i=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of i)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{D(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&D(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ft(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Ma(t.iconFonts,t),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:r,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:o,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}dt();wt();Et();Me();var zl="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function yh(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var bh=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function wh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(bh.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function xh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(i=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(i.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let r of o){let i=getComputedStyle(r),s=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var Sh=1/16;function vh(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=Sh}var Uo=new Map,Ch=["width","height","min-width","min-height"];function kh(t){let e=Uo.get(t);if(e===void 0){e=null;for(let n of Ch){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}Uo.size>5e3&&Uo.clear(),Uo.set(t,e)}return e}function Mh(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Ah(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let r=e.nodeMap.get(o);r!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(r)===o&&e.srcToClone.delete(r)),e.styleMap.delete(o)}for(let r=o.firstChild;r;r=r.nextSibling)n.push(r)}}var gi={attempts:0,served:0,reconciled:0};async function Ul(t,e,n){gi.attempts++;try{let o=await _h(t,e,n);return o&&gi.served++,o}catch{return null}}async function _h(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||yh(t)||wh(o)||o.fontsCSS||Lo(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let r=t.ownerDocument||document,i=qe(t);if(!i||Es(r))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(zl)||d.querySelector?.(zl)||xh(d,i))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=Po(d,null),y=ko(d),b;try{b=await ue(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Ze(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await io(b,g),Ao(b);try{await uo(b,d,m)}catch{}try{po([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([Ro(b,n),$o(d,b,o.styleCache,n,m)]),n.compress)try{await Bo(b,n,m)}catch{}for(let[w,S]of m.entries())li(w,S,m,o.styleCache);h.replaceWith(b),Ah(h,o);for(let[w,S]of m.entries())o.nodeMap.set(w,S),o.srcToClone.set(S,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=kh(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let S=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(S+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((v,C)=>v+(parseFloat(p.getPropertyValue(C))||0),0)),w=`${S}px`}if(!vh(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),gi.reconciled++,await xt(h,d,a,n)}}let u=yn(o.styleMap);for(let[d,h]of o.styleMap.entries())Mh(d),ai(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");if(qe(t)!==i)return null;Do(o.clone,n.__compressedAssets);let f=await zo({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||"",universe:i});return n.__compressedSnapshot=Oo(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}vt();dt();var bi=new WeakMap,jo=new WeakMap,Zl=new WeakSet,yi=new WeakMap,Eh=64,Wn=new Map,tc=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Rh=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Fh(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Rh.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Hl(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Bt(n)||null}return e.join("|")}function jl(t,e){if(e.disposed||(Wn.delete(t),Wn.set(t,e),Wn.size<=Eh))return;let[n,o]=Wn.entries().next().value;ec(n,o)}function ec(t,e){e.disposed=!0,Wn.delete(t),bi.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of tc)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of xi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function nc(t){if(Zl.has(t))return!1;jo.delete(t);let e=[t],n=[],o=[];for(let r=0;r=0&&e.observers.splice(s,1)}for(let r of o)if(!e.trackedShadowRoots.has(r))try{let i=new MutationObserver(e.markDirty);i.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),i.__flush=e.markDirty,e.observers.push(i),e.trackedShadowRoots.set(r,i);for(let s of xi)r.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var xi=["scroll","change","beforetoggle","toggle"];function Vo(t,e){return[t,...e.trackedShadowRoots.keys()]}function Si(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of Vo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[r,i]of e.trackedImages)o.has(r)||(r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let r=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",r),o.removeEventListener("error",r),e.trackedImages.delete(o)};e.trackedImages.set(o,r),o.addEventListener("load",r),o.addEventListener("error",r)}}function Vl(t){let e=new Map,n=new Map,o=new Map;for(let r of t)if(xe(r))if(r.type==="attributes"){let i=e.get(r.target);i||e.set(r.target,i=new Map),i.has(r.attributeName)||i.set(r.attributeName,r.oldValue)}else if(r.type==="characterData")n.has(r.target)||n.set(r.target,r.oldValue);else if(r.type==="childList"){let i=o.get(r.target);i||o.set(r.target,i=new Map);for(let s of r.addedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)+1)}for(let s of r.removedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)-1)}}else return!0;for(let[r,i]of e)for(let[s,a]of i)if(r.getAttribute(s)!==a)return!0;for(let[r,i]of n)if(r.data!==i)return!0;for(let r of o.values())for(let i of r.values())if(i!==0)return!0;return!1}var $h=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,cn=t=>t&&(typeof t=="object"||typeof t=="function")?Ho(t):"-";function Th(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),r=t.slice(n+1);try{if(/;base64/i.test(o)){let i=Math.ceil(e/3)*4;return atob(r.slice(0,i-i%4))}return r.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(i,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Ph(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Th(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Gl(t){let e=String(t||"").trim();return e?$h.test(e)?!0:/^data:/i.test(e)?Ph(e):!1:!1}function fn(t){let e=String(t||"");if(Gl(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Gl(n[1]??n[2]??n[3]))return!0;return!1}function ql(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(r=>t.srcToClone?.get(r)).filter(Boolean):[n];for(let r of o)for(let i of oc(r))if(fn(i.getAttribute?.("src"))||fn(i.getAttribute?.("href"))||fn(i.getAttribute?.("style"))||fn(t.styleMap?.get(i)))return!0;return!1}function oc(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function vi(t,e){let n=[],o=new Set,r=i=>{i&&!o.has(i)&&(o.add(i),n.push(i))};t.matches?.("input,textarea,select,option")&&r(t);for(let i of Vo(t,e))try{for(let s of i.querySelectorAll("input,textarea,select,option"))r(s)}catch{}e.controls=n}function Ci(t,e){let n=[],o=new Set,r=(i,s=!1)=>{if(!(!i||o.has(i))){o.add(i);try{(s||i.scrollLeft||i.scrollTop||i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&n.push(i)}catch{}}};for(let i=t;i;i=i.parentElement)r(i,!0);for(let i of Vo(t,e))for(let s of oc(i))r(s);e.scrollNodes=n}function Xl(t,e){let n=t.ownerDocument||document,o=n.defaultView,r=[o?.location?.hash||"",Fh(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{r.push(...[...n.adoptedStyleSheets||[]].map(cn))}catch{}for(let c of e.trackedShadowRoots.keys())try{r.push("#shadow",...[...c.adoptedStyleSheets||[]].map(cn))}catch{}let i=n.activeElement,s=n.fullscreenElement;(i?.contains(t)||t.contains(i))&&r.push(cn(i)),(s?.contains(t)||t.contains(s))&&r.push(cn(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,mn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:r.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function ln(t,e,n){if(!t)return!1;let o=t[n],r=e[n];if(o===r)return!0;if(!Array.isArray(o)||o.length!==r.length)return!1;for(let i=0;i[cn(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Nh(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Lh(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:je(),styleEpoch:Se(),styleStamp:Mn(t),outsideMutations:kn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},r=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)xe(l)&&(e.dirty=!0,o(l.target))},i=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(r);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=r,e.observers.push(a)}catch{}e.markDirty=r,e.onMediaDirty=i;try{for(let a of tc)t.addEventListener(a,i,{capture:!0,passive:!0})}catch{}return wi(t,e)||vi(t,e),Ci(t,e),Si(t,e),e}var Ih=0,Jl=new WeakMap;function Ho(t){let e=Jl.get(t);return e||(e="@"+ ++Ih,Jl.set(t,e)),e}function ki(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(Ho(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Ho(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let i=[];for(let s of t){let a=ki(s,e);if(a===null)return null;i.push(a)}return"["+i.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Ho(t));let r=[];for(let i of Object.keys(t).sort()){let s=t[i];if(s===void 0)continue;let a=ki(s,e);if(a===null)return null;r.push(JSON.stringify(i)+":"+a)}return"{"+r.join(",")+"}"}finally{e.delete(t)}}function Ql(t,e){let{burst:n,invalidate:o,...r}=t||{};try{let i=ki(r,new Set);return i===null?null:`${(e||[]).map(cn).join(",")}:${i}`}catch{return null}}function rc(t,e,n,o,r=null){let i=bi.get(t);i||(i=Lh(t),i.baselineSignature=Ql(e,n.plugins),bi.set(t,i));let s=Ql(e,n.plugins),a=async()=>{if(await Yn(),i.disposed)return o();let u=s===null||s!==i.baselineSignature;u&&s!==null?i.pendingSig===s?(i.baselineSignature=s,i.last=null,i.dirty=!0,i.dirtyRoots=null,i.pendingSig=null,u=!1):i.pendingSig=s:i.pendingSig=null,wi(t,i),Si(t,i);for(let M of i.observers)M.__flush(M.takeRecords());Ut();let c=kn(t);i.dirty&&i.outsideMutations!==c&&i.dirtyAll(),i.outsideMutations=c;let f=t.getRootNode?.(),d=[...i.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),eo(t.ownerDocument||document,d);let h=Mn(t);i.styleStamp!==h&&(i.styleStamp=h,i.dirty||i.dirtyAll());let m=Xl(t,i),g=Yl(t,i);m.animation=Kl(g),i.renderState&&(!ln(i.renderState,m,"style")&&(Ve(),i.dirtyAll()),ln(i.renderState,m,"scroll")||i.dirtyAll(),ln(i.renderState,m,"controls")||(ve(t),i.dirtyAll()),!ln(i.renderState,m,"images")&&!i.dirty&&i.dirtyAll());let p=je();i.envEpoch!==p&&(i.dirtyAll(),i.envEpoch=p);let y=Se();if(i.styleEpoch!==y&&(i.styleEpoch=y,!i.dirty)){let M=Hl(t);i.geometry!==null&&M!==i.geometry&&(ve(t),i.dirtyAll()),i.geometry=M}n.invalidate&&i.dirtyAll();let b=!1,w=!!i.renderState&&!ln(i.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let $ of g){let F=$.playState==="running";if(!F&&!w)continue;F&&(b=!0),w=!0;let A=$.effect?.target;if(Nh(t,i,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&i.retained){i.dirty=!0;for(let $ of M)i.dirtyRoots&&i.dirtyRoots.add($),ve($)}else w&&!M&&i.dirtyAll()}catch{}let S=m.frameDriven,v=b||S;if(v&&(i.last=null),S&&i.dirtyAll(),!u&&!v&&!i.dirty&&i.last)return jl(t,i),i.last;i.capturing=!0;let C=null;try{let M=null,$=!1,F=null;if(!u&&i.dirty&&i.retained&&i.dirtyRoots&&i.dirtyRoots.size&&r){F=[...i.dirtyRoots];let A=await Ul(t,i,n);A&&(M=await r(A),$=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[_,P]of A.nodeMap.entries())x.set(P,_);C={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of i.observers)for(let x of A.takeRecords())i.pending.push(x);return Ut(),i.torn||Vl(i.pending)||kn(t)!==c},M=await o()),!u&&!i.disposed){i.dirty=!1,i.dirtyRoots=new Set,C?(i.retained=C,i.retainedFrameDriven=ql(C),vi(t,i),Ci(t,i)):$&&(i.retainedFrameDriven||=ql(i.retained,F),vi(t,i),Ci(t,i));let A=Xl(t,i);A.animation=Kl(Yl(t,i));let x=["style","scroll","controls","images"];b||x.push("animation");let _=x.every(P=>ln(m,A,P));i.renderState=A,i.styleEpoch=Se(),i.styleStamp=Mn(t),i.geometry=Hl(t),i.renderState.frameDriven?(Zl.add(t),ec(t,i)):_?!v&&!i.renderState.frameDriven&&(i.last=M,jl(t,i)):(i.dirtyAll(),i.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let $ of i.observers)for(let F of $.takeRecords())i.pending.push(F);Ut();let M=kn(t);(i.torn||Vl(i.pending)||M!==c)&&(i.dirtyAll(),i.last=null),i.outsideMutations=M,i.styleEpoch=Se(),i.styleStamp=Mn(t),i.pending.length=0,i.torn=!1,i.capturing=!1,i.disposed||(wi(t,i),Si(t,i))}},l=i.inflight.then(a,a);return i.inflight=l.catch(()=>{}),l}var Go=null;function ac(t){Go=t}var Wh='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Mi=!1,On=null,Ai=new WeakMap,ic=!1;function lc(t,e){!Mi||!On||e&&e.burst===!1||Ai.set(On.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function cc(t){let e={control:t};On=e,setTimeout(()=>{On===e&&(On=null)},0)}function Ei(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Wh):null}function sc(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ei(t);e&&(cc(e),_i(t,!1))}function Oh(t){let e=Ei(t);e&&cc(e)}function _i(t,e=!0){if(!Go||document.visibilityState==="hidden")return;let n=Ei(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=Ai.get(n);if(o){if(!o.element.isConnected){Ai.delete(n);return}Go(o.element,o.options).catch(()=>{});return}e&&!ic&&(ic=!0,Go(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function fc(){if(Mi||typeof document>"u"||typeof document.addEventListener!="function")return;Mi=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",sc,t),document.addEventListener("keydown",sc,t),document.addEventListener("click",Oh,t),document.addEventListener("pointerenter",_i,t),document.addEventListener("focusin",_i,t)}At();vt();function cm(...t){return ui(...t),et}async function fm(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");tt(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await Ct();let o=Array.from(n.childNodes).some(i=>i.nodeType===3&&i.textContent.trim()),r=n.children.length===1&&!o?n.firstElementChild:n;return await Hi(r,{...e||{},burst:!1})}finally{n.remove()}}var um="3.7.4",et=Object.assign(Hi,{plugins:cm,fromString:fm,version:um,preCapture:fc});ac(Hi);var Ui=Symbol("snapdom.internal"),dm=Symbol("snapdom.internal.silent"),Nc=new Set(["png","jpeg","jpg","webp","svg"]);async function Hi(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Bl(e);n.element=t,n.invalidate&&Ve(),Al(n,e&&e.plugins);let{stage:o,loweredBy:r}=vl(n);n.needs=o,n.__needsLoweredBy=r;let i=on(o,"render"),s=n.burst===!0||!Lo(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=i&&!n.captureSelection&&n.burst!==!1&&s&&!a&&nc(t);return u&&lc(t,e),n.snap||(n.snap={toPng:(c,f)=>et.toPng(c,f),toSvg:(c,f)=>et.toSvg(c,f)}),u?rc(t,e,n,()=>et.capture(t,n,Ui),c=>Lc(c,n)):(await Yn(),et.capture(t,n,Ui))}et.capture=async(t,e,n)=>{if(n!==Ui)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(on(e.needs||kt,"render")&&Y()){if(e.embedFonts)try{let i=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=wo(i).drawn,s.size===0))throw null;let a=xo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(Fn(u).toLowerCase()))),l.size===0))throw null;await So(l,a.usedCodepoints,i)}catch{}let r=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&r.unshift(t);for(let i of r)try{if(Rn(i))continue;let s=i.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"Couldn't prepare canvases for Safari.",s)}}let o=await Dl(t,e);return Lc(o,e)};async function Lc(t,e){let n=e.needs||kt,o=on(n,"render"),r=k=>kl(n,e.__needsLoweredBy||[],k),i=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=i?null:t,a=()=>s??=i.toDataURL(),l=i||t;i&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(i||!u?.size)return l;let I=d.vbW,W=d.vbH,T=k.crop;T&&(I=Math.max(1,Math.min(I,T.x+T.width)-Math.max(0,T.x)),W=Math.max(1,Math.min(W,T.y+T.height)-Math.max(0,T.y)));let N=Number.isFinite(k.width),U=Number.isFinite(k.height);return(N&&U?Math.max(k.width/I,k.height/W):N?k.width/I*(T?Math.max(1,p/g):1):U?k.height/W*(T?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Tl(a(),u)},b=async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(un(),Bn));return W(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw r("svgString");if(i)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?jn(decodeURIComponent(t.slice(k+1)),e.__fileSvg):""},S=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw r("export.url")},enumerable:!1,configurable:!0}),v={img:async(k,I)=>{if(i)return b(k,I);let{toImg:W}=await Promise.resolve().then(()=>(Oi(),Wi)),T={...k,...I||{}};return W(y(T),T)},svg:async(k,I)=>{if(i)return b(k,I);let{toSvg:W}=await Promise.resolve().then(()=>(Oi(),Wi)),T={...k,...I||{}};return W(y(T),T)},canvas:async(k,I)=>{let{toCanvas:W}=await Promise.resolve().then(()=>(Fe(),yc)),T={...k,...I||{}};return W(y(T),T)},blob:async(k,I)=>{let{toBlob:W}=await Promise.resolve().then(()=>(zi(),Fc)),T={...k,...I||{}};return W(y(T),T)},png:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(un(),Bn)),T={...k,...I||{},format:"png"};return W(y(T),T)},jpeg:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(un(),Bn)),T={...k,...I||{},format:"jpeg"};return W(y(T),T)},webp:async(k,I)=>{let{rasterize:W}=await Promise.resolve().then(()=>(un(),Bn)),T={...k,...I||{},format:"webp"};return W(y(T),T)},download:async(k,I)=>{let{download:W}=await Promise.resolve().then(()=>(Pc(),Tc)),T={...k,...I||{}};return W(y(T),T)}};if(!o)for(let k of Object.keys(v)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;v[k]=async()=>{throw r(I)}}let C={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])C[k]=async I=>v[k](e,{..._(k,I||{}),[dm]:!0});C.jpg=C.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),$=M({artifacts:e.__artifacts||null,export:S(),exports:C}),F=await No("defineExports",$),A=Object.assign({},...F.filter(k=>k&&typeof k=="object").reverse()),x={...v,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function _(k,I){let W=I||{},T={...e,...W},N=typeof W.type=="string"?W.type.toLowerCase():"",U=typeof W.format=="string"?W.format.toLowerCase():Nc.has(N)?N:"";U&&(T.format=U==="jpg"?"jpeg":U),T.__explicitFormat=U?T.format:e.__explicitFormat??null,k==="blob"&&!T.__explicitFormat&&(T.format=i?"png":"svg"),T.type=T.format;let z=B=>B==="jpeg"||B==="jpg"||B==="webp";return[k,T.format,N].map(B=>typeof B=="string"?B.toLowerCase():"").find(z)&&(T.backgroundColor==null||T.backgroundColor==="transparent")&&(T.backgroundColor="#ffffff"),T.scale!==1&&(Number.isFinite(T.width)||Number.isFinite(T.height))&&D(T,"scale ignored: width/height already set the size."),T}let P=!1,E=Promise.resolve();async function R(k,I){let W=Object.freeze(I&&typeof I=="object"?{...I}:{}),T=async()=>{let U=x[k];if(!U)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let z=_(k,W),V=M({artifacts:e.__artifacts||null,export:S({type:k,options:z,requestedOptions:W})}),B=z.format,rt=z.type;await No("beforeExport",V,{format:k,options:z});let at=z.format!==B?z.format:z.type!==rt?z.type:"",pt=typeof at=="string"?at.toLowerCase():"";Nc.has(pt)&&(z.format=pt==="jpg"?"jpeg":pt,z.type=z.format,z.__explicitFormat=z.format,/^(?:jpeg|webp)$/.test(z.format)&&(z.backgroundColor==null||z.backgroundColor==="transparent")&&(z.backgroundColor="#ffffff"));let St=await U(V,z);return await No("afterExport",V,{format:k,options:z,result:St}),P||(P=!0,await Zt("afterSnap",e)),St},N=E.then(T);return E=N.catch(()=>{}),N}let L={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw r("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?i&&Object.defineProperty(L,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(L,"url",{get(){throw r("url")},enumerable:!1,configurable:!0}),Object.defineProperty(L,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw r("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);L[I]||(L[I]=W=>R(k,W))}return L}et.toRaw=(t,e)=>et(t,e).then(n=>n.toRaw());et.toImg=(t,e)=>et(t,e).then(n=>n.toImg());et.toSvg=(t,e)=>et(t,e).then(n=>n.toSvg());et.toCanvas=(t,e)=>et(t,e).then(n=>n.toCanvas());et.toBlob=(t,e)=>et(t,e).then(n=>n.toBlob());et.toPng=(t,e)=>et(t,{...e,format:"png"}).then(n=>n.toPng());et.toJpg=(t,e)=>et(t,{...e,format:"jpeg"}).then(n=>n.toJpg());et.toWebp=(t,e)=>et(t,{...e,format:"webp"}).then(n=>n.toWebp());et.download=(t,e)=>et(t,e).then(n=>n.download());export{kt as DEFAULT_STAGE,nn as STAGES,Cl as assertNeeds,Op as clearPlugins,di as getGlobalPlugins,sn as normalizePlugin,ui as registerPlugins,et as snapdom};