From bf3a747e11ad0abc3f976b4affe4962cf32f98ab Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 28 Sep 2026 11:13:09 +0800 Subject: [PATCH 1/2] feat: bump version 3.1.1 --- .../wwwroot/lib/snapdom.mjs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs index 965f0475..ae588c55 100644 --- a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs +++ b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs @@ -1,18 +1,18 @@ /* * SnapDOM -* v3.1.0 +* v3.1.1 * License: MIT */ -var ja=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var je=(t,e)=>{for(var n in e)ja(t,n,{get:e[n],enumerable:!0})};function Vo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function qo(t="soft"){t==="disabled"&&(P.computedStyle=new WeakMap,P.measureHints=new WeakMap,P.baseStyle=new ot(50),P.defaultStyle=new ot(64),P.image=new ot(100),P.background=new ot(100),P.resource=new ot(150),P.compress=new ot(50))}var ot,P,dt=ct(()=>{"use strict";ot=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},P={image:new ot(100),background:new ot(100),resource:new ot(150),defaultStyle:new ot(64),baseStyle:new ot(50),compress:new ot(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function Zt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function qa(t){let e=[],n=0,r=0,i="";for(let o=0;oo.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function yr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function Ut(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function br(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 qe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function wr(t){return"\u2022".repeat(String(t??"").length)}function rt(t,e){return t?.nodeType===1&&t.localName===e}function kt(t){return t?.nodeType===1&&t.namespaceURI===Ga}function Ht(t){return t?.nodeType===1&&t.namespaceURI===Xa}function Pt(t){return t?.nodeType===11&&!!t.host}function Sr(t){return t?.nodeType===9}var gr,Va,Ga,Xa,bt=ct(()=>{"use strict";gr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Va=gr;Ga="http://www.w3.org/1999/xhtml",Xa="http://www.w3.org/2000/svg"});function Ya(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let f=Date.now();(r.get(a)||0)>f||(r.set(a,f+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function Yo(t,e,n){if(Nt.size>=Xo){let r=Date.now();for(let[i,o]of Nt)o.until<=r&&Nt.delete(i);for(;Nt.size>=Xo;)Nt.delete(Nt.keys().next().value)}Nt.set(t,{until:Date.now()+n,result:e})}function Ka(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Qa(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function Ja(t,e){if(!e||Ka(t)||Qa(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Za(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>Ut(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}${Ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ko(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function tc(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 Qo(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function vr(t,e){try{t.onError?.(e)}catch{}}async function it(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;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[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...w].map(S=>S.charCodeAt(0))),x=new Blob([k],{type:(g||"").split(";")[0]||""});return{ok:!0,data:x,status:200,url:t,fromCache:!1,mime:x.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ko(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.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 c;try{c=tc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return vr(e,g),g}let f=Nt.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Nt.delete(c);let l=xr.get(c);if(l)return l;let u=Ja(t,i)?Za(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let m=new AbortController,d=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let g=await fetch(u,{signal:m.signal,credentials:p,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&Yo(c,w,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();Go.warnOnce(`http:${g.status}:${n}:${Qo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return vr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ko(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=m.signal.aborted?m.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&Yo(c,b,o),!a){let w=`${y}:${n}:${Qo(t)}`,k=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Go.errorOnce(w,k)}return vr(e,b),b}finally{clearTimeout(d),xr.delete(c)}})();return c!==null&&xr.set(c,h),h}var Go,xr,Xo,Nt,de=ct(()=>{"use strict";bt();Go=Ya("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),xr=new Map,Xo=50,Nt=new Map});async function pe(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ve(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zt(t);if(!r)return t;let i=br(r),o=Ut(i),s=(e.useProxy||"")+"|"+o;if(P.background.has(s)){let a=P.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(P.background.set(s,a.data),`url("${a.data}")`):(P.background.set(s,null),"none")}catch{return P.background.set(s,null),"none"}}var Jo=ct(()=>{"use strict";dt();bt();de()});function sc(t){let e=t.replace(ic,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ei(t,e,n,r){for(let i=0;i5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&oc.test(s.getPropertyValue(l))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ti.test(a)||a.includes("+")||a.includes("~")))for(let c of Ar(a,",")){let f=c.trim();f&&(r.inContainer||ti.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Zo)Zo[c].test(a)&&n[c].push(sc(a));if(o.styleSheet){if(!gn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let f=ei(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function gn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?ei(i,e,n,r):!1}function Cr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function ni(t){let e=new Set;return gn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Ar(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s"||u==="+"||u==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function ri(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function cc(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=ri(n,o)}return r}function oi(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(kr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let f of t.styleSheets)if(!gn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!gn(f,n,r,i))return e}typeof t.getAnimations=="function"&&Cr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=ri(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:ac(f)})),c=new Set(nc);for(let f of ec)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:cc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var kr,ec,nc,rc,oc,Zo,ic,ti,yn=ct(()=>{"use strict";kr=["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"],ec=["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"],nc=["display","width","height","min-width","min-height"],rc=/::?(?:before|after|first-letter|first-line|marker)/,oc=/%|\bauto\b|calc\(|var\(/i,Zo={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},ic=/::?(?:before|after|first-letter|first-line|marker)\b/g;ti=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function J(t){return ii.add(t),t.setAttribute("data-snapdom-internal",""),t}function zt(t){return ii.has(t)}var ii,wt=ct(()=>{"use strict";ii=new WeakSet});function _r(t){if(t=String(t).toLowerCase(),Ge.has(t)){let o={};return P.defaultStyle.set(t,o),o}if(P.defaultStyle.has(t))return P.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);e||(e=document.createElement("div"),J(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);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(he(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of kr)!(o in i)&&!he(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),P.defaultStyle.set(t,i),i}function he(t){let e=si.get(t);if(e===void 0){let n=String(t).toLowerCase();e=uc.has(n)||fc.test(n)||lc.test(n),si.set(t,e)}return e}function ci(t,e){let n=gc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function bn(t,e){return!pc.has(t)&&(e==="inline"||dc.has(t)||ai.has(t))}function Er(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ai.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!bc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ge.has(e))return"";let i=[],o=_r(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=bn(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",l=f==="nowrap"||f==="pre",p=c&&n&&!(c&&n&&!a&&l),m=!1;for(let d in t){if(he(d)||ci(d,t))continue;let h=t[d];if(p){if(hc.has(d))continue;if(mc.has(d)){h&&h!==o[d]&&(i.push(`${d}:${h}`),h!=="auto"&&(m=!0));continue}}if(h&&h!==o[d]){if(!l&&(d==="width"||d==="inline-size")&&h.endsWith("px")&&h.includes(".")){let g=parseFloat(h);if(Number.isFinite(g)){i.push(`${d}:${(g+yc).toFixed(3)}px`);continue}}i.push(`${d}:${h}`)}}if(p&&!a&&!r&&!m){let d=t.width;d&&d!=="auto"&&d!==o.width&&i.push(`min-width:${d}`)}return i.sort(),i.join(";")}function Rr(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 Fr(t,e=null){let n=new Map;for(let s of t){let a=_r(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!ci(p,a)).map(([p,m])=>`${p}:${m};`).sort(),u=l.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:l}),n.get(u).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} } +var ja=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var je=(t,e)=>{for(var n in e)ja(t,n,{get:e[n],enumerable:!0})};function qo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Go(t="soft"){t==="disabled"&&(N.computedStyle=new WeakMap,N.measureHints=new WeakMap,N.baseStyle=new ot(50),N.defaultStyle=new ot(64),N.image=new ot(100),N.background=new ot(100),N.resource=new ot(150),N.compress=new ot(50))}var ot,N,dt=ct(()=>{"use strict";ot=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},N={image:new ot(100),background:new ot(100),resource:new ot(150),defaultStyle:new ot(64),baseStyle:new ot(50),compress:new ot(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function te(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function qa(t){let e=[],n=0,r=0,i="";for(let o=0;oo.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function yr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function zt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function br(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 qe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function wr(t){return"\u2022".repeat(String(t??"").length)}function rt(t,e){return t?.nodeType===1&&t.localName===e}function kt(t){return t?.nodeType===1&&t.namespaceURI===Ga}function Nt(t){return t?.nodeType===1&&t.namespaceURI===Xa}function Lt(t){return t?.nodeType===11&&!!t.host}function Sr(t){return t?.nodeType===9}var gr,Va,Ga,Xa,bt=ct(()=>{"use strict";gr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Va=gr;Ga="http://www.w3.org/1999/xhtml",Xa="http://www.w3.org/2000/svg"});function Ya(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let f=Date.now();(r.get(a)||0)>f||(r.set(a,f+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function Ko(t,e,n){if(It.size>=Yo){let r=Date.now();for(let[i,o]of It)o.until<=r&&It.delete(i);for(;It.size>=Yo;)It.delete(It.keys().next().value)}It.set(t,{until:Date.now()+n,result:e})}function Ka(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Qa(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function Ja(t,e){if(!e||Ka(t)||Qa(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Za(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>zt(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}${zt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Qo(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function tc(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 Jo(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function vr(t,e){try{t.onError?.(e)}catch{}}async function it(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;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[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],S=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...S].map(w=>w.charCodeAt(0))),v=new Blob([k],{type:(g||"").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 g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qo(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.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 c;try{c=tc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return vr(e,g),g}let f=It.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&It.delete(c);let l=xr.get(c);if(l)return l;let u=Ja(t,i)?Za(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),d=(async()=>{try{let g=await fetch(u,{signal:h.signal,credentials:p,headers:s});if(!g.ok){let S={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&Ko(c,S,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();Xo.warnOnce(`http:${g.status}:${n}:${Jo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return vr(e,S),S}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qo(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&Ko(c,b,o),!a){let S=`${y}:${n}:${Jo(t)}`,k=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Xo.errorOnce(S,k)}return vr(e,b),b}finally{clearTimeout(m),xr.delete(c)}})();return c!==null&&xr.set(c,d),d}var Xo,xr,Yo,It,de=ct(()=>{"use strict";bt();Xo=Ya("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),xr=new Map,Yo=50,It=new Map});async function pe(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ve(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??te(t);if(!r)return t;let i=br(r),o=zt(i),s=(e.useProxy||"")+"|"+o;if(N.background.has(s)){let a=N.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(N.background.set(s,a.data),`url("${a.data}")`):(N.background.set(s,null),"none")}catch{return N.background.set(s,null),"none"}}var Zo=ct(()=>{"use strict";dt();bt();de()});function sc(t){let e=t.replace(ic,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ni(t,e,n,r){for(let i=0;i5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&oc.test(s.getPropertyValue(l))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ei.test(a)||a.includes("+")||a.includes("~")))for(let c of Ar(a,",")){let f=c.trim();f&&(r.inContainer||ei.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in ti)ti[c].test(a)&&n[c].push(sc(a));if(o.styleSheet){if(!gn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let f=ni(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function gn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?ni(i,e,n,r):!1}function Cr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function ri(t){let e=new Set;return gn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Ar(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s"||u==="+"||u==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function oi(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function cc(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=oi(n,o)}return r}function ii(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(kr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let f of t.styleSheets)if(!gn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!gn(f,n,r,i))return e}typeof t.getAnimations=="function"&&Cr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=oi(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:ac(f)})),c=new Set(nc);for(let f of ec)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:cc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var kr,ec,nc,rc,oc,ti,ic,ei,yn=ct(()=>{"use strict";kr=["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"],ec=["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"],nc=["display","width","height","min-width","min-height"],rc=/::?(?:before|after|first-letter|first-line|marker)/,oc=/%|\bauto\b|calc\(|var\(/i,ti={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},ic=/::?(?:before|after|first-letter|first-line|marker)\b/g;ei=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function J(t){return si.add(t),t.setAttribute("data-snapdom-internal",""),t}function jt(t){return si.has(t)}var si,wt=ct(()=>{"use strict";si=new WeakSet});function _r(t){if(t=String(t).toLowerCase(),Ge.has(t)){let o={};return N.defaultStyle.set(t,o),o}if(N.defaultStyle.has(t))return N.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);e||(e=document.createElement("div"),J(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 r=getComputedStyle(n),i={};for(let o of r){if(he(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of kr)!(o in i)&&!he(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),N.defaultStyle.set(t,i),i}function he(t){let e=ai.get(t);if(e===void 0){let n=String(t).toLowerCase();e=uc.has(n)||fc.test(n)||lc.test(n),ai.set(t,e)}return e}function li(t,e){let n=gc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function bn(t,e){return!pc.has(t)&&(e==="inline"||dc.has(t)||ci.has(t))}function Er(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ci.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!bc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ge.has(e))return"";let i=[],o=_r(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=bn(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",l=f==="nowrap"||f==="pre",p=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(he(m)||li(m,t))continue;let d=t[m];if(p){if(hc.has(m))continue;if(mc.has(m)){d&&d!==o[m]&&(i.push(`${m}:${d}`),d!=="auto"&&(h=!0));continue}}if(d&&d!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&d.endsWith("px")&&d.includes(".")){let g=parseFloat(d);if(Number.isFinite(g)){i.push(`${m}:${(g+yc).toFixed(3)}px`);continue}}i.push(`${m}:${d}`)}}if(p&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Rr(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 Fr(t,e=null){let n=new Map;for(let s of t){let a=_r(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!li(p,a)).map(([p,h])=>`${p}:${h};`).sort(),u=l.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:l}),n.get(u).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} } `}for(let{tagList:s,declarations:a}of r){let c=r.length>1?a.filter(l=>!i.has(l)):a;if(!c.length)continue;let f=c.join("");o+=`${s.join(",")} { ${f} } -`}return o}function Xe(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function wc(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 r=0;r{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=P.computedStyle.get(t);r||(r=new Map,P.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=wc(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}i=s||n(),r.set(e,i)}return i}function ge(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of Sc){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function jt(t){let e=[],n=0,r=0;for(let i=0;i{"use strict";dt();yn();wt();Mr=new Set(["meta","script","noscript","title","link","template"]),Ge=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"]);lc=/(?:^|-)(animation|transition)(?:-|$)/i,fc=/^(--.+|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,uc=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"]),si=new Map;dc=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ai=new Set(["table","thead","tbody","tfoot","tr","td","th"]),pc=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),hc=new Set(["width","max-width","inline-size","max-inline-size"]),mc=new Set(["min-width","min-inline-size"]),gc=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"}));yc=.001;bc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);Sc=["top","right","bottom","left"]});function pt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function fi(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?xc:li),n=null,r={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let o=()=>{n=null,r.yielded=!0,e=performance.now()+li,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function Ye(){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"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),f=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||c||f}function Vt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var li,xc,St=ct(()=>{"use strict";li=16,xc=40});function D(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}function xt(t,e,n,r){let i=t&&t.warnings;i&&i.length{"use strict";vc=50});var ht=ct(()=>{"use strict";Jo();ye();St();bt();te()});var Wa={};je(Wa,{decodeSvgFromDataURL:()=>un,encodeSvgToDataURL:()=>dn,fixSafariShadows:()=>ur,toCanvas:()=>fe});function Hu(t,e){try{let n=t.match(/]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,Kt/i,Kt/o,Math.sqrt(Wo/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),c=Math.max(1,Math.floor(o*s));return xt(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${c}px`),console.warn(`[snapDOM] Capture ${Math.round(i)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${Kt}px/side); downscaling to ${a}\xD7${c}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return t}}function zu(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let r=t.match(/]*>/i);if(!r)throw new Error("[snapdom] cannot crop a non-SVG capture");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[a,c,f,l]=s,u=Math.max(a,n[0]),p=Math.max(c,n[1]),m=Math.min(a+f,n[0]+n[2]),d=Math.min(c+l,n[1]+n[3]);if(!(m>u)||!(d>p))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let h=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(h)&&h>0?h/f:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(m-u)*y),k=Math.max(1,(d-p)*b),x=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${k}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${p} ${m-u} ${d-p}`);return t.replace(i,x)}function Ta(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function un(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function ju(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 dn(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function La(t){let e=[],n="",r=0;for(let i=0;ii.trim()).filter(Boolean)}function Vu(t){let e=[],n="",r=0;for(let o=0;o`${a}:${c}`).join(";")}function qu(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Ia(r)}}`)}function Gu(t){return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,qu(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Ia(r)}${n}`),t}function Xu(){return cr||(cr=(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 r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),cr)}function Yu(t){let e=[],n=0,r=0;for(let i=0;i{let o=0,s=0,a="",c=0;for(;cLa(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Yu(i.slice(o+1))}`:i}).join(";");return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function ur(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await Xu();try{let i=t;return n||(i=Gu(i)),r&&(i=Ku(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Qu(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i0)return!0;return!1}:null}async function Ju(t,e,n){J(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await lr(),await lr(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await lr()}}finally{try{t.remove()}catch{}}}function $a(t){if(typeof document>"u"||!document.body)return new Image;if(Tt&&!Tt.contentDocument){try{Tt.remove()}catch{}Tt=null}if(Tt&&Lo>Zu&&fr===0){try{Tt.remove()}catch{}Tt=null}if(!Tt){let n=document.createElement("iframe");J(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)Tt=n,Lo=0;else{try{n.remove()}catch{}return new Image}}Lo+=t.length,fr+=1;let e=Tt.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Io(t){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,fr=Math.max(0,fr-1))}function Pa(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function od(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,rd.some(a=>s.includes(a))||i++}return i*2>r}function Na(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>td&&!od(i)?Math.min(nd,Math.ceil(o/ed)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,c=e.naturalHeight/r;for(let f=0;f]*>/i)||[])[0]||"",h=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(h)&&Number.isFinite(g)&&h>0&&g>0&&Math.min(1,Kt/h,Kt/g,Math.sqrt(Wo/(h*g)))<1;if(c||y||Y())try{let b=un(t);if(c&&(b=zu(b,c)),Y()){let w=await ur(b);b=w.svg,u=w.naturalOnly,p=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Hu(b,e.__session)),l=dn(b)}catch(b){if(c)throw b;l=t}}let m=f||$a(l);try{f||await Pa(m,l)}catch(d){if(!m.__snapdomDecodeFrame)throw d;Io(m),m=$a(l);try{await Pa(m,l)}catch(h){throw Io(m),h}}try{let d=Y()&&!f?Qu():null,h=!1;d&&(h=await Ju(m,p,d));let g=f?f.width:m.naturalWidth,y=f?f.height:m.naturalHeight,b=c?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=c?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,k,x,S=Number.isFinite(n),A=Number.isFinite(r);if(S&&A)k=Math.max(1,n),x=Math.max(1,r);else if(S){let N=n/Math.max(1,b);k=n,x=w*N}else if(A){let N=r/Math.max(1,w);x=r,k=b*N}else{let N=f&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);k=N?s.vbW:g,x=N?s.vbH:y}!S&&!A&&(k=k*i,x=x*i);let v=k*o,M=x*o,C=Math.max(v/Kt,M/Kt,Math.sqrt(v*M/Wo));C>1&&(xt(e.__session,"canvas-clamp",`output ${Math.round(v)}x${Math.round(M)}px exceeds canvas limits; downscaled`),console.warn(`[snapDOM] Output ${Math.round(v)}\xD7${Math.round(M)}px exceeds the browser canvas limit (${Kt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),k/=C,x/=C);let R=kt(e.canvas)&&rt(e.canvas,"canvas")?e.canvas:document.createElement("canvas");R.width=Math.max(1,k*o),R.height=Math.max(1,x*o),R.style.width=`${k}px`,R.style.height=`${x}px`;let _=R.getContext("2d");if(!_)throw new Error("[snapdom] toCanvas: the target canvas has no 2d context");let T=()=>{if(o!==1&&_.scale(o,o),a&&(_.save(),_.fillStyle=a,_.fillRect(0,0,k,x),_.restore()),u&&(Math.round(k*o)!==g||Math.round(x*o)!==y)){let N=document.createElement("canvas");N.width=g,N.height=y,Na(N.getContext("2d"),m,g,y,l),_.drawImage(N,0,0,k,x)}else _.save(),_.setTransform(1,0,0,1,0,0),Na(_,m,k*o,x*o,l),_.restore()};if(T(),d&&h&&p){let N=!0;try{N=d(m)}catch{}if(!N){let O=performance.now()+600;do{await lr();try{N=d(m)}catch{break}}while(!N&&performance.now(){"use strict";St();te();bt();wt();Kt=Y()?16384:32767,Wo=16384*16384;cr=null;lr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Zu=24*1024*1024,Tt=null,Lo=0,fr=0;td=4e6,ed=2e6,nd=8,rd=["%3C","%3E","%20","%7B","%7D","%3B"]});var pn={};je(pn,{rasterize:()=>Oo});async function Oo(t,e){let n=await fe(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let c=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(f=>{if(!f)return c();let l=new FileReader;l.onload=()=>a(String(l.result||"")),l.onerror=c,l.readAsDataURL(f)},`image/${e.format}`,e.quality)}catch{c()}}),s=new Image;return s.src=o,Y()?await s.decode():await new Promise((a,c)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=c}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var Be=ct(()=>{"use strict";De();St()});var Do={};je(Do,{toImg:()=>id,toSvg:()=>id});async function id(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||s||a;if(Y()&&c)try{let{svg:p}=await ur(un(t)),m=(p.match(/]*>/i)||[])[0]||"",d=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),h=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(d)||!Number.isFinite(h))throw new Error("svg without dimensions");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:d,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:h,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(d*n)),w=Math.max(1,Math.round(h*n)));let k=p.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),x=new Image;return x.decoding="sync",x.loading="eager",x.src=dn(k),await x.decode(),x.style.width=`${b}px`,x.style.height=`${w}px`,x}catch(p){return xt(e.__session,"safari-png-fallback","safari vector toImg failed, falling back to PNG raster",p),D(e,"safari vector toImg failed, falling back to PNG",p),Oo(t,{...e,format:"png",quality:1,meta:o})}let f=t,l=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=un(t),m=(p.match(/]*>/i)||[])[0]||"",d=Number((m.match(/\bwidth="([\d.]+)"/i)||[])[1]),h=Number((m.match(/\bheight="([\d.]+)"/i)||[])[1]);if(d>0&&h>0){let g=m.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(d*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(h*n))}"`);f=dn(p.replace(m,g)),l=!0}}catch{}let u=new Image;u.decoding="sync",u.loading="eager",u.src=f;try{await u.decode()}catch(p){if(!l)throw p;u.src=t,l=!1,await u.decode()}if(s&&a)u.style.width=`${r}px`,u.style.height=`${i}px`;else if(s){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,m=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=r/Math.max(1,p);u.style.width=`${r}px`,u.style.height=`${Math.max(1,Math.round(m*d))}px`}else if(a){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,m=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=i/Math.max(1,m);u.style.height=`${i}px`,u.style.width=`${Math.max(1,Math.round(p*d))}px`}else{let p=Math.max(1,Math.round(u.naturalWidth*(l?1:n))),m=Math.max(1,Math.round(u.naturalHeight*(l?1:n)));if(u.style.width=`${p}px`,u.style.height=`${m}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let h=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${m}"`);u.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,await u.decode()}catch(d){D(e,"SVG width/height patch in toImg failed",d),u.src!==t&&(u.src=t,await u.decode().catch(()=>{}))}}return u}var Bo=ct(()=>{"use strict";ht();te();Be();De()});var Oa={};je(Oa,{toBlob:()=>Uo});async function Uo(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[snapdom] toBlob: engine:'html-in-canvas' produces a raster capture; ask for png/jpeg/webp");let i=decodeURIComponent(t.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await fe(t,e);return new Promise(i=>r.toBlob(o=>i(o),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Ho=ct(()=>{"use strict";De()});var Ba={};je(Ba,{download:()=>sd});async function Da(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(r){if(r.name!=="AbortError")return!1}return!0}async function sd(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",c=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,f={...e||{},format:s,type:s};f.dpr=1;let l=Ye();if(s==="svg"){let m=await Uo(t,{...f,type:"svg"});if(l&&await Da(m,c))return;let d=URL.createObjectURL(m),h=document.createElement("a");h.href=d,h.download=c,document.body.appendChild(h),h.click(),URL.revokeObjectURL(d),h.remove();return}let u=await fe(t,f);if(l){let m=`image/${s}`,d=await new Promise(h=>u.toBlob(h,m,e?.quality));if(d&&await Da(d,c))return}let p=document.createElement("a");p.href=u.toDataURL(`image/${s}`,e?.quality),p.download=c,document.body.appendChild(p),p.click(),p.remove()}var Ua=ct(()=>{"use strict";Ho();De();St()});ht();ht();St();dt();yn();wt();var ee=new WeakMap,ui=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Tr=new Map,kc=2e3,we=0;function Rt(){we++}function wn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(zt(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function xn(t){for(let e of t)if(re(e))return!0;return!1}function re(t){if(wn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!wn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!wn(n)){e=!1;break}}if(e)return!1}return!0}var be=new WeakMap;function yi(t){for(let e of t){if(!re(e))continue;let n=e.target.ownerDocument||document;be.set(n,(be.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||r.getRootNode?.()?.host)be.set(r,(be.get(r)||0)+1)}}function Ze(t){let e=t.ownerDocument||document;return ve(e),(be.get(e)||0)-(be.get(t)||0)}var Ct=0;function Se(t=document){return ve(t),Ct}function Lt(){return ve(),we}function tn(t){return t?(ve(t.ownerDocument||document),vn(t,Or(t))):0}function xe(){Rt(),Ct++}var ne=new WeakMap,qt=0,Gt=0;function Cc(t){ne.set(t,++qt)}function Ir(t){if(!t||t.nodeType!==1)return;qt++,ne.set(t,qt);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 r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Pr=new WeakSet,Ke=[];function bi(t){if(!xn(t))return;yi(t),Rt();let e=new Set;for(let n of t){if(!re(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?Ir(r.host):qt++;let i=r.querySelectorAll("*");for(let o=0;o{xn(i)&&(Rt(),Ct++)},r=()=>{Rt(),Ct++};try{let i=new MutationObserver(wi);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Je.push({o:i,env:!1,doc:t})}catch{}try{let i=new MutationObserver(n);i.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Je.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{Rt();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!wn(s)&&Dr(s.ownerDocument||t)?Wr(s):Gt++};t.addEventListener("focusin",i,{capture:!0,passive:!0}),t.addEventListener("focusout",i,{capture:!0,passive:!0}),t.addEventListener("change",i,{capture:!0,passive:!0}),t.addEventListener("pointerdown",i,{capture:!0,passive:!0}),t.addEventListener("pointerup",i,{capture:!0,passive:!0}),t.addEventListener("pointercancel",i,{capture:!0,passive:!0}),t.addEventListener("keydown",i,{capture:!0,passive:!0}),t.addEventListener("keyup",i,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",i,{capture:!0,passive:!0}),t.addEventListener("toggle",i,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{Rt(),Gt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var di=new WeakMap;function pi(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=di.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(di.set(t,n),Rt(),t.nodeType===11){t.host?Ir(t.host):qt++;for(let o of t.querySelectorAll("*"))ne.set(o,qt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(Dr(e))Wr(o);else{Gt++;return}}function kn(t,e=null){if(!t)return;pi(t,t);let n=e||Ke.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)pi(r,t)}function At(){ve();try{for(let t=Je.length-1;t>=0;t--){let{o:e,env:n,doc:r}=Je[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}Nr.delete(r),Qe===r&&(Qe=null),Je.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?xn(i)&&(Rt(),Ct++):wi(i))}for(let t=Ke.length-1;t>=0;t--){let{o:e,root:n}=Ke[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Pr.delete(n),Ke.splice(t,1);continue}let r=e.takeRecords();r.length&&bi(r)}}catch{}}function oe(t){if(!(!t||t.nodeType!==1)){ee.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ee.delete(e.currentNode)}catch{}}}var Mc=["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 Ur(t){let e=ee.get(t);if(e&&Hr(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function Si(t){let e=ee.get(t);if(!e||!Hr(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var hi=new WeakMap;function Xt(t){let e=hi.get(t);if(!e||e.epoch!==we){let n=e&&e.universe;e={epoch:we,...oi(t)};let r=e.universe;if(n&&r&&n.size===r.size){let i=!0;for(let o of r)if(!n.has(o)){i=!1;break}i&&(e.universe=n)}hi.set(t,e)}return e}function xi(t){try{let e=Xt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let c=0;c{for(;Pt(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let c of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let f=mi.get(c);if((!f||f.epoch!==we)&&mi.set(c,f={epoch:we,props:ni(c)}),!f.props)return!1;for(let l of f.props)i.universe.add(l)}Cr(a.getAnimations(),i.universe)}return!0},s=o(e)&&(!t.shadowRoot||o(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=o(a.getRootNode());return s?i.universe:r.__shadowUniverse=null}function Sn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Xt(e).pseudoUniverse}var Rc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function ke(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Rc:Xt(e).pseudoGates}function Fc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=m=>{if(i[m]!==void 0||he(m)||o&&(o instanceof RegExp&&o.test(m)||typeof o=="function"&&o(m)))return;let d=t.getPropertyValue(m);d&&((m==="background-image"||m==="content")&&d.includes("url(")&&!d.includes("data:")&&(d="none"),i[m]=d)};if(r){for(let d of r)s(d);let m=n&&n.style;if(m&&m.length)for(let d=0;do==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=$c(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==void 0&&(t["-webkit-text-fill-color"]=i),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:i,enumerable:!1}))}function $c(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,c;for(;c=a.exec(o||"");){let f=c[4];(f===void 0?1:parseFloat(f)/(f.endsWith("%")?100:1))>.05&&s.push([+c[1],+c[2],+c[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function vi(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 i of Mc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function Pc(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=W(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function Nc(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!gi(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!gi(String(r).trim().toLowerCase())?!0:Ic(t,e)?n||Wc(t,e):!1}var Lc=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function gi(t){return Lc.has(t)||t.startsWith("fit-content")}function Ic(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 r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let c=W(s);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.lefti&&(i=a.right)}return i===-1/0?!1:i-r0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var Lr=new WeakMap;function Oc(t){let e=Lr.get(t);if(e)return e;let n=[];for(let r in t)n.push(r,t[r]);return e=n.join(""),Lr.set(t,e),e}function Hr(t,e){return t.env===Ct&&t.stamp===vn(e,t.hosts)}var Dc=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Bc=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Uc=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Hc(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function zc(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),i===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;i="R"}if(e.rootSeen=!0,i===-1)return e.ids.set(t,-1),-1;let o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let c=[];for(let f=0;ff[d])),Lr.set(f,u.sig+""+l.join("")+("height"in f?"":"")+("block-size"in f?"":"")));let m=Or(t);return ee.set(t,{env:Ct,stamp:vn(t,m),hosts:m,snapshot:f,embedFonts:s,excludeStyleProps:a}),f}function Vc(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:Tr,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Tr,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:t||e||{}}}var qc=/%|[\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,Gc=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Xc(t,e,n){if(!t.style||t.style.length===0)return;let r=_c(t),i=r!=null&&!qc.test(t.getAttribute("style")||"");for(let o=0;o=kc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(d,g)),s.styleMap.set(e,g)}function Yc(t,e,n){let r=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((r==="visible"||!r)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let o=f=>parseFloat(f)||0,s=t.offsetWidth-t.clientWidth-o(e.getPropertyValue("border-left-width"))-o(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-o(e.getPropertyValue("border-top-width"))-o(e.getPropertyValue("border-bottom-width")),c=(f,l)=>{let u=n[f];if(!u||!u.endsWith("px"))return;let p=parseFloat(u);Number.isFinite(p)&&(n[f]=`${Math.round((p+l)*1e3)/1e3}px`)};s>.5&&(c("width",s),c("inline-size",s)),a>.5&&(c("height",a),c("block-size",a))}function Kc(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"}function Ai(t){let e=t.parentElement;if(!e)return!1;let n=W(e).display||"";return n.includes("flex")||n.includes("grid")}function Qc(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=W(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function Jc(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=W(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function Zc(t,e,n){if(kt(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||Kc(e)||Ai(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let f=e.clip;if(f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!Qc(t))return;let l=parseFloat(e.height),u=Jc(t);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n["block-size"])}ye();var tl=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]),zr=new WeakMap,Mi=-1;function Cn(t){let e=Lt();return e!==Mi&&(zr=new WeakMap,Mi=e),_i(t)}function _i(t){let e=zr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(t.localName==="mask"||t.localName==="clipPath"?n=!1:tl.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&_i(r)}return zr.set(t,n),n}function Ei(t,e){if(t?.nodeType!==1||e?.nodeType!==1||Cn(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;so.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Ri(t,e){let n=t.currentSrc||"";if(n&&!Ce(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||Ce(s))continue;let a=o.getAttribute("type");if(a&&!gr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Ae(s,t)}catch{}i||(i=Ae(s,t))}return i}function Fi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!Ce(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!Ce(r))return r}return null}wt();function el(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 nl=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,rl=/^::?(?:before|after|first-letter)$/;function ol(t,e,n=!0,r){return Ar(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(nl);if(o&&rl.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?el(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function $i(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=ol(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Pi(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ie(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=ie(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${ie(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+ie(n.cssRules)+"}"}else e+=n.cssText+` -`;return e}function Ni(t){let e="";try{t.querySelectorAll("style").forEach(r=>{let i=null;try{i=r.sheet&&r.sheet.cssRules}catch{}e+=(i?ie(i):r.textContent||"")+` -`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=ie(r.cssRules))}catch{}}catch{}return e}function Li(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Ii(t,e,n={}){try{let r=null,i=W(t).content;if(i&&i.includes("url(")){let f=i.match(/url\(["']?([^"')]+)["']?\)/);f&&(r=f[1])}let o=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",c=r||(o?Ri(t,o):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Ae(a,t)||t.src||"";if((!c||Ce(c))&&n.resolvePicturePlaceholders!==!1){let f=Fi(t);f&&(c=f)}if(!c)return;e.getAttribute("src")!==c&&e.setAttribute("src",c),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Wi(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function il(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function Oi(t,e,n){let r=[];for(let i of e){let o=il(t,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}} -`:""}function Di(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function sl(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;isetTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function al(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function mt(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 r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}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}}function cl(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,f=t.documentElement?t.documentElement.scrollTop:0,l=0,u=0,p=0,m=0;try{let h=r&&t.body?r.getComputedStyle(t.body):null;h&&(l=(parseFloat(h.marginTop)||0)+(parseFloat(h.paddingTop)||0),u=(parseFloat(h.marginRight)||0)+(parseFloat(h.paddingRight)||0),p=(parseFloat(h.marginBottom)||0)+(parseFloat(h.paddingBottom)||0),m=(parseFloat(h.marginLeft)||0)+(parseFloat(h.paddingLeft)||0))}catch{}let d=t.createElement("style");if(d.setAttribute("data-sd-iframe-pin",""),J(d),d.textContent=`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: ${l}px ${u}px ${p}px ${m}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;}`,(t.head||t.documentElement).appendChild(d),oe(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{d.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=f)}catch{}oe(t.documentElement)}}async function jr(t,e,n){let r=await sl(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:s}=al(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires the snapdom entrypoints on options.snap \u2014 capture through snapdom(el) (set automatically) or pass options.snap.");let c={...n,scale:1,clip:null,__pinned:!0},f=cl(r,i,o),l;try{l=await a.toPng(r.documentElement,c)}finally{f()}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),lt(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(s.width)}px`),u.style.height||(u.style.height=`${Math.round(s.height)}px`),u.appendChild(l),u}function Bi(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 Ui(t){let{width:e,height:n}=mt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,c=Number.isFinite(s)&&s>0?s:n||r.height||16,f=Number.parseFloat(t.min)||0,l=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,u=Number.parseFloat(t.value),p=l-f,m=p>0&&Number.isFinite(u)?Math.min(1,Math.max(0,(u-f)/p)):.5,d="middle";try{i&&i.verticalAlign&&(d=i.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement","range"),h.style.cssText=`display:inline-block;width:${a}px;height:${c}px;vertical-align:${d};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(c)),g.setAttribute("viewBox",`0 0 ${a} ${c}`),g.style.overflow="visible",h.appendChild(g);function y(){let b=Bi(i),w=!!t.disabled,k=Math.max(2,Math.min(4,c)),x=(c-k)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),A=S/2,v=A+m*Math.max(0,a-S);g.innerHTML="";let M=(R,_,T,N)=>{let O=document.createElementNS("http://www.w3.org/2000/svg","rect");O.setAttribute("x",String(R)),O.setAttribute("y",String(x)),O.setAttribute("width",String(Math.max(0,_))),O.setAttribute("height",String(k)),O.setAttribute("rx",String(k/2)),O.setAttribute("fill",T),N&&O.setAttribute("fill-opacity",N),g.appendChild(O)};M(0,a,"#808080","0.4"),M(0,v,b);let C=document.createElementNS("http://www.w3.org/2000/svg","circle");C.setAttribute("cx",String(v)),C.setAttribute("cy",String(c/2)),C.setAttribute("r",String(A)),C.setAttribute("fill",b),g.appendChild(C),w&&g.setAttribute("opacity","0.5"),h.style.setProperty("width",`${a}px`,"important"),h.style.setProperty("height",`${c}px`,"important"),h.style.setProperty("min-width",`${a}px`,"important"),h.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:h,applyVisual:y}}function Hi(t){let{width:e,height:n}=mt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),c=Math.round(n||r.height||0),f=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),l=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,c||16),u=(t.type||"text").toLowerCase()==="checkbox",p=!!t.checked,m=!!t.indeterminate,h=Math.max(Math.min(f,l),12),g="middle";try{i&&i.verticalAlign&&(g=i.verticalAlign)}catch{}let y=document.createElement("div");y.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),y.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("width",String(h)),b.setAttribute("height",String(h)),b.setAttribute("viewBox",`0 0 ${h} ${h}`),y.appendChild(b);function w(){let k=Bi(i),x=2,S=x/2,A=h-x;if(b.innerHTML="",u){let v=document.createElementNS("http://www.w3.org/2000/svg","rect");if(v.setAttribute("x",String(S)),v.setAttribute("y",String(S)),v.setAttribute("width",String(A)),v.setAttribute("height",String(A)),v.setAttribute("rx","2"),v.setAttribute("ry","2"),v.setAttribute("fill",p?k:"none"),v.setAttribute("stroke",k),v.setAttribute("stroke-width",String(x)),b.appendChild(v),p){let M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M ${S+2} ${h/2} L ${h/2-1} ${h-S-2} L ${h-S-2} ${S+2}`),M.setAttribute("stroke","white"),M.setAttribute("stroke-width",String(Math.max(1.5,x))),M.setAttribute("fill","none"),M.setAttribute("stroke-linecap","round"),M.setAttribute("stroke-linejoin","round"),b.appendChild(M)}else if(m){let M=document.createElementNS("http://www.w3.org/2000/svg","rect"),C=Math.max(6,A-4);M.setAttribute("x",String((h-C)/2)),M.setAttribute("y",String((h-x)/2)),M.setAttribute("width",String(C)),M.setAttribute("height",String(x)),M.setAttribute("fill",k),M.setAttribute("rx","1"),b.appendChild(M)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(h/2)),v.setAttribute("cy",String(h/2)),v.setAttribute("r",String((h-x)/2)),v.setAttribute("fill",p?k:"none"),v.setAttribute("stroke",k),v.setAttribute("stroke-width",String(x)),b.appendChild(v),p){let M=document.createElementNS("http://www.w3.org/2000/svg","circle"),C=Math.max(2,(h-x*2)*.35);M.setAttribute("cx",String(h/2)),M.setAttribute("cy",String(h/2)),M.setAttribute("r",String(C)),M.setAttribute("fill","white"),b.appendChild(M)}}y.style.setProperty("width",`${h}px`,"important"),y.style.setProperty("height",`${h}px`,"important"),y.style.setProperty("min-width",`${h}px`,"important"),y.style.setProperty("min-height",`${h}px`,"important")}return w(),{el:y,applyVisual:w}}var nn=new ot(80);async function ll(t){if(P.resource?.has(t))return P.resource.get(t);if(nn.has(t))return nn.get(t);let e=(async()=>{let n=await it(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return P.resource?.set(t,n.data),n.data})();nn.set(t,e);try{let n=await e;return nn.set(t,n),n}catch(n){throw nn.delete(t),n}}var Ti=/\bblob:[^)"'\s]+/g;function An(t){return typeof t=="string"&&t.startsWith("blob:")}function fl(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 ul(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function rn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function Mn(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(h,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(h.setAttribute(g,o.get(y)),b?.())})},a=(h,g)=>{if(!h||!h.includes("blob:"))return;let y=h.match(Ti)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=h.replace(Ti,w=>o.get(w)||w);b!==h&&g(b)})}},c=rn(t,"img");for(let h of c)try{let y=h.getAttribute("src")||h.currentSrc||"";An(y)&&s(h,"src",y);let b=h.getAttribute("srcset");if(b&&b.includes("blob:")){let w=fl(b);for(let k of w)An(k.url)&&r.add(k.url);i.push(()=>{let k=!1;for(let x of w)o.has(x.url)&&(x.url=o.get(x.url),k=!0);k&&h.setAttribute("srcset",ul(w))})}}catch(g){D(n,"resolveBlobUrls for img failed",g)}let f=rn(t,"image");for(let h of f)try{let g="http://www.w3.org/1999/xlink",y=h.getAttribute("href")||h.getAttributeNS?.(g,"href");An(y)&&s(h,"href",y,()=>h.removeAttributeNS?.(g,"href"))}catch(g){D(n,"resolveBlobUrls for SVG image href failed",g)}let l=rn(t,"[style*='blob:']");for(let h of l)try{let g=h.getAttribute("style");a(g,y=>h.setAttribute("style",y))}catch(g){D(n,"replaceBlobUrls in inline style failed",g)}let u=rn(t,"style");for(let h of u)try{let g=h.textContent||"";a(g,y=>{h.textContent=y})}catch(g){D(n,"replaceBlobUrls in style tag failed",g)}let p=["poster"];for(let h of p){let g=rn(t,`[${h}^='blob:']`);for(let y of g)try{let b=y.getAttribute(h);An(b)&&s(y,h,b)}catch(b){D(n,`resolveBlobUrls for ${h} failed`,b)}}if(!r.size)return;let m=[...r],d=0;await Promise.all(Array.from({length:Math.min(4,m.length)},async()=>{for(;du&&i.push([u,p])}if(i.length===0)return null;let o=dl(r,e);if(!o)return null;i.sort((f,l)=>f[0]-l[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),c=0;for(let[f,l]of i){f>c&&a.append(s.createTextNode(n.slice(c,f)));let u=s.createElement("span");u.setAttribute("data-snapdom-selection",""),u.setAttribute("style",`all:unset;${o}`),u.textContent=n.slice(f,l),a.append(u),c=l}return cNumber.parseFloat(t)||0,pl=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function hl(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!zi.has(r)&&r!==e.backgroundColor)return r}catch{}return Vr}function qi(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",c=_n(s.paddingLeft),f=_n(s.paddingTop),l=t.clientWidth-c-_n(s.paddingRight),u=t.clientHeight-f-_n(s.paddingBottom),p=n.createElement("div");p.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of pl)p.style.setProperty(g,s.getPropertyValue(g));a?(p.style.whiteSpace="pre-wrap",p.style.overflowWrap="break-word",p.style.width=`${Math.max(0,l)}px`):p.style.whiteSpace="pre";let m=n.createElement("span");m.textContent=o.slice(r,i),p.append(n.createTextNode(o.slice(0,r)),m,n.createTextNode(o.slice(i))),n.body.appendChild(p);let d=[];try{let g=p.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(u-g.height)/2);let w=s.direction==="rtl",k=s.textAlign;k==="start"?k=w?"right":"left":k==="end"&&(k=w?"left":"right");let x=l-g.width;x>0&&(k==="right"?y+=x:k==="center"&&(y+=x/2))}for(let w of m.getClientRects())w.width<=0||w.height<=0||d.push({x:c+(w.left-g.left)+y,y:f+(w.top-g.top)+b,width:w.width,height:w.height})}finally{p.remove()}if(d.length===0)return;let h=hl(t,s);e.__snapdomFieldSelection={images:d.map(()=>`linear-gradient(${h},${h})`),positions:d.map(g=>`${g.x}px ${g.y}px`),sizes:d.map(g=>`${g.width}px ${g.height}px`),repeats:d.map(()=>"no-repeat"),origins:d.map(()=>"padding-box"),clips:d.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function Gi(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:c,base:f}=n,l=e.style.backgroundImage||f.image;l&&l!=="none"?(r.push(l),i.push(e.style.backgroundPosition||f.position),o.push(e.style.backgroundSize||f.size),s.push(e.style.backgroundRepeat||f.repeat),a.push(e.style.backgroundOrigin||f.origin),c.push(e.style.backgroundClip||f.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(f.origin||"padding-box"),c.push(f.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=c.join(",")}}wt();var qr=new Map,Xi=new Set(["IFRAME"]);function Me(t,e){qr.set(String(t).toUpperCase(),e)}function En(t){let e=W(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=m=>parseFloat(m)||0,o=(m,d,h,g,y)=>{if(!r||!m?.endsWith("px"))return null;let b=parseFloat(m);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-h;return b+d+h+(w>0&&b+d=e.left-Rn&&t.left<=e.right+Rn&&t.bottom>=e.top-Rn&&t.top<=e.bottom+Rn}function gl(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=W(t);if(r.display==="inline"&&!ml.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},c=r.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),Yi(a,i))return!1;let f=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;f.nextNode();){let l=f.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&Yi(l,i))return!1}return!0}function yl(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),lt(t,r,e,n);let{width:i,height:o}=mt(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?W(t.parentElement).display:"",a=W(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let c=p=>{let m=W(p);return m.display!=="none"&&m.position!=="absolute"&&m.position!=="fixed"},f=t.getBoundingClientRect(),l=t.previousElementSibling;for(;l&&!c(l);)l=l.previousElementSibling;if(l){let p=f.top-l.getBoundingClientRect().bottom;p>=0&&(r.style.marginTop=`${p}px`)}let u=t.nextElementSibling;for(;u&&!c(u);)u=u.nextElementSibling;if(u){let p=u.getBoundingClientRect().top-f.bottom;p>=0&&(r.style.marginBottom=`${p}px`)}}return r.style.boxSizing="border-box",r}async function se(t,e,n){if(!t)throw new Error("Invalid node");e.slicer?.due()&&await e.slicer.pause();let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),u=zt(t);if(u&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&u||Mr.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return D(e,"Nested skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE){if(e.selection){let l=Vi(t,e.selection);if(l)return l}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return En(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let l of n.exclude)try{if(t.matches?.(l)){if(n.excludeMode==="hide")return En(t);if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${l}`,u)}if(n.excludePredicates)for(let l of n.excludePredicates)try{if(l(t))return n.excludeMode==="remove"?null:En(t)}catch(u){console.warn("Error in exclude predicate:",u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return En(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&gl(t,e.clip))return yl(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let u;try{u=await l(t,n)}catch(p){D(e,"resolveNode plugin hook failed",p)}if(u===null)return null;if(u?.nodeType)return u.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(u,t),lt(t,u,e,n)),u}{let l=Xi.has(t.tagName)&&qr.get(t.tagName);if(l){let u=await l(t,e,n);if(u!==void 0)return u}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),lt(t,l,e,n);let u=document.createElement("div");return u.textContent=t.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(u),l}{let l=!Xi.has(t.tagName)&&qr.get(t.tagName);if(l){let u=await l(t,e,n);if(u!==void 0)return u}}let s;try{if(s=t.cloneNode(!1),Ei(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Ii(t,s,n);try{let l=window.getComputedStyle(t),u=parseFloat(l.width),p=parseFloat(l.height);if(!(u>0)||!(p>0)){let h=mt(t),g=b=>parseFloat(l.getPropertyValue(b))||0,y=l.getPropertyValue("box-sizing")==="border-box";u>0||(u=h.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),p>0||(p=h.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let m=Math.round((u||0)*1e3)/1e3,d=Math.round((p||0)*1e3)/1e3;m&&(s.dataset.snapdomWidth=String(m)),d&&(s.dataset.snapdomHeight=String(d))}catch(l){D(e,"getUnscaledDimensions for IMG failed",l)}try{let l=t.getAttribute("style")||"",u=window.getComputedStyle(t),p=w=>{let k=l.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),x=k?k[1].trim():u.getPropertyValue(w);return/%|auto/i.test(String(x||""))},m=parseFloat(s.dataset.snapdomWidth||"0")||0,d=parseFloat(s.dataset.snapdomHeight||"0")||0,h=p("width")||!(m>0),g=p("height")||!(d>0);h&&m>0&&(s.style.width=`${m}px`),g&&d>0&&(s.style.height=`${d}px`);let y=u.getPropertyValue("object-fit"),b=u.getPropertyValue("object-position");y&&y!=="fill"?(s.style.objectFit=y,b&&(s.style.objectPosition=b)):(m>0&&(s.style.minWidth=`${m}px`),d>0&&(s.style.minHeight=`${d}px`))}catch(l){D(e,"IMG dimension freeze failed",l)}}}catch(l){throw console.error("[Snapdom] Failed to clone node:",t,l),l}let a=null;if(rt(t,"textarea")){let{width:l,height:u}=mt(t),p=l||t.getBoundingClientRect().width||0,m=u||t.getBoundingClientRect().height||0;p&&(s.style.width=`${p}px`),m&&(s.style.height=`${m}px`)}if(rt(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(Vt()||t.indeterminate)){let{el:p,applyVisual:m}=Hi(t);e.nodeMap.set(p,t),a=m,s=p}else if(l==="range"&&(Vt()||Y())){let{el:p,applyVisual:m}=Ui(t);e.nodeMap.set(p,t),a=m,s=p}else if(l==="color"&&Y()){let p=s,m=t.value||"#000000";a=()=>{p.style.setProperty("background-color",m,"important"),p.style.setProperty("color","transparent","important"),p.style.setProperty("-webkit-text-fill-color","transparent","important"),p.style.setProperty("appearance","none","important"),p.style.setProperty("-webkit-appearance","none","important")},p.removeAttribute("value")}else if((l==="date"||l==="time"||l==="datetime-local")&&(Vt()||Y())){s.setAttribute("type","text");let p=t.value;l==="date"&&t.valueAsDate&&(p=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=p,s.setAttribute("value",p)}else{let p=qe(t)?wr(t.value):t.value;s.value=p,s.setAttribute("value",p),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((rt(t,"input")||rt(t,"textarea"))&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),u=l&&l.color;if(u&&u!=="rgba(0, 0, 0, 0)"){let p="snapdom-ph-"+(Math.random()*1e6|0);s.classList.add(p);let m=document.createElement("style");m.textContent=`.${p}::placeholder{color:${u}!important;opacity:${l.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,s.prepend(m)}}catch{}if(rt(t,"select")&&(i=new Set(Array.from(t.options).filter(l=>l.selected))),rt(t,"textarea")&&(o=t.value),rt(t,"input")||rt(t,"textarea")||rt(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&s.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&s.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&s.setAttribute("pattern",l.pattern);let u=t.getAttribute("aria-invalid");u!==null&&s.setAttribute("aria-invalid",u)}if(Cn(t)||lt(t,s,e,n),a&&a(),n.captureSelection&&(rt(t,"input")||rt(t,"textarea")))try{qi(t,s)}catch(l){D(e,"inlineTextFieldSelection failed",l)}if(Ht(t)&&!Cn(t)){let l=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let u=window.getComputedStyle(t);for(let p of l){let m=u.getPropertyValue(p);m&&s.style.setProperty(p,m)}}catch{}}if(t.shadowRoot){Br(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let k=w.assignedNodes?.()||[];for(let x of k)r.add(x)}}catch{}let l=Pi(e),u=`[data-sd="${l}"]`;e.shadowScopes||=new WeakMap,e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let p=Ni(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(p)&&(e.__shadowPseudo=!0);let m=$i(p,u,l),d=Wi(p),h=Oi(t,d,u);Li(s,h+m,l);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:se(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),u=t.assignedNodes?.()||[],p=u.length?t.assignedNodes?.({flatten:!0})||u:[],m=p.length?p:Array.from(t.childNodes),d=document.createDocumentFragment(),h=await Promise.all(m.map(g=>se(g,e,n).then(y=>(y&&u.length&&Di(y,l),y||null)).catch(()=>null)));return d.append(...h.filter(g=>!!g)),d}let c=l=>r.has(l)||t.shadowRoot&&!l.assignedSlot,f=await Promise.all(Array.from(t.childNodes).map(l=>c(l)?null:se(l,e,n).catch(()=>null)));if(s.append(...f.filter(l=>!!l)),i&&rt(s,"select")){let l=!1;for(let u of s.options){let p=i.has(e.nodeMap.get(u));u.selected=p,p?u.setAttribute("selected",""):u.removeAttribute("selected"),l||=p}if(!l&&!s.multiple){let u=s.ownerDocument.createElement("option");u.hidden=!0,u.style.setProperty("display","none","important"),u.setAttribute("selected",""),u.value="",s.appendChild(u)}}return o!==null&&rt(s,"textarea")&&(s.textContent=o),s}async function bl(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){D(e,"iframe same-origin probe failed",i)}if(r)try{return await jr(t,e,n)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(r||console.warn("[snapdom] cross-origin