@zumer/snapdom 3.0.0 → 3.0.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/snapdom.js +10 -10
- package/dist/snapdom.mjs +10 -10
- package/package.json +3 -2
- package/types/snapdom.d.ts +11 -0
package/dist/snapdom.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* SnapDOM
|
|
3
|
-
* v3.0.0
|
|
3
|
+
* v3.0.1-dev.0
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";(()=>{var Ia=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 Be=(t,e)=>{for(var n in e)Ia(t,n,{get:e[n],enumerable:!0})};function Bo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Uo(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,ut=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 Kt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Oa(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function Ue(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of Oa(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!Wa.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:f})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function hr(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 Dt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function mr(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 He(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function gr(t){return"\u2022".repeat(String(t??"").length)}function rt(t,e){return t?.nodeType===1&&t.localName===e}function vt(t){return t?.nodeType===1&&t.namespaceURI===Da}function Bt(t){return t?.nodeType===1&&t.namespaceURI===Ba}function ue(t){return t?.nodeType===11&&!!t.host}function yr(t){return t?.nodeType===9}var pr,Wa,Da,Ba,yt=ct(()=>{"use strict";pr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Wa=pr;Da="http://www.w3.org/1999/xhtml",Ba="http://www.w3.org/2000/svg"});function Ua(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 jo(t,e,n){if(Pt.size>=zo){let r=Date.now();for(let[i,o]of Pt)o.until<=r&&Pt.delete(i);for(;Pt.size>=zo;)Pt.delete(Pt.keys().next().value)}Pt.set(t,{until:Date.now()+n,result:e})}function Ha(t){return/^data:|^blob:|^about:blank$/i.test(t)}function za(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||Ha(t)||za(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 Va(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>Dt(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}${Dt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Vo(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 qa(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 wr(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),C=new Uint8Array([...w].map(S=>S.charCodeAt(0))),x=new Blob([C],{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 Vo(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=qa(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 wr(e,g),g}let f=Pt.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Pt.delete(c);let l=br.get(c);if(l)return l;let u=ja(t,i)?Va(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,d=setTimeout(()=>h.abort("timeout"),r),m=(async()=>{try{let g=await fetch(u,{signal:h.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&&jo(c,w,o),!a){let C=`${g.status} ${g.statusText||""}`.trim();Ho.warnOnce(`http:${g.status}:${n}:${qo(t)}`,`HTTP error ${C} while fetching ${n} ${t}`)}return wr(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 Vo(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&&jo(c,b,o),!a){let w=`${y}:${n}:${qo(t)}`,C=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`;Ho.errorOnce(w,C)}return wr(e,b),b}finally{clearTimeout(d),br.delete(c)}})();return c!==null&&br.set(c,m),m}var Ho,br,zo,Pt,de=ct(()=>{"use strict";yt();Ho=Ua("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),br=new Map,zo=50,Pt=new Map});async function pe(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ue(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Kt(t);if(!r)return t;let i=mr(r),o=Dt(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 Go=ct(()=>{"use strict";ut();yt();de()});function Ja(t){let e=t.replace(Qa,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Ko(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&Ya.test(o.selectorText);for(let f=0;f<s.length;f++){let l=s[f];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&Ka.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||Yo.test(a)||a.includes("+")||a.includes("~")))for(let c of Za(a,",")){let f=c.trim();f&&(r.inContainer||Yo.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Xo)Xo[c].test(a)&&n[c].push(Ja(a));if(o.styleSheet){if(!Sr(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=Ko(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function Sr(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?Ko(i,e,n,r):!1}function Za(t,e){let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(i){a===i&&t[s-1]!=="\\"&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function tc(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let u=t[l];if(n){u===n&&t[l-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||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 Qo(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 ec(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]=Qo(n,o)}return r}function Jo(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(xr),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(!Sr(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!Sr(f,n,r,i))return e}if(typeof t.getAnimations=="function")for(let f of t.getAnimations()){let l=f.effect?.getKeyframes?.()||[];for(let u of l)for(let p of Object.keys(u))p==="offset"||p==="easing"||p==="composite"||p==="computedOffset"||n.add(p.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()))}let s=Array.from(i.shareUnsafeSels),a=Qo(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:tc(f)})),c=new Set(Xa);for(let f of Ga)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:ec(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var xr,Ga,Xa,Ya,Ka,Xo,Qa,Yo,vr=ct(()=>{"use strict";xr=["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"],Ga=["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"],Xa=["display","width","height","min-width","min-height"],Ya=/::?(?:before|after|first-letter|first-line|marker)/,Ka=/%|\bauto\b|calc\(|var\(/i,Xo={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Qa=/::?(?:before|after|first-letter|first-line|marker)\b/g;Yo=/:(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 Zo.add(t),t.setAttribute("data-snapdom-internal",""),t}function Ut(t){return Zo.has(t)}var Zo,bt=ct(()=>{"use strict";Zo=new WeakSet});function Cr(t){if(t=String(t).toLowerCase(),ze.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(Ut);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 xr)!(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=ti.get(t);if(e===void 0){let n=String(t).toLowerCase();e=oc.has(n)||rc.test(n)||nc.test(n),ti.set(t,e)}return e}function ni(t,e){let n=lc.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 dn(t,e){return!sc.has(t)&&(e==="inline"||ic.has(t)||ei.has(t))}function Ar(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ei.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:!uc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),ze.has(e))return"";let i=[],o=Cr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=dn(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 d in t){if(he(d)||ni(d,t))continue;let m=t[d];if(p){if(ac.has(d))continue;if(cc.has(d)){m&&m!==o[d]&&(i.push(`${d}:${m}`),m!=="auto"&&(h=!0));continue}}if(m&&m!==o[d]){if(!l&&(d==="width"||d==="inline-size")&&m.endsWith("px")&&m.includes(".")){let g=parseFloat(m);if(Number.isFinite(g)){i.push(`${d}:${(g+fc).toFixed(3)}px`);continue}}i.push(`${d}:${m}`)}}if(p&&!a&&!r&&!h){let d=t.width;d&&d!=="auto"&&d!==o.width&&i.push(`min-width:${d}`)}return i.sort(),i.join(";")}function Mr(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 Er(t,e=null){let n=new Map;for(let s of t){let a=Cr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!ni(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??(i=new Set);let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
6
|
+
"use strict";(()=>{var Ha=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 Ue=(t,e)=>{for(var n in e)Ha(t,n,{get:e[n],enumerable:!0})};function Uo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Ho(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,ut=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 ja(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function He(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of ja(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!za.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:f})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function mr(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 gr(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 ze(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function yr(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===Va}function Ht(t){return t?.nodeType===1&&t.namespaceURI===qa}function Pt(t){return t?.nodeType===11&&!!t.host}function br(t){return t?.nodeType===9}var hr,za,Va,qa,yt=ct(()=>{"use strict";hr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,za=hr;Va="http://www.w3.org/1999/xhtml",qa="http://www.w3.org/2000/svg"});function Ga(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 Vo(t,e,n){if(Nt.size>=jo){let r=Date.now();for(let[i,o]of Nt)o.until<=r&&Nt.delete(i);for(;Nt.size>=jo;)Nt.delete(Nt.keys().next().value)}Nt.set(t,{until:Date.now()+n,result:e})}function Xa(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Ya(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 Ka(t,e){if(!e||Xa(t)||Ya(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 Qa(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 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 Ja(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 Go(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Sr(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 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=Ja(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 Sr(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=wr.get(c);if(l)return l;let u=Ka(t,i)?Qa(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&&Vo(c,w,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();zo.warnOnce(`http:${g.status}:${n}:${Go(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return Sr(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 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=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&&Vo(c,b,o),!a){let w=`${y}:${n}:${Go(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`;zo.errorOnce(w,k)}return Sr(e,b),b}finally{clearTimeout(d),wr.delete(c)}})();return c!==null&&wr.set(c,h),h}var zo,wr,jo,Nt,de=ct(()=>{"use strict";yt();zo=Ga("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),wr=new Map,jo=50,Nt=new Map});async function pe(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=He(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zt(t);if(!r)return t;let i=gr(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 Xo=ct(()=>{"use strict";ut();yt();de()});function oc(t){let e=t.replace(rc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Qo(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&ec.test(o.selectorText);for(let f=0;f<s.length;f++){let l=s[f];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&nc.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||Ko.test(a)||a.includes("+")||a.includes("~")))for(let c of ic(a,",")){let f=c.trim();f&&(r.inContainer||Ko.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Yo)Yo[c].test(a)&&n[c].push(oc(a));if(o.styleSheet){if(!hn(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=Qo(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function hn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?Qo(i,e,n,r):!1}function vr(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 Jo(t){let e=new Set;return hn(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 ic(t,e){let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(i){a===i&&t[s-1]!=="\\"&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function sc(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let u=t[l];if(n){u===n&&t[l-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||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 Zo(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 ac(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]=Zo(n,o)}return r}function ti(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(xr),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(!hn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!hn(f,n,r,i))return e}typeof t.getAnimations=="function"&&vr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=Zo(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:sc(f)})),c=new Set(tc);for(let f of Za)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:ac(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var xr,Za,tc,ec,nc,Yo,rc,Ko,kr=ct(()=>{"use strict";xr=["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"],Za=["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"],tc=["display","width","height","min-width","min-height"],ec=/::?(?:before|after|first-letter|first-line|marker)/,nc=/%|\bauto\b|calc\(|var\(/i,Yo={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},rc=/::?(?:before|after|first-letter|first-line|marker)\b/g;Ko=/:(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 ei.add(t),t.setAttribute("data-snapdom-internal",""),t}function zt(t){return ei.has(t)}var ei,bt=ct(()=>{"use strict";ei=new WeakSet});function Ar(t){if(t=String(t).toLowerCase(),je.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 xr)!(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=ni.get(t);if(e===void 0){let n=String(t).toLowerCase();e=fc.has(n)||lc.test(n)||cc.test(n),ni.set(t,e)}return e}function oi(t,e){let n=mc.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 mn(t,e){return!dc.has(t)&&(e==="inline"||uc.has(t)||ri.has(t))}function Mr(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ri.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:!yc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),je.has(e))return"";let i=[],o=Ar(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=mn(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)||oi(d,t))continue;let h=t[d];if(p){if(pc.has(d))continue;if(hc.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+gc).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 _r(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 Er(t,e=null){let n=new Map;for(let s of t){let a=Ar(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!oi(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??(i=new Set);let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
7
7
|
`}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} }
|
|
8
|
-
`}return o}function je(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 dc(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<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function W(t,e=null){let n=()=>{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=dc(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 pc){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 Ht(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var kr,ze,nc,rc,oc,ti,ic,ei,sc,ac,cc,lc,fc,uc,pc,ye=ct(()=>{"use strict";ut();vr();bt();kr=new Set(["meta","script","noscript","title","link","template"]),ze=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"]);nc=/(?:^|-)(animation|transition)(?:-|$)/i,rc=/^(--.+|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,oc=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"]),ti=new Map;ic=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ei=new Set(["table","thead","tbody","tfoot","tr","td","th"]),sc=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),ac=new Set(["width","max-width","inline-size","max-inline-size"]),cc=new Set(["min-width","min-inline-size"]),lc=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"}));fc=.001;uc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);pc=["top","right","bottom","left"]});function dt(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 Ve(){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 zt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var kt=ct(()=>{"use strict"});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 wt(t,e,n,r){let i=t&&t.warnings;i&&i.length<hc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var hc,Qt=ct(()=>{"use strict";hc=50});var pt=ct(()=>{"use strict";Go();ye();kt();yt();Qt()});var Ra={};Be(Ra,{decodeSvgFromDataURL:()=>an,encodeSvgToDataURL:()=>cn,fixSafariShadows:()=>cr,toCanvas:()=>le});function Pu(t,e){try{let n=t.match(/<svg\b[^>]*>/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,Gt/i,Gt/o,Math.sqrt($o/(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 wt(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 (${Gt}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 Nu(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(/<svg\b[^>]*>/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]),h=Math.min(a+f,n[0]+n[2]),d=Math.min(c+l,n[1]+n[3]);if(!(h>u)||!(d>p))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(m)&&m>0?m/f:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(h-u)*y),C=Math.max(1,(d-p)*b),x=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${C}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${p} ${h-u} ${d-p}`);return t.replace(i,x)}function ka(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function an(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Lu(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 cn(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ea(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function Iu(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",f="0px"]=s;f=`${parseFloat(f)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${f}${u?` ${l}`:""})`)}return i.join(" ")}function _a(t){let e=Ea(t),n=null,r=null,i=null,o=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let f=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();f==="box-shadow"?i=l:f==="filter"?n=l:f==="-webkit-filter"?r=l:o.push([f,l])}if(i){let a=Iu(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function Wu(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${_a(r)}}`)}function Ou(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Wu(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${_a(r)}${n}`),t}function Du(){return ir||(ir=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',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}}})(),ir)}function Bu(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let f=i[c];if(f==="("?o++:f===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=f,c++}return a}).join(",")}function Uu(t,e){let n=r=>Ea(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}:${Bu(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\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 cr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await Du();try{let i=t;return n||(i=Ou(i)),r&&(i=Uu(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Hu(){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;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function zu(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 sr(),await sr(),!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 sr()}}finally{try{t.remove()}catch{}}}function Ca(t){if(typeof document>"u"||!document.body)return new Image;if(Tt&&!Tt.contentDocument){try{Tt.remove()}catch{}Tt=null}if(Tt&&Fo>ju&&ar===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,Fo=0;else{try{n.remove()}catch{}return new Image}}Fo+=t.length,ar+=1;let e=Tt.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function To(t){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,ar=Math.max(0,ar-1))}function Aa(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Yu(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++,Xu.some(a=>s.includes(a))||i++}return i*2>r}function Ma(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>Vu&&!Yu(i)?Math.min(Gu,Math.ceil(o/qu)):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<s;f++){let l=Math.round(f*r/s),u=f===s-1?r:Math.round((f+1)*r/s);t.drawImage(e,0,l*c,a,(u-l)*c,0,l,n,u-l)}}async function le(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,f=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,u=!1,p=!1;if(c&&!ka(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(ka(t)){let d=(Lu(t).match(/<svg\b[^>]*>/i)||[])[0]||"",m=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(m)&&Number.isFinite(g)&&m>0&&g>0&&Math.min(1,Gt/m,Gt/g,Math.sqrt($o/(m*g)))<1;if(c||y||Y())try{let b=an(t);if(c&&(b=Nu(b,c)),Y()){let w=await cr(b);b=w.svg,u=w.naturalOnly,p=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Pu(b,e.__session)),l=cn(b)}catch(b){if(c)throw b;l=t}}let h=f||Ca(l);try{f||await Aa(h,l)}catch(d){if(!h.__snapdomDecodeFrame)throw d;To(h),h=Ca(l);try{await Aa(h,l)}catch(m){throw To(h),m}}try{let d=Y()&&!f?Hu():null,m=!1;d&&(m=await zu(h,p,d));let g=f?f.width:h.naturalWidth,y=f?f.height:h.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,C,x,S=Number.isFinite(n),A=Number.isFinite(r);if(S&&A)C=Math.max(1,n),x=Math.max(1,r);else if(S){let N=n/Math.max(1,b);C=n,x=w*N}else if(A){let N=r/Math.max(1,w);x=r,C=b*N}else{let N=f&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);C=N?s.vbW:g,x=N?s.vbH:y}!S&&!A&&(C=C*i,x=x*i);let v=C*o,M=x*o,k=Math.max(v/Gt,M/Gt,Math.sqrt(v*M/$o));k>1&&(wt(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 (${Gt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),C/=k,x/=k);let R=vt(e.canvas)&&rt(e.canvas,"canvas")?e.canvas:document.createElement("canvas");R.width=Math.max(1,C*o),R.height=Math.max(1,x*o),R.style.width=`${C}px`,R.style.height=`${x}px`;let E=R.getContext("2d");if(!E)throw new Error("[snapdom] toCanvas: the target canvas has no 2d context");let T=()=>{if(o!==1&&E.scale(o,o),a&&(E.save(),E.fillStyle=a,E.fillRect(0,0,C,x),E.restore()),u&&(Math.round(C*o)!==g||Math.round(x*o)!==y)){let N=document.createElement("canvas");N.width=g,N.height=y,Ma(N.getContext("2d"),h,g,y,l),E.drawImage(N,0,0,C,x)}else E.save(),E.setTransform(1,0,0,1,0,0),Ma(E,h,C*o,x*o,l),E.restore()};if(T(),d&&m&&p){let N=!0;try{N=d(h)}catch{}if(!N){let O=performance.now()+600;do{await sr();try{N=d(h)}catch{break}}while(!N&&performance.now()<O);R.width=R.width,T()}}return R}finally{To(h)}}var Gt,$o,ir,sr,ju,Tt,Fo,ar,Vu,qu,Gu,Xu,Le=ct(()=>{"use strict";kt();Qt();yt();bt();Gt=Y()?16384:32767,$o=16384*16384;ir=null;sr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});ju=24*1024*1024,Tt=null,Fo=0,ar=0;Vu=4e6,qu=2e6,Gu=8,Xu=["%3C","%3E","%20","%7B","%7D","%3B"]});var ln={};Be(ln,{rasterize:()=>Po});async function Po(t,e){let n=await le(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 Ie=ct(()=>{"use strict";Le();kt()});var No={};Be(No,{toImg:()=>Ku,toSvg:()=>Ku});async function Ku(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 cr(an(t)),h=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",d=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),m=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(d)||!Number.isFinite(m))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:m,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(m*n)));let C=p.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),x=new Image;return x.decoding="sync",x.loading="eager",x.src=cn(C),await x.decode(),x.style.width=`${b}px`,x.style.height=`${w}px`,x}catch(p){return wt(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),Po(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=an(t),h=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",d=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),m=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(d>0&&m>0){let g=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(d*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(m*n))}"`);f=cn(p.replace(h,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,h=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(h*d))}px`}else if(a){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=i/Math.max(1,h);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))),h=Math.max(1,Math.round(u.naturalHeight*(l?1:n)));if(u.style.width=`${p}px`,u.style.height=`${h}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let m=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${h}"`);u.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,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 Lo=ct(()=>{"use strict";pt();Qt();Ie();Le()});var Fa={};Be(Fa,{toBlob:()=>Io});async function Io(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 le(t,e);return new Promise(i=>r.toBlob(o=>i(o),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Wo=ct(()=>{"use strict";Le()});var $a={};Be($a,{download:()=>Qu});async function Ta(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 Qu(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=Ve();if(s==="svg"){let h=await Io(t,{...f,type:"svg"});if(l&&await Ta(h,c))return;let d=URL.createObjectURL(h),m=document.createElement("a");m.href=d,m.download=c,document.body.appendChild(m),m.click(),URL.revokeObjectURL(d),m.remove();return}let u=await le(t,f);if(l){let h=`image/${s}`,d=await new Promise(m=>u.toBlob(m,h,e?.quality));if(d&&await Ta(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 Pa=ct(()=>{"use strict";Wo();Le();kt()});pt();pt();kt();ut();vr();bt();var Jt=new WeakMap,ri=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],_r=new Map,mc=2e3,hn=0;function _t(){hn++}function pn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Ut(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function gn(t){for(let e of t)if(te(e))return!0;return!1}function te(t){if(pn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!pn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!pn(n)){e=!1;break}}if(e)return!1}return!0}var be=new WeakMap;function ci(t){for(let e of t){if(!te(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 yn(t){let e=t.ownerDocument||document;return xe(e),(be.get(e)||0)-(be.get(t)||0)}var Ct=0;function we(t=document){return xe(t),Ct}function ee(){return xe(),hn}function Ye(t){return t?(xe(t.ownerDocument||document),bn(t,Lr(t))):0}function Se(){_t(),Ct++}var Zt=new WeakMap,jt=0,Vt=0;function gc(t){Zt.set(t,++jt)}function Pr(t){if(!t||t.nodeType!==1)return;jt++,Zt.set(t,jt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)Zt.set(e[n],jt)}function Nr(t){Pr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)gc(e)}function bn(t,e=null){let n=Zt.get(t)||0;if(e)for(let r of e)n=Math.max(n,Zt.get(r)||0);return Vt*1e9+n}function Lr(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Wr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Rr=new WeakMap;function Ir(t){t=t||document;let e=Rr.get(t);if(!e||e.env!==Ct){let n=!0;try{n=re(t).usesHas}catch{}e={env:Ct,usesHas:n},Rr.set(t,e)}return!e.usesHas}function yc(t){let e=n=>n?.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 Fr=new WeakSet,qe=[];function li(t){if(!gn(t))return;ci(t),_t();let e=new Set;for(let n of t){if(!te(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?Pr(r.host):jt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)Zt.set(i[o],jt)}}function Wr(t){if(!(!t||Fr.has(t))){Fr.add(t);try{let e=new MutationObserver(li);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),qe.push({o:e,root:t})}catch{}}}function fi(t){if(!gn(t))return;ci(t),_t();let e=yc(t);if(e){Rr.delete(e),Ct++,Vt++;return}let n=new Set;for(let r of t){if(!te(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!Ir(o)){Vt++;return}if(i===o.documentElement||i===o.body){Vt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),Nr(i))}}var Tr=new WeakSet,Ge=null,Xe=[];function xe(t=document){if(t===Ge||!t||t.nodeType!==9)return;if(Tr.has(t)){Ge=t;return}Tr.add(t),Ge=t;let e=t.defaultView,n=i=>{gn(i)&&(_t(),Ct++)},r=()=>{_t(),Ct++};try{let i=new MutationObserver(fi);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Xe.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}),Xe.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{_t();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!pn(s)&&Ir(s.ownerDocument||t)?Nr(s):Vt++};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",()=>{_t(),Vt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var oi=new WeakMap;function ii(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=oi.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(oi.set(t,n),_t(),t.nodeType===11){t.host?Pr(t.host):jt++;for(let o of t.querySelectorAll("*"))Zt.set(o,jt);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(Ir(e))Nr(o);else{Vt++;return}}function wn(t,e=null){if(!t)return;ii(t,t);let n=e||qe.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)ii(r,t)}function Rt(){xe();try{for(let t=Xe.length-1;t>=0;t--){let{o:e,env:n,doc:r}=Xe[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}Tr.delete(r),Ge===r&&(Ge=null),Xe.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?gn(i)&&(_t(),Ct++):fi(i))}for(let t=qe.length-1;t>=0;t--){let{o:e,root:n}=qe[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Fr.delete(n),qe.splice(t,1);continue}let r=e.takeRecords();r.length&&li(r)}}catch{}}function ne(t){if(!(!t||t.nodeType!==1)){Jt.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)Jt.delete(e.currentNode)}catch{}}}var bc=["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 Or(t){let e=Jt.get(t);if(e&&Dr(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function ui(t){let e=Jt.get(t);if(!e||!Dr(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var si=new WeakMap;function re(t){let e=si.get(t);return(!e||e.epoch!==hn)&&(e={epoch:hn,...Jo(t)},si.set(t,e)),e}function di(t){try{let e=re(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<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function wc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:re(e).importantProps}function Ke(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:re(e).universe}function mn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:re(e).pseudoUniverse}var Sc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function ve(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Sc:re(e).pseudoGates}function xc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||he(h)||o&&(o instanceof RegExp&&o.test(h)||typeof o=="function"&&o(h)))return;let d=t.getPropertyValue(h);d&&((h==="background-image"||h==="content")&&d.includes("url(")&&!d.includes("data:")&&(d="none"),i[h]=d)};if(r){for(let d of r)s(d);let h=n&&n.style;if(h&&h.length)for(let d=0;d<h.length;d++)s(h[d])}else for(let h=0;h<t.length;h++)s(t[h]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let h of a)if(!i[h])try{let d=t.getPropertyValue(h);d&&(i[h]=d)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let h of c)if(!i[h])try{let d=t.getPropertyValue(h);d&&(i[h]=d)}catch{}if(e.embedFonts){let h=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of h)if(!i[d])try{let m=t.getPropertyValue(d);m&&(i[d]=m)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:pi(t),enumerable:!1});let f=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,p=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(f===0&&l===0&&u===0&&p===0){let h=(t.getPropertyValue("border-image-source")||"").trim(),d=h&&h!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of m)delete i[g];d||(i.border="none")}return vc(i),i}function vc(t){if(!zt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=kc(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 kc(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 pi(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 bc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function Cc(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 Ac(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!ai(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!ai(String(r).trim().toLowerCase())?!0:Ec(t,e)?n||_c(t,e):!1}var Mc=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function ai(t){return Mc.has(t)||t.startsWith("fit-content")}function Ec(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.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function _c(t,e){let n=t.parentElement;if(!n)return!1;let r=W(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var $r=new WeakMap;function Rc(t){let e=$r.get(t);if(e)return e;let n=[];for(let r in t)n.push(r,t[r]);return e=n.join(""),$r.set(t,e),e}function Dr(t,e){return t.env===Ct&&t.stamp===bn(e,t.hosts)}var Fc=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Tc=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,$c=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Pc(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function Nc(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;f<s.length;f++)c.push(s[f].name+"="+s[f].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function hi(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=re(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&Tc.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),f=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",u=[];for(let d in r)(Fc.test(d)||f&&(d==="grid-template-columns"||d==="grid-template-rows")||l&&d==="transform"||a&&d.charCodeAt(0)===109&&d.startsWith("margin-")||c&&d.charCodeAt(0)===112&&d.startsWith("padding-"))&&u.push(d);t.h&&!("height"in r)&&u.push("height"),t.b&&!("block-size"in r)&&u.push("block-size");let p=new Set(u),h=[];for(let d in r)p.has(d)||h.push(d,r[d]);return t.rr=u,t.sig=h.join("")+""+u.join(""),u}function mi(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return ge(n,mn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),f=c.get(a);if(f){let u={...f.snap},p=f.rr||hi(f,t);for(let h=0;h<p.length;h++){let d=n.getPropertyValue(p[h]);d?u[p[h]]=d:delete u[p[h]]}return u}let l=ge(n,mn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function Lc(t,e=null,n={},r=null){let i=Jt.get(t),o=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(typeof s!="function"&&i&&Dr(i,t)&&i.embedFonts===o&&i.excludeStyleProps===s)return i.snapshot;let a=e||getComputedStyle(t),c,f=null,l=r&&r.st.snaps.get(r.id);if(l){c={...l.snap};let h=l.rr||hi(l,t);f=[];for(let d=0;d<h.length;d++){let m=h[d],g=a.getPropertyValue(m);g?c[m]=g:delete c[m],f.push(g)}Object.defineProperty(c,"__needsBgInline",{value:l.snap.__needsBgInline,enumerable:!1}),l.snap.__bgClipTextFix!==void 0&&Object.defineProperty(c,"__bgClipTextFix",{value:l.snap.__bgClipTextFix,enumerable:!1})}else c=xc(a,n,t,Ke(t)),r&&r.st.snaps.set(r.id,{snap:c,rr:null,sig:null,h:"height"in c,b:"block-size"in c});let u=!1;if(typeof t.computedStyleMap=="function"){let h;for(let d of ri)if(c[d]==="0px")try{h||(h=t.computedStyleMap()),h.get(d)?.toString()==="auto"&&(c[d]="auto",u=!0)}catch{}}jc(t,a,c),f!==null&&(u&&f.push("",...ri.map(h=>c[h])),$r.set(c,l.sig+""+f.join("")+("height"in c?"":"")+("block-size"in c?"":"")));let p=Lr(t);return Jt.set(t,{env:Ct,stamp:bn(t,p),hosts:p,snapshot:c,embedFonts:o,excludeStyleProps:s}),c}function Ic(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:_r,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:_r,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:t||e||{}}}var Wc=/%|[\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,Oc=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Dc(t,e,n){if(!t.style||t.style.length===0)return;let r=wc(t),i=r!=null&&!Wc.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&Oc(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function lt(t,e,n,r){if(t.tagName==="STYLE")return;let i=Ic(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&xe(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&(_t(),_r.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let c=s.styleCache.get(t);t.getAttribute?.("style")&&Dc(t,e,c);let f=c.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(ze.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:pi(c),enumerable:!1});let b=Lr(t);Jt.set(t,{env:Ct,stamp:bn(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let u=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=Pc(s),b=Nc(t,y),w=t.ownerDocument||document,C=w.activeElement;b!==-1&&!$c.has(t.tagName)&&!(C&&C!==w.body&&C!==w.documentElement&&C===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(u={st:y,id:b})}let p=Lc(t,c,i.options,u);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;p[b]==="auto"&&e.style.setProperty(b,"auto","important")}p.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",p.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",p.__bgClipTextFix,"important")),Bc(t,c,p);let h=gi(t);if(h){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(p["min-width"]="0px")}let d=Rc(p),m=!0;if(dn(l,(p.display||"").toLowerCase())){m=Cc(t),m&&Ar(l,p,h)&&Ac(t,c,h)&&(m=!1),d=`${d}|${l}${m?"|c":""}${h?"|f":""}`;let y=p["text-wrap-mode"]||p["white-space"]||"";m&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(d);g===void 0&&(g=me(p,l,m,h),a.snapshotKeyCache.size>=mc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(d,g)),s.styleMap.set(e,g)}function Bc(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 Uc(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 gi(t){let e=t.parentElement;if(!e)return!1;let n=W(e).display||"";return n.includes("flex")||n.includes("grid")}function Hc(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 zc(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 jc(t,e,n){if(vt(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"||Uc(e)||gi(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"||!Hc(t))return;let l=parseFloat(e.height),u=zc(t);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n["block-size"])}ye();var Vc=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]),Br=new WeakMap,yi=-1;function Sn(t){let e=ee();return e!==yi&&(Br=new WeakMap,yi=e),bi(t)}function bi(t){let e=Br.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:Vc.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&bi(r)}return Br.set(t,n),n}function wi(t,e){if(t?.nodeType!==1||e?.nodeType!==1||Sn(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;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let f=o.getPropertyValue(c);if(!f||!f.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,f=i&&i.getPropertyValue(c);if(f)try{e.style.setProperty(c,f.trim())}catch{}}}}pt();pt();ut();de();yt();function ke(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function Ce(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Si(t,e){let n=t.currentSrc||"";if(n&&!ke(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||ke(s))continue;let a=o.getAttribute("type");if(a&&!pr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Ce(s,t)}catch{}i||(i=Ce(s,t))}return i}function xi(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&&!ke(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&&!ke(r))return r}return null}bt();function qc(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 Gc=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,Xc=/^::?(?:before|after|first-letter)$/;function Yc(t,e,n=!0,r){return t.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(Gc);if(o&&Xc.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?qc(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function ki(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=Yc(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Ci(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function oe(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+=oe(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${oe(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:"")+oe(n.cssRules)+"}"}else e+=n.cssText+`
|
|
9
|
-
`;return e}function
|
|
10
|
-
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=
|
|
11
|
-
`:""}function Fi(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 Qc(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Jc(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 ht(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 Zc(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,h=0;try{let m=r&&t.body?r.getComputedStyle(t.body):null;m&&(l=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),u=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),p=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),h=(parseFloat(m.marginLeft)||0)+(parseFloat(m.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 ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(d),ne(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{}ne(t.documentElement)}}async function Ur(t,e,n){let r=await Qc(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:s}=Jc(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=Zc(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 Ti(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 $i(t){let{width:e,height:n}=ht(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,h=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 m=document.createElement("div");m.setAttribute("data-snapdom-input-replacement","range"),m.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",m.appendChild(g);function y(){let b=Ti(i),w=!!t.disabled,C=Math.max(2,Math.min(4,c)),x=(c-C)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),A=S/2,v=A+h*Math.max(0,a-S);g.innerHTML="";let M=(R,E,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,E))),O.setAttribute("height",String(C)),O.setAttribute("rx",String(C/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 k=document.createElementNS("http://www.w3.org/2000/svg","circle");k.setAttribute("cx",String(v)),k.setAttribute("cy",String(c/2)),k.setAttribute("r",String(A)),k.setAttribute("fill",b),g.appendChild(k),w&&g.setAttribute("opacity","0.5"),m.style.setProperty("width",`${a}px`,"important"),m.style.setProperty("height",`${c}px`,"important"),m.style.setProperty("min-width",`${a}px`,"important"),m.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:m,applyVisual:y}}function Pi(t){let{width:e,height:n}=ht(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,h=!!t.indeterminate,m=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:${m}px;height:${m}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(m)),b.setAttribute("height",String(m)),b.setAttribute("viewBox",`0 0 ${m} ${m}`),y.appendChild(b);function w(){let C=Ti(i),x=2,S=x/2,A=m-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?C:"none"),v.setAttribute("stroke",C),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} ${m/2} L ${m/2-1} ${m-S-2} L ${m-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(h){let M=document.createElementNS("http://www.w3.org/2000/svg","rect"),k=Math.max(6,A-4);M.setAttribute("x",String((m-k)/2)),M.setAttribute("y",String((m-x)/2)),M.setAttribute("width",String(k)),M.setAttribute("height",String(x)),M.setAttribute("fill",C),M.setAttribute("rx","1"),b.appendChild(M)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(m/2)),v.setAttribute("cy",String(m/2)),v.setAttribute("r",String((m-x)/2)),v.setAttribute("fill",p?C:"none"),v.setAttribute("stroke",C),v.setAttribute("stroke-width",String(x)),b.appendChild(v),p){let M=document.createElementNS("http://www.w3.org/2000/svg","circle"),k=Math.max(2,(m-x*2)*.35);M.setAttribute("cx",String(m/2)),M.setAttribute("cy",String(m/2)),M.setAttribute("r",String(k)),M.setAttribute("fill","white"),b.appendChild(M)}}y.style.setProperty("width",`${m}px`,"important"),y.style.setProperty("height",`${m}px`,"important"),y.style.setProperty("min-width",`${m}px`,"important"),y.style.setProperty("min-height",`${m}px`,"important")}return w(),{el:y,applyVisual:w}}var Qe=new ot(80);async function tl(t){if(P.resource?.has(t))return P.resource.get(t);if(Qe.has(t))return Qe.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})();Qe.set(t,e);try{let n=await e;return Qe.set(t,n),n}catch(n){throw Qe.delete(t),n}}var vi=/\bblob:[^)"'\s]+/g;function xn(t){return typeof t=="string"&&t.startsWith("blob:")}function el(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 nl(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Je(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function vn(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(m,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(m.setAttribute(g,o.get(y)),b?.())})},a=(m,g)=>{if(!m||!m.includes("blob:"))return;let y=m.match(vi)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=m.replace(vi,w=>o.get(w)||w);b!==m&&g(b)})}},c=Je(t,"img");for(let m of c)try{let y=m.getAttribute("src")||m.currentSrc||"";xn(y)&&s(m,"src",y);let b=m.getAttribute("srcset");if(b&&b.includes("blob:")){let w=el(b);for(let C of w)xn(C.url)&&r.add(C.url);i.push(()=>{let C=!1;for(let x of w)o.has(x.url)&&(x.url=o.get(x.url),C=!0);C&&m.setAttribute("srcset",nl(w))})}}catch(g){D(n,"resolveBlobUrls for img failed",g)}let f=Je(t,"image");for(let m of f)try{let g="http://www.w3.org/1999/xlink",y=m.getAttribute("href")||m.getAttributeNS?.(g,"href");xn(y)&&s(m,"href",y,()=>m.removeAttributeNS?.(g,"href"))}catch(g){D(n,"resolveBlobUrls for SVG image href failed",g)}let l=Je(t,"[style*='blob:']");for(let m of l)try{let g=m.getAttribute("style");a(g,y=>m.setAttribute("style",y))}catch(g){D(n,"replaceBlobUrls in inline style failed",g)}let u=Je(t,"style");for(let m of u)try{let g=m.textContent||"";a(g,y=>{m.textContent=y})}catch(g){D(n,"replaceBlobUrls in style tag failed",g)}let p=["poster"];for(let m of p){let g=Je(t,`[${m}^='blob:']`);for(let y of g)try{let b=y.getAttribute(m);xn(b)&&s(y,m,b)}catch(b){D(n,`resolveBlobUrls for ${m} failed`,b)}}if(!r.size)return;let h=[...r],d=0;await Promise.all(Array.from({length:Math.min(4,h.length)},async()=>{for(;d<h.length;){let m=h[d++];try{o.set(m,await tl(m))}catch(g){D(n,"blobUrlToDataUrl failed; keeping original URL",g)}}}));for(let m of i)try{m()}catch(g){D(n,"resolved blob URL write failed",g)}}kt();var Ni=new Set(["rgba(0, 0, 0, 0)","transparent"]),Hr="Highlight";function Li(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function rl(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!Ni.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:Hr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${Hr}`}return e.styles.set(t,n),n}function Ii(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let f of e.ranges){let l=!1;try{l=f.intersectsNode(t)}catch{}if(!l)continue;let u=f.startContainer===t?f.startOffset:0,p=f.endContainer===t?f.endOffset:n.length;p>u&&i.push([u,p])}if(i.length===0)return null;let o=rl(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 c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var kn=t=>Number.parseFloat(t)||0,ol=["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 il(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!Ni.has(r)&&r!==e.backgroundColor)return r}catch{}return Hr}function Wi(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=kn(s.paddingLeft),f=kn(s.paddingTop),l=t.clientWidth-c-kn(s.paddingRight),u=t.clientHeight-f-kn(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 ol)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 h=n.createElement("span");h.textContent=o.slice(r,i),p.append(n.createTextNode(o.slice(0,r)),h,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",C=s.textAlign;C==="start"?C=w?"right":"left":C==="end"&&(C=w?"left":"right");let x=l-g.width;x>0&&(C==="right"?y+=x:C==="center"&&(y+=x/2))}for(let w of h.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 m=il(t,s);e.__snapdomFieldSelection={images:d.map(()=>`linear-gradient(${m},${m})`),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 Oi(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(",")}}bt();var zr=new Map,Di=new Set(["IFRAME"]);function Ae(t,e){zr.set(String(t).toUpperCase(),e)}function Cn(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=h=>parseFloat(h)||0,o=(h,d,m,g,y)=>{if(!r||!h?.endsWith("px"))return null;let b=parseFloat(h);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-m;return b+d+m+(w>0&&b+d<y+w/2?w:0)},[s,a,c,f]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),u=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,f);if(l===null||u===null){let{width:h,height:d}=ht(t),m=h,g=d;if(l===null&&!m||u===null&&!g){let y=t.getBoundingClientRect();m||(m=y.width||0),g||(g=y.height||0)}l??(l=m),u??(u=g)}let p=document.createElement("div");return p.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${u}px;visibility:hidden;`,p}var An=200,sl=new Set(["img","canvas","video","iframe","object","embed"]);function Bi(t,e){return t.right>=e.left-An&&t.left<=e.right+An&&t.bottom>=e.top-An&&t.top<=e.bottom+An}function al(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"&&!sl.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)),Bi(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)&&Bi(l,i))return!1}return!0}function cl(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}=ht(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 h=W(p);return h.display!=="none"&&h.position!=="absolute"&&h.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 ie(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),u=Ut(t);if(u&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&u||kr.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return D(e,"Nested <foreignObject> 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=Ii(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 Cn(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 Cn(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:Cn(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 Cn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&al(t,e.clip))return cl(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=Di.has(t.tagName)&&zr.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=!Di.has(t.tagName)&&zr.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),wi(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Ei(t,s,n);try{let l=window.getComputedStyle(t),u=parseFloat(l.width),p=parseFloat(l.height);if(!(u>0)||!(p>0)){let m=ht(t),g=b=>parseFloat(l.getPropertyValue(b))||0,y=l.getPropertyValue("box-sizing")==="border-box";u>0||(u=m.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),p>0||(p=m.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let h=Math.round((u||0)*1e3)/1e3,d=Math.round((p||0)*1e3)/1e3;h&&(s.dataset.snapdomWidth=String(h)),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 C=l.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),x=C?C[1].trim():u.getPropertyValue(w);return/%|auto/i.test(String(x||""))},h=parseFloat(s.dataset.snapdomWidth||"0")||0,d=parseFloat(s.dataset.snapdomHeight||"0")||0,m=p("width")||!(h>0),g=p("height")||!(d>0);m&&h>0&&(s.style.width=`${h}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)):(h>0&&(s.style.minWidth=`${h}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}=ht(t),p=l||t.getBoundingClientRect().width||0,h=u||t.getBoundingClientRect().height||0;p&&(s.style.width=`${p}px`),h&&(s.style.height=`${h}px`)}if(rt(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(zt()||t.indeterminate)){let{el:p,applyVisual:h}=Pi(t);e.nodeMap.set(p,t),a=h,s=p}else if(l==="range"&&(zt()||Y())){let{el:p,applyVisual:h}=$i(t);e.nodeMap.set(p,t),a=h,s=p}else if(l==="color"&&Y()){let p=s,h=t.value||"#000000";a=()=>{p.style.setProperty("background-color",h,"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")&&(zt()||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=He(t)?gr(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 h=document.createElement("style");h.textContent=`.${p}::placeholder{color:${u}!important;opacity:${l.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,s.prepend(h)}}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(Sn(t)||lt(t,s,e,n),a&&a(),n.captureSelection&&(rt(t,"input")||rt(t,"textarea")))try{Wi(t,s)}catch(l){D(e,"inlineTextFieldSelection failed",l)}if(Bt(t)&&!Sn(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 h=u.getPropertyValue(p);h&&s.style.setProperty(p,h)}}catch{}}if(t.shadowRoot){Wr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let C=w.assignedNodes?.()||[];for(let x of C)r.add(x)}}catch{}let l=Ci(e),u=`[data-sd="${l}"]`;e.shadowScopes||(e.shadowScopes=new WeakMap),e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let p=Ai(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(p)&&(e.__shadowPseudo=!0);let h=ki(p,u,l),d=_i(p),m=Ri(t,d,u);Mi(s,m+h,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:ie(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:[],h=p.length?p:Array.from(t.childNodes),d=document.createDocumentFragment(),m=await Promise.all(h.map(g=>ie(g,e,n).then(y=>(y&&u.length&&Fi(y,l),y||null)).catch(()=>null)));return d.append(...m.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:ie(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||(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 ll(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 Ur(t,e,n)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(r||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",t),n.placeholders){let{width:i,height:o}=ht(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,lt(t,s,e,n),s}else{let{width:i,height:o}=ht(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,lt(t,s,e,n),s}}function Ze(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var fl=.95;function ul(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function dl(t,e,n){let r="";try{let a=Ze(t);a&&(await dt(),a=Ze(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}Y()&&await dt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await dt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let f=document.createElement("canvas");f.width=t.width,f.height=t.height;let l=f.getContext("2d");l&&(l.drawImage(t,0,0),r=f.toDataURL("image/png"))}}}catch(a){D(e,"Canvas toDataURL failed, using empty/fallback",a)}n&&n.debug&&r&&Ze(t)&&D(e,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){D(e,"img decoding/loading hints failed",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=ht(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),lt(t,i,e,n),i}async function pl(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let f=c.getContext("2d");f&&(f.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(ul(f,c.width,c.height)?"image/jpeg":"image/png",fl),(!r||r==="data:,")&&(r=""))}catch(c){D(e,"Video frame capture failed, using poster fallback",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=ht(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),lt(t,o,e,n),o}async function hl(t,e,n){if(!t.controls)return;let{width:r,height:i}=ht(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),f=s*.34,l=o-s*.34,u=f+c+s*.55,p=Math.max(0,l-s*.7-u),h=Math.max(9,Math.round(s*.24)),d=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-c} L ${f+c} ${a} L ${f} ${a+c} Z" fill="#5f6368"/><rect x="${u}" y="${a-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,m.width=o,m.height=s,m.style.width=`${o}px`,m.style.height=`${s}px`,e.nodeMap.set(m,t),lt(t,m,e,n),m}async function Ui(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:f}=ht(t);return c>0&&(a.style.width=`${c}px`),f>0&&(a.style.height=`${f}px`),e.nodeMap.set(a,t),lt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Ur(t,e,n);if(a)return a}catch{}r&&console.warn(`[snapdom] <${t.localName}> content could not be captured (${i||"unknown type"}): rendering its fallback children`)}Ae("IFRAME",ll);Ae("CANVAS",dl);Ae("VIDEO",pl);Ae("AUDIO",hl);Ae("OBJECT",Ui);Ae("EMBED",Ui);pt();yt();ye();ut();bt();var ml=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Me=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function gl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(gl(r),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r);return n}function At(t,e){let n=typeof t=="string"?t:"";for(let r of ml)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function jr(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return At(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>At(i,e)):At(t,e)}function yl(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Mn=new Map;function bl(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function wl(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let f=a===1,l=null;if(f&&(c==="outlined"&&Me.materialIconsFilled?l={url:Me.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Me.materialIconsRound?l={url:Me.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Me.materialIconsSharp&&(l={url:Me.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Mn.has(l.alias))try{let p=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await p.load(),document.fonts.add(p),Mn.set(l.alias,!0)}catch{return Mn.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(Mn.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Sl(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function xl(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function vl(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,f=bl(o),{familyForMeasure:l,familyForCanvas:u}=await wl(a,s,f);await Sl(u.replace(/^["']+|["']+$/g,""),r);let p=document.createElement("span");J(p),p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=l,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${r}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=i,document.body.appendChild(p);let h=p.getBoundingClientRect(),d=Math.max(1,Math.ceil(h.width)),m=Math.max(1,Math.ceil(h.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=d*c,g.height=m*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:d,height:m}}async function En(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],f=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(f||c),u=l.fontFamily||"Material Icons";if(!yl(u))continue;let p=(f||c).textContent.trim();if(!p)continue;let h=parseInt(l.fontSize,10)||24,d=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",m=xl(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(f||c).className||"",{dataUrl:b,width:w,height:C}=await vl(p,{family:u,weight:d,fontSize:h,color:m,variation:g,className:y});c.textContent="";let x=c.ownerDocument.createElement("img");x.src=b,x.alt=p,x.style.height=`${h}px`,x.style.width=`${Math.max(1,Math.round(w/C*h))}px`,x.style.objectFit="contain",x.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(x),s++}catch{}}return s}de();kt();bt();async function qi(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");J(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let c=a.getBoundingClientRect(),f=Math.ceil(c.width),l=Math.ceil(c.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,f*s),u.height=Math.max(1,l*s);let p=u.getContext("2d");return p.scale(s,s),p.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,p.textAlign="left",p.textBaseline="top",p.fillStyle=i,p.fillText(t,0,0),{dataUrl:u.toDataURL(),width:f,height:l}}var Gi=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),kl=["katex","mathjax","mathml"];function Gr(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Gi.has(n.toLowerCase()))return n}return""}function Cl(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Gi.has(r.toLowerCase())||e.push(r))}return e}function _n(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Rn(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Al(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Ml(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=_n(n[1]),o=_n(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=_n(e);return{min:r,max:r}}function El(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function _l(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Rl(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Fl(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||kl.some(c=>a.includes(c)))return!0;for(let c of e){let f=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),u=Rl(c);if(a.includes(f)||a.includes(l)||u&&a.includes(u))return!0}return!1}catch{return!1}}function Tl(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function zi(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var Xi=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Fn=4;async function $l(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,f=0){if(f>Fn)return console.warn(`[snapDOM] @import depth exceeded (${Fn}) at ${c}`),a;let l="",u=0,p,h=new RegExp(Xi.source,"g");for(;p=h.exec(a);){l+=a.slice(u,p.index),u=h.lastIndex;let d=(p[2]||p[4]||"").trim(),m=i(d,c);if(r.has(m)){console.warn(`[snapDOM] Skipping circular @import: ${m}`);continue}r.add(m);let g="";try{let y=await it(m,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=zi(g,m),g=await o(g,m,f+1),l+=`
|
|
12
|
-
/* inlined: ${
|
|
8
|
+
`}return o}function Ve(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 bc(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<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function W(t,e=null){let n=()=>{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=bc(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 wc){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<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var Cr,je,cc,lc,fc,ni,uc,ri,dc,pc,hc,mc,gc,yc,wc,ye=ct(()=>{"use strict";ut();kr();bt();Cr=new Set(["meta","script","noscript","title","link","template"]),je=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"]);cc=/(?:^|-)(animation|transition)(?:-|$)/i,lc=/^(--.+|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,fc=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"]),ni=new Map;uc=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ri=new Set(["table","thead","tbody","tfoot","tr","td","th"]),dc=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),pc=new Set(["width","max-width","inline-size","max-inline-size"]),hc=new Set(["min-width","min-inline-size"]),mc=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"}));gc=.001;yc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);wc=["top","right","bottom","left"]});function dt(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 si(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?Sc:ii),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()+ii,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function qe(){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 ii,Sc,wt=ct(()=>{"use strict";ii=16,Sc=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 St(t,e,n,r){let i=t&&t.warnings;i&&i.length<xc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var xc,te=ct(()=>{"use strict";xc=50});var pt=ct(()=>{"use strict";Xo();ye();wt();yt();te()});var La={};Ue(La,{decodeSvgFromDataURL:()=>ln,encodeSvgToDataURL:()=>fn,fixSafariShadows:()=>lr,toCanvas:()=>fe});function Bu(t,e){try{let n=t.match(/<svg\b[^>]*>/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(Po/(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 St(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 Uu(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(/<svg\b[^>]*>/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 Ra(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function ln(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Hu(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 fn(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Pa(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function zu(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",f="0px"]=s;f=`${parseFloat(f)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${f}${u?` ${l}`:""})`)}return i.join(" ")}function Na(t){let e=Pa(t),n=null,r=null,i=null,o=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let f=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();f==="box-shadow"?i=l:f==="filter"?n=l:f==="-webkit-filter"?r=l:o.push([f,l])}if(i){let a=zu(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function ju(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Na(r)}}`)}function Vu(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,ju(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Na(r)}${n}`),t}function qu(){return sr||(sr=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',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}}})(),sr)}function Gu(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let f=i[c];if(f==="("?o++:f===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=f,c++}return a}).join(",")}function Xu(t,e){let n=r=>Pa(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}:${Gu(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\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 lr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await qu();try{let i=t;return n||(i=Vu(i)),r&&(i=Xu(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Yu(){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;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function Ku(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 ar(),await ar(),!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 ar()}}finally{try{t.remove()}catch{}}}function Fa(t){if(typeof document>"u"||!document.body)return new Image;if(Tt&&!Tt.contentDocument){try{Tt.remove()}catch{}Tt=null}if(Tt&&To>Qu&&cr===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,To=0;else{try{n.remove()}catch{}return new Image}}To+=t.length,cr+=1;let e=Tt.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function $o(t){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,cr=Math.max(0,cr-1))}function Ta(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function nd(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++,ed.some(a=>s.includes(a))||i++}return i*2>r}function $a(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>Ju&&!nd(i)?Math.min(td,Math.ceil(o/Zu)):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<s;f++){let l=Math.round(f*r/s),u=f===s-1?r:Math.round((f+1)*r/s);t.drawImage(e,0,l*c,a,(u-l)*c,0,l,n,u-l)}}async function fe(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,f=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,u=!1,p=!1;if(c&&!Ra(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(Ra(t)){let d=(Hu(t).match(/<svg\b[^>]*>/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(Po/(h*g)))<1;if(c||y||Y())try{let b=ln(t);if(c&&(b=Uu(b,c)),Y()){let w=await lr(b);b=w.svg,u=w.naturalOnly,p=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Bu(b,e.__session)),l=fn(b)}catch(b){if(c)throw b;l=t}}let m=f||Fa(l);try{f||await Ta(m,l)}catch(d){if(!m.__snapdomDecodeFrame)throw d;$o(m),m=Fa(l);try{await Ta(m,l)}catch(h){throw $o(m),h}}try{let d=Y()&&!f?Yu():null,h=!1;d&&(h=await Ku(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/Po));C>1&&(St(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,$a(N.getContext("2d"),m,g,y,l),_.drawImage(N,0,0,k,x)}else _.save(),_.setTransform(1,0,0,1,0,0),$a(_,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 ar();try{N=d(m)}catch{break}}while(!N&&performance.now()<O);R.width=R.width,T()}}return R}finally{$o(m)}}var Kt,Po,sr,ar,Qu,Tt,To,cr,Ju,Zu,td,ed,Ie=ct(()=>{"use strict";wt();te();yt();bt();Kt=Y()?16384:32767,Po=16384*16384;sr=null;ar=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Qu=24*1024*1024,Tt=null,To=0,cr=0;Ju=4e6,Zu=2e6,td=8,ed=["%3C","%3E","%20","%7B","%7D","%3B"]});var un={};Ue(un,{rasterize:()=>No});async function No(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 We=ct(()=>{"use strict";Ie();wt()});var Lo={};Ue(Lo,{toImg:()=>rd,toSvg:()=>rd});async function rd(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 lr(ln(t)),m=(p.match(/<svg\b[^>]*>/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=fn(k),await x.decode(),x.style.width=`${b}px`,x.style.height=`${w}px`,x}catch(p){return St(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),No(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=ln(t),m=(p.match(/<svg\b[^>]*>/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=fn(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 Io=ct(()=>{"use strict";pt();te();We();Ie()});var Ia={};Ue(Ia,{toBlob:()=>Wo});async function Wo(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 Oo=ct(()=>{"use strict";Ie()});var Oa={};Ue(Oa,{download:()=>od});async function Wa(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 od(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=qe();if(s==="svg"){let m=await Wo(t,{...f,type:"svg"});if(l&&await Wa(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 Wa(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 Da=ct(()=>{"use strict";Oo();Ie();wt()});pt();pt();wt();ut();kr();bt();var ee=new WeakMap,ai=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Rr=new Map,vc=2e3,we=0;function Rt(){we++}function gn(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 bn(t){for(let e of t)if(re(e))return!0;return!1}function re(t){if(gn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!gn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!gn(n)){e=!1;break}}if(e)return!1}return!0}var be=new WeakMap;function pi(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 Ke(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 Qe(t){return t?(ve(t.ownerDocument||document),wn(t,Ir(t))):0}function xe(){Rt(),Ct++}var ne=new WeakMap,qt=0,Gt=0;function kc(t){ne.set(t,++qt)}function Nr(t){if(!t||t.nodeType!==1)return;qt++,ne.set(t,qt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)ne.set(e[n],qt)}function Lr(t){Nr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)kc(e)}function wn(t,e=null){let n=ne.get(t)||0;if(e)for(let r of e)n=Math.max(n,ne.get(r)||0);return Gt*1e9+n}function Ir(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Or(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Fr=new WeakMap;function Wr(t){t=t||document;let e=Fr.get(t);if(!e||e.env!==Ct){let n=!0;try{n=Xt(t).usesHas}catch{}e={env:Ct,usesHas:n},Fr.set(t,e)}return!e.usesHas}function Cc(t){let e=n=>n?.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 Tr=new WeakSet,Ge=[];function hi(t){if(!bn(t))return;pi(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?Nr(r.host):qt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)ne.set(i[o],qt)}}function Or(t){if(!(!t||Tr.has(t))){Tr.add(t);try{let e=new MutationObserver(hi);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Ge.push({o:e,root:t})}catch{}}}function mi(t){if(!bn(t))return;pi(t),Rt();let e=Cc(t);if(e){Fr.delete(e),Ct++,Gt++;return}let n=new Set;for(let r of t){if(!re(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!Wr(o)){Gt++;return}if(i===o.documentElement||i===o.body){Gt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),Lr(i))}}var $r=new WeakSet,Xe=null,Ye=[];function ve(t=document){if(t===Xe||!t||t.nodeType!==9)return;if($r.has(t)){Xe=t;return}$r.add(t),Xe=t;let e=t.defaultView,n=i=>{bn(i)&&(Rt(),Ct++)},r=()=>{Rt(),Ct++};try{let i=new MutationObserver(mi);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Ye.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}),Ye.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&&!gn(s)&&Wr(s.ownerDocument||t)?Lr(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 ci=new WeakMap;function li(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=ci.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(ci.set(t,n),Rt(),t.nodeType===11){t.host?Nr(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(Wr(e))Lr(o);else{Gt++;return}}function Sn(t,e=null){if(!t)return;li(t,t);let n=e||Ge.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)li(r,t)}function At(){ve();try{for(let t=Ye.length-1;t>=0;t--){let{o:e,env:n,doc:r}=Ye[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}$r.delete(r),Xe===r&&(Xe=null),Ye.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?bn(i)&&(Rt(),Ct++):mi(i))}for(let t=Ge.length-1;t>=0;t--){let{o:e,root:n}=Ge[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Tr.delete(n),Ge.splice(t,1);continue}let r=e.takeRecords();r.length&&hi(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 Ac=["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 Dr(t){let e=ee.get(t);if(e&&Br(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function gi(t){let e=ee.get(t);if(!e||!Br(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var fi=new WeakMap;function Xt(t){let e=fi.get(t);if(!e||e.epoch!==we){let n=e&&e.universe;e={epoch:we,...ti(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)}fi.set(t,e)}return e}function yi(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<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Mc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Xt(e).importantProps}function Je(t,e){let n=t.ownerDocument||document,r=t.getRootNode?t.getRootNode():n;return r===n?Xt(n).universe:e&&Pt(r)?_c(t,r,n,e):null}var ui=new WeakMap;function _c(t,e,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let a=Xt(n).universe;if(!a)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(a),roots:new Set}}let o=a=>{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=ui.get(c);if((!f||f.epoch!==we)&&ui.set(c,f={epoch:we,props:Jo(c)}),!f.props)return!1;for(let l of f.props)i.universe.add(l)}vr(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 yn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Xt(e).pseudoUniverse}var Ec={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function ke(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Ec:Xt(e).pseudoGates}function Rc(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;d<m.length;d++)s(m[d])}else for(let m=0;m<t.length;m++)s(t[m]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let m of a)if(!i[m])try{let d=t.getPropertyValue(m);d&&(i[m]=d)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let m of c)if(!i[m])try{let d=t.getPropertyValue(m);d&&(i[m]=d)}catch{}if(e.embedFonts){let m=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of m)if(!i[d])try{let h=t.getPropertyValue(d);h&&(i[d]=h)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:bi(t),enumerable:!1});let f=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,p=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(f===0&&l===0&&u===0&&p===0){let m=(t.getPropertyValue("border-image-source")||"").trim(),d=m&&m!=="none",h=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of h)delete i[g];d||(i.border="none")}return Fc(i),i}function Fc(t){if(!Vt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=Tc(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 Tc(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 bi(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 Ac){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function $c(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 Pc(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!di(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!di(String(r).trim().toLowerCase())?!0:Lc(t,e)?n||Ic(t,e):!1}var Nc=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function di(t){return Nc.has(t)||t.startsWith("fit-content")}function Lc(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.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function Ic(t,e){let n=t.parentElement;if(!n)return!1;let r=W(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var Pr=new WeakMap;function Wc(t){let e=Pr.get(t);if(e)return e;let n=[];for(let r in t)n.push(r,t[r]);return e=n.join(""),Pr.set(t,e),e}function Br(t,e){return t.env===Ct&&t.stamp===wn(e,t.hosts)}var Oc=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Dc=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Bc=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Uc(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function Hc(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;f<s.length;f++)c.push(s[f].name+"="+s[f].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function wi(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Xt(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&Dc.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),f=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",u=[];for(let d in r)(Oc.test(d)||f&&(d==="grid-template-columns"||d==="grid-template-rows")||l&&d==="transform"||a&&d.charCodeAt(0)===109&&d.startsWith("margin-")||c&&d.charCodeAt(0)===112&&d.startsWith("padding-"))&&u.push(d);t.h&&!("height"in r)&&u.push("height"),t.b&&!("block-size"in r)&&u.push("block-size");let p=new Set(u),m=[];for(let d in r)p.has(d)||m.push(d,r[d]);return t.rr=u,t.sig=m.join("")+""+u.join(""),u}function Si(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return ge(n,yn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),f=c.get(a);if(f){let u={...f.snap},p=f.rr||wi(f,t);for(let m=0;m<p.length;m++){let d=n.getPropertyValue(p[m]);d?u[p[m]]=d:delete u[p[m]]}return u}let l=ge(n,yn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function zc(t,e=null,n={},r=null,i=null){let o=ee.get(t),s=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(typeof a!="function"&&o&&Br(o,t)&&o.embedFonts===s&&o.excludeStyleProps===a)return o.snapshot;let c=e||getComputedStyle(t),f,l=null,u=r&&r.st.snaps.get(r.id);if(u){f={...u.snap};let d=u.rr||wi(u,t);l=[];for(let h=0;h<d.length;h++){let g=d[h],y=c.getPropertyValue(g);y?f[g]=y:delete f[g],l.push(y)}Object.defineProperty(f,"__needsBgInline",{value:u.snap.__needsBgInline,enumerable:!1}),u.snap.__bgClipTextFix!==void 0&&Object.defineProperty(f,"__bgClipTextFix",{value:u.snap.__bgClipTextFix,enumerable:!1})}else f=Rc(c,n,t,Je(t,i)),r&&r.st.snaps.set(r.id,{snap:f,rr:null,sig:null,h:"height"in f,b:"block-size"in f});let p=!1;if(typeof t.computedStyleMap=="function"){let d;for(let h of ai)if(f[h]==="0px")try{d||(d=t.computedStyleMap()),d.get(h)?.toString()==="auto"&&(f[h]="auto",p=!0)}catch{}}Jc(t,c,f),l!==null&&(p&&l.push("",...ai.map(d=>f[d])),Pr.set(f,u.sig+""+l.join("")+("height"in f?"":"")+("block-size"in f?"":"")));let m=Ir(t);return ee.set(t,{env:Ct,stamp:wn(t,m),hosts:m,snapshot:f,embedFonts:s,excludeStyleProps:a}),f}function jc(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:Rr,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:Rr,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:t||e||{}}}var Vc=/%|[\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,qc=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Gc(t,e,n){if(!t.style||t.style.length===0)return;let r=Mc(t),i=r!=null&&!Vc.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&qc(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function lt(t,e,n,r){if(t.tagName==="STYLE")return;let i=jc(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&ve(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&(Rt(),Rr.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let c=s.styleCache.get(t);t.getAttribute?.("style")&&Gc(t,e,c);let f=c.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(je.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:bi(c),enumerable:!1});let b=Ir(t);ee.set(t,{env:Ct,stamp:wn(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let u=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=Uc(s),b=Hc(t,y),w=t.ownerDocument||document,k=w.activeElement;b!==-1&&!Bc.has(t.tagName)&&!(k&&k!==w.body&&k!==w.documentElement&&k===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(u={st:y,id:b})}let p=zc(t,c,i.options,u,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;p[b]==="auto"&&e.style.setProperty(b,"auto","important")}p.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",p.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",p.__bgClipTextFix,"important")),Xc(t,c,p);let m=xi(t);if(m){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(p["min-width"]="0px")}let d=Wc(p),h=!0;if(mn(l,(p.display||"").toLowerCase())){h=$c(t),h&&Mr(l,p,m)&&Pc(t,c,m)&&(h=!1),d=`${d}|${l}${h?"|c":""}${m?"|f":""}`;let y=p["text-wrap-mode"]||p["white-space"]||"";h&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(d);g===void 0&&(g=me(p,l,h,m),a.snapshotKeyCache.size>=vc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(d,g)),s.styleMap.set(e,g)}function Xc(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 Yc(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 xi(t){let e=t.parentElement;if(!e)return!1;let n=W(e).display||"";return n.includes("flex")||n.includes("grid")}function Kc(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 Qc(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 Jc(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"||Yc(e)||xi(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"||!Kc(t))return;let l=parseFloat(e.height),u=Qc(t);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n["block-size"])}ye();var Zc=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]),Ur=new WeakMap,vi=-1;function xn(t){let e=Lt();return e!==vi&&(Ur=new WeakMap,vi=e),ki(t)}function ki(t){let e=Ur.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:Zc.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&ki(r)}return Ur.set(t,n),n}function Ci(t,e){if(t?.nodeType!==1||e?.nodeType!==1||xn(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;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let f=o.getPropertyValue(c);if(!f||!f.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,f=i&&i.getPropertyValue(c);if(f)try{e.style.setProperty(c,f.trim())}catch{}}}}pt();pt();ut();de();yt();function Ce(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function Ae(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Ai(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&&!hr.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 Mi(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}bt();function tl(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 el=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,nl=/^::?(?:before|after|first-letter)$/;function rl(t,e,n=!0,r){return t.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(el);if(o&&nl.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?tl(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function Ei(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=rl(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Ri(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+`
|
|
9
|
+
`;return e}function Fi(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||"")+`
|
|
10
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=ie(r.cssRules))}catch{}}catch{}return e}function Ti(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 $i(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?Ai(t,o):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Ae(a,t)||t.src||"";if((!c||Ce(c))&&n.resolvePicturePlaceholders!==!1){let f=Mi(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 Pi(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 ol(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 Ni(t,e,n){let r=[];for(let i of e){let o=ol(t,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
11
|
+
`:""}function Li(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 il(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function sl(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 ht(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 al(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 Hr(t,e,n){let r=await il(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:s}=sl(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=al(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 Ii(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 Wi(t){let{width:e,height:n}=ht(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=Ii(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 Oi(t){let{width:e,height:n}=ht(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=Ii(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 Ze=new ot(80);async function cl(t){if(P.resource?.has(t))return P.resource.get(t);if(Ze.has(t))return Ze.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})();Ze.set(t,e);try{let n=await e;return Ze.set(t,n),n}catch(n){throw Ze.delete(t),n}}var _i=/\bblob:[^)"'\s]+/g;function vn(t){return typeof t=="string"&&t.startsWith("blob:")}function ll(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 fl(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function tn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function kn(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(_i)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=h.replace(_i,w=>o.get(w)||w);b!==h&&g(b)})}},c=tn(t,"img");for(let h of c)try{let y=h.getAttribute("src")||h.currentSrc||"";vn(y)&&s(h,"src",y);let b=h.getAttribute("srcset");if(b&&b.includes("blob:")){let w=ll(b);for(let k of w)vn(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",fl(w))})}}catch(g){D(n,"resolveBlobUrls for img failed",g)}let f=tn(t,"image");for(let h of f)try{let g="http://www.w3.org/1999/xlink",y=h.getAttribute("href")||h.getAttributeNS?.(g,"href");vn(y)&&s(h,"href",y,()=>h.removeAttributeNS?.(g,"href"))}catch(g){D(n,"resolveBlobUrls for SVG image href failed",g)}let l=tn(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=tn(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=tn(t,`[${h}^='blob:']`);for(let y of g)try{let b=y.getAttribute(h);vn(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(;d<m.length;){let h=m[d++];try{o.set(h,await cl(h))}catch(g){D(n,"blobUrlToDataUrl failed; keeping original URL",g)}}}));for(let h of i)try{h()}catch(g){D(n,"resolved blob URL write failed",g)}}wt();var Di=new Set(["rgba(0, 0, 0, 0)","transparent"]),zr="Highlight";function Bi(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function ul(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!Di.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:zr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${zr}`}return e.styles.set(t,n),n}function Ui(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let f of e.ranges){let l=!1;try{l=f.intersectsNode(t)}catch{}if(!l)continue;let u=f.startContainer===t?f.startOffset:0,p=f.endContainer===t?f.endOffset:n.length;p>u&&i.push([u,p])}if(i.length===0)return null;let o=ul(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 c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var Cn=t=>Number.parseFloat(t)||0,dl=["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 pl(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!Di.has(r)&&r!==e.backgroundColor)return r}catch{}return zr}function Hi(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=Cn(s.paddingLeft),f=Cn(s.paddingTop),l=t.clientWidth-c-Cn(s.paddingRight),u=t.clientHeight-f-Cn(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 dl)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=pl(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 zi(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(",")}}bt();var jr=new Map,ji=new Set(["IFRAME"]);function Me(t,e){jr.set(String(t).toUpperCase(),e)}function An(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<y+w/2?w:0)},[s,a,c,f]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),u=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,f);if(l===null||u===null){let{width:m,height:d}=ht(t),h=m,g=d;if(l===null&&!h||u===null&&!g){let y=t.getBoundingClientRect();h||(h=y.width||0),g||(g=y.height||0)}l??(l=h),u??(u=g)}let p=document.createElement("div");return p.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${u}px;visibility:hidden;`,p}var Mn=200,hl=new Set(["img","canvas","video","iframe","object","embed"]);function Vi(t,e){return t.right>=e.left-Mn&&t.left<=e.right+Mn&&t.bottom>=e.top-Mn&&t.top<=e.bottom+Mn}function ml(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"&&!hl.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)),Vi(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)&&Vi(l,i))return!1}return!0}function gl(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}=ht(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||Cr.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return D(e,"Nested <foreignObject> 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=Ui(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 An(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 An(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:An(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 An(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&ml(t,e.clip))return gl(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=ji.has(t.tagName)&&jr.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=!ji.has(t.tagName)&&jr.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),Ci(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){$i(t,s,n);try{let l=window.getComputedStyle(t),u=parseFloat(l.width),p=parseFloat(l.height);if(!(u>0)||!(p>0)){let h=ht(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}=ht(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}=Oi(t);e.nodeMap.set(p,t),a=m,s=p}else if(l==="range"&&(Vt()||Y())){let{el:p,applyVisual:m}=Wi(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=ze(t)?yr(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(xn(t)||lt(t,s,e,n),a&&a(),n.captureSelection&&(rt(t,"input")||rt(t,"textarea")))try{Hi(t,s)}catch(l){D(e,"inlineTextFieldSelection failed",l)}if(Ht(t)&&!xn(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){Or(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=Ri(e),u=`[data-sd="${l}"]`;e.shadowScopes||(e.shadowScopes=new WeakMap),e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let p=Fi(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(p)&&(e.__shadowPseudo=!0);let m=Ei(p,u,l),d=Pi(p),h=Ni(t,d,u);Ti(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&&Li(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||(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 yl(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 Hr(t,e,n)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(r||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",t),n.placeholders){let{width:i,height:o}=ht(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,lt(t,s,e,n),s}else{let{width:i,height:o}=ht(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,lt(t,s,e,n),s}}function en(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var bl=.95;function wl(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function Sl(t,e,n){let r="";try{let a=en(t);a&&(await dt(),a=en(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}Y()&&await dt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await dt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let f=document.createElement("canvas");f.width=t.width,f.height=t.height;let l=f.getContext("2d");l&&(l.drawImage(t,0,0),r=f.toDataURL("image/png"))}}}catch(a){D(e,"Canvas toDataURL failed, using empty/fallback",a)}n&&n.debug&&r&&en(t)&&D(e,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){D(e,"img decoding/loading hints failed",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=ht(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),lt(t,i,e,n),i}async function xl(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let f=c.getContext("2d");f&&(f.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(wl(f,c.width,c.height)?"image/jpeg":"image/png",bl),(!r||r==="data:,")&&(r=""))}catch(c){D(e,"Video frame capture failed, using poster fallback",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=ht(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),lt(t,o,e,n),o}async function vl(t,e,n){if(!t.controls)return;let{width:r,height:i}=ht(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),f=s*.34,l=o-s*.34,u=f+c+s*.55,p=Math.max(0,l-s*.7-u),m=Math.max(9,Math.round(s*.24)),d=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-c} L ${f+c} ${a} L ${f} ${a+c} Z" fill="#5f6368"/><rect x="${u}" y="${a-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${m}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement("img");try{h.decoding="sync",h.loading="eager"}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,h.width=o,h.height=s,h.style.width=`${o}px`,h.style.height=`${s}px`,e.nodeMap.set(h,t),lt(t,h,e,n),h}async function qi(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:f}=ht(t);return c>0&&(a.style.width=`${c}px`),f>0&&(a.style.height=`${f}px`),e.nodeMap.set(a,t),lt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Hr(t,e,n);if(a)return a}catch{}r&&console.warn(`[snapdom] <${t.localName}> content could not be captured (${i||"unknown type"}): rendering its fallback children`)}Me("IFRAME",yl);Me("CANVAS",Sl);Me("VIDEO",xl);Me("AUDIO",vl);Me("OBJECT",qi);Me("EMBED",qi);pt();yt();ye();ut();bt();var kl=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],_e=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function Cl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(Cl(r),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r);return n}function Mt(t,e){let n=typeof t=="string"?t:"";for(let r of kl)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function Vr(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return Mt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>Mt(i,e)):Mt(t,e)}function Al(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var _n=new Map;function Ml(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function _l(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let f=a===1,l=null;if(f&&(c==="outlined"&&_e.materialIconsFilled?l={url:_e.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&_e.materialIconsRound?l={url:_e.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&_e.materialIconsSharp&&(l={url:_e.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!_n.has(l.alias))try{let p=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await p.load(),document.fonts.add(p),_n.set(l.alias,!0)}catch{return _n.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(_n.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function El(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Rl(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function Fl(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,f=Ml(o),{familyForMeasure:l,familyForCanvas:u}=await _l(a,s,f);await El(u.replace(/^["']+|["']+$/g,""),r);let p=document.createElement("span");J(p),p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=l,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${r}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=i,document.body.appendChild(p);let m=p.getBoundingClientRect(),d=Math.max(1,Math.ceil(m.width)),h=Math.max(1,Math.ceil(m.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=d*c,g.height=h*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:d,height:h}}async function En(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],f=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(f||c),u=l.fontFamily||"Material Icons";if(!Al(u))continue;let p=(f||c).textContent.trim();if(!p)continue;let m=parseInt(l.fontSize,10)||24,d=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",h=Rl(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(f||c).className||"",{dataUrl:b,width:w,height:k}=await Fl(p,{family:u,weight:d,fontSize:m,color:h,variation:g,className:y});c.textContent="";let x=c.ownerDocument.createElement("img");x.src=b,x.alt=p,x.style.height=`${m}px`,x.style.width=`${Math.max(1,Math.round(w/k*m))}px`,x.style.objectFit="contain",x.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(x),s++}catch{}}return s}de();wt();bt();async function Qi(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");J(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let c=a.getBoundingClientRect(),f=Math.ceil(c.width),l=Math.ceil(c.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,f*s),u.height=Math.max(1,l*s);let p=u.getContext("2d");return p.scale(s,s),p.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,p.textAlign="left",p.textBaseline="top",p.fillStyle=i,p.fillText(t,0,0),{dataUrl:u.toDataURL(),width:f,height:l}}var Ji=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Tl=["katex","mathjax","mathml"];function Xr(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Ji.has(n.toLowerCase()))return n}return""}function $l(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Ji.has(r.toLowerCase())||e.push(r))}return e}function Rn(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Fn(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Pl(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Nl(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Rn(n[1]),o=Rn(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Rn(e);return{min:r,max:r}}function Ll(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Il(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Wl(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Ol(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||Tl.some(c=>a.includes(c)))return!0;for(let c of e){let f=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),u=Wl(c);if(a.includes(f)||a.includes(l)||u&&a.includes(u))return!0}return!1}catch{return!1}}function Dl(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function Xi(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var Zi=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Tn=4;async function Bl(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,f=0){if(f>Tn)return console.warn(`[snapDOM] @import depth exceeded (${Tn}) at ${c}`),a;let l="",u=0,p,m=new RegExp(Zi.source,"g");for(;p=m.exec(a);){l+=a.slice(u,p.index),u=m.lastIndex;let d=(p[2]||p[4]||"").trim(),h=i(d,c);if(r.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}r.add(h);let g="";try{let y=await it(h,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=Xi(g,h),g=await o(g,h,f+1),l+=`
|
|
12
|
+
/* inlined: ${h} */
|
|
13
13
|
${g}
|
|
14
|
-
`):l+=p[0]}return l+=a.slice(u),l}let s=zi(t,e||location.href);return s=await o(s,e||location.href,0),s}var Yi=/url\((["']?)([^"')]+)\1\)/g,Pl=/@font-face[^{}]*\{[^}]*\}/g;function St(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ki(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let f=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[f,l]};if(s){let c=a(o),f=a(s),l=Array.isArray(c)?c[0]:c,u=Array.isArray(f)?f[1]:f;e.push([Math.min(l,u),Math.max(l,u)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function Qi(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function Xr(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(Yi)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function Vr(t,e,n="",r){let i=t;for(let o of t.matchAll(Yi)){let s=Kt(o[0]);if(!s)continue;let a=s;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,e||location.href).href}catch{}if(!At(a,r)){if(P.resource?.has(a)){i=i.replace(o[0],`url(${P.resource.get(a)})`);continue}try{let c=await it(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let f=c.data;P.resource?.set(a,f),i=i.replace(o[0],`url(${f})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return i}function Nl(t){if(!t.length)return null;let e=(a,c)=>t.some(([f,l])=>!(l<a||f>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function ji(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Nl(o);if(s&&r.has(s))return!0}return!1}}function Ll(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=St(o,"font-family"),a=Gr(s),c=St(o,"font-weight","400"),f=St(o,"font-style","normal"),l=St(o,"font-stretch","100%"),u=St(o,"unicode-range"),p=St(o,"src"),h=Xr(p,location.href),d=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),m=[String(a||"").toLowerCase(),c,f,l,u.toLowerCase(),d].join("|");n.has(m)||(n.add(m),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var Vi=new WeakMap,Il=0;function Wl(t){let e=Vi.get(t);return e===void 0&&(e=Il++,Vi.set(t,e)),e}function Ol(t,e,n,r,i,o,s,a,c){let f=Array.from(t||[]).sort().join("|"),l=0,u=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,u++}let p=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),d=r||"",m=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Wl(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${f}::ex=${p}::lf=${h}::px=${d}::fd=${m}::doc=${g}::cp=${l}::n=${u}::ic=${y}::env=${c}`}async function qr(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=Fn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Fn}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let f={...r,depth:(r.depth||0)+1};await qr(a.styleSheet,c,n,f);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await qr(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),f=Gr(c);if(!f||At(f,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),u=(a.style.getPropertyValue("font-style")||"").trim(),p=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),d=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=u||"normal",b=p||"100%",w=(u?`font-style:${u};`:"")+(l?`font-weight:${l};`:"")+(p?`font-stretch:${p};`:"")+(h?`font-variation-settings:${h};`:"")+(m?`unicode-range:${m};`:""),C=r.faceMatchesRequired(f,y,g,b);if(!C&&!r.requiredIndex.has(f.toLowerCase()))continue;let x=Ki(m);if(!Qi(r.usedCodepoints,x))continue;let S={family:f,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:m,srcRaw:d,srcUrls:Xr(d,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,x))continue;if(!C){r.provisionalFaces.push({family:f.toLowerCase(),block:`@font-face{font-family:${f};src:${d};${w}}`,srcRaw:d,baseHref:e||location.href});continue}r.coveredFamilies.add(f.toLowerCase());let A=`"${String(f).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(d)){let v=await Vr(d,e||location.href,r.useProxy,r.iconMatchers);await n(`@font-face{font-family:${A};src:${v};${w}}`)}else await n(`@font-face{font-family:${A};src:${d};${w}}`)}}}async function Ji({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[A,v,M,k]=String(S).split("__");if(!A)continue;let R=A.toLowerCase(),E=c.get(R)||[];E.push({w:parseInt(v,10),s:M,st:parseInt(k,10)}),c.set(R,E)}function f(S,A,v,M){let k=String(S).toLowerCase();if(!c.has(k))return!1;let R=c.get(k),E=Ml(v),T=El(A),N=_l(M),O=E.min!==E.max,H=E.min,_=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),L=!1;for(let $ of R){let F=O?$.w>=E.min&&$.w<=E.max:$.w===H,V=_(Rn($.s)),z=$.st>=N.min&&$.st<=N.max;if(F&&V&&z){L=!0;break}}if(L)return!0;if(!O)for(let $ of R){let F=_(Rn($.s)),V=$.st>=N.min&&$.st<=N.max;if(Math.abs(H-$.w)<=300&&F&&V)return!0}if(!O&&T.kind==="normal"&&R.some(F=>Rn(F.s)!=="normal"))for(let F of R){let V=Math.abs(H-F.w)<=300,z=F.st>=N.min&&F.st<=N.max;if(V&&z)return!0}return!1}let l=ji(n);we(a),Rt();let u=Ol(t,n,r,i,o,a,e,s,we(a));if(P.resource?.has(u))return P.resource.get(u);let p=Tl(t),h=[],d=Xi;for(let S of a.querySelectorAll("style")){let A=S.textContent||"";for(let v of A.matchAll(d)){let M=(v[2]||v[4]||"").trim();if(!M||jr(M,s))continue;a.querySelector(`link[rel="stylesheet"][href="${M}"]`)||h.push(M)}}let m=[];h.length&&await Promise.all(h.map(S=>new Promise(A=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return A(null);let v=a.createElement("link");v.rel="stylesheet",v.href=S,J(v),v.setAttribute("data-snapdom","injected-import");let M=setTimeout(()=>A(null),3e3),k=R=>{clearTimeout(M),A(R)};v.onload=()=>k(v),v.onerror=()=>k(null),a.head.appendChild(v),m.push(v)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of m)try{S.remove()}catch{}for(let S of w)try{if(jr(S.href,s))continue;let A="",v=!1;try{v=new URL(S.href,location.href).origin===location.origin}catch{}if(!v){let k=Array.isArray(o)?o:[];if(!Fl(S.href,p,k))continue}if(v){let k=Array.from(a.styleSheets).find(R=>R.href===S.href);if(k)try{let R=k.cssRules||[];A=Array.from(R).map(E=>E.cssText).join("")}catch{}}if(!A){let k=await it(S.href,{as:"text",useProxy:i});k?.ok&&typeof k.data=="string"&&(A=k.data)}A=await $l(A,S.href,i);let M="";for(let k of A.match(Pl)||[]){let R=St(k,"font-family"),E=Gr(R);if(!E||At(E,s))continue;let T=St(k,"font-weight","400"),N=St(k,"font-style","normal"),O=St(k,"font-stretch","100%"),H=St(k,"unicode-range"),_=St(k,"src"),L=Xr(_,S.href),$=f(E,N,T,O);if(!$&&!c.has(E.toLowerCase()))continue;let F=Ki(H);if(!Qi(e,F))continue;let V={family:E,weightSpec:T,styleSpec:N,stretchSpec:O,unicodeRange:H,srcRaw:_,srcUrls:L,href:S.href};if(n&&l(V,F))continue;if(!$){b.push({family:E.toLowerCase(),block:k,srcRaw:_,baseHref:S.href});continue}y.add(E.toLowerCase());let z=/url\(/i.test(_)?await Vr(k,S.href,i,s):k;M+=z}M.trim()&&(g+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",S.href)}let C={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:f,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ji(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},x=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of x)if(!(S.href&&w.some(A=>A.href===S.href)))try{let A=S.href||a.baseURI||location.origin+"/";A&&C.visitedSheets.add(A),await qr(S,A,async v=>{g+=v},C)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await Vr(S.block,S.baseHref,i,s):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let A=String(S.family).replace(/^['"]+|['"]+$/g,"");if(At(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===A.toLowerCase()))continue;let v=S._snapdomSrc;if(!String(v).startsWith("data:"))if(P.resource?.has(S._snapdomSrc))v=P.resource.get(S._snapdomSrc);else try{let M=await it(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,P.resource?.set(S._snapdomSrc,v);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${A}';src:url(${v});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let A=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!A||At(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===A.toLowerCase()))continue;let v=S.weight!=null?String(S.weight):"normal",M=S.style!=null?String(S.style):"normal",k=S.stretchPct!=null?`${S.stretchPct}%`:"100%",R=String(S.src||""),E=R;if(!E.startsWith("data:"))if(P.resource?.has(R))E=P.resource.get(R);else try{let T=await it(R,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")E=T.data,P.resource?.set(R,E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",R);continue}g+=`@font-face{font-family:'${A}';src:url(${E});font-style:${M};font-weight:${v};font-stretch:${k};}`}return g&&(g=Ll(g),P.resource?.set(u,g)),g}function Tn(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let u of l)r.add(u.codePointAt(0))},o=l=>{let u=Cl(l.fontFamily);if(u.length)for(let p of u)n.add(`${p}__${_n(l.fontWeight)}__${Rn(l.fontStyle)}__${Al(l.fontStretch)}`)},s=ve(t),a=t.getRootNode(),c=l=>{o(W(l));let u=l.getRootNode()===a?s:ve(l);for(let p of["::before","::after"]){let h=p==="::before"?u.before:u.after;if(h!==null){if(h==="")continue;try{if(!l.matches(h))continue}catch{}}let d=W(l,p),m=d&&d.content;if(!(!m||m==="none"||m==="normal"))if(o(d),/^["']/.test(m))i(m.slice(1,-1));else{let g=m.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},f=[t];for(let l=0;l<f.length;l++){let u=f[l];u.nodeType===Node.ELEMENT_NODE&&c(u),u.shadowRoot&&f.push(u.shadowRoot);let p=(t.ownerDocument||document).createTreeWalker(u,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;p.nextNode();){let h=p.currentNode;if(h.nodeType===Node.TEXT_NODE){if(e&&h.parentElement&&!e(h.parentElement))continue;i(h.nodeValue||"")}else{if(e&&!e(h))continue;c(h),h.shadowRoot&&f.push(h.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function $n(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");J(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await dt(),await dt()}yt();function ns(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Zi(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ts(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function es(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return Zi(t,!1);case"upper-alpha":case"upper-latin":return Zi(t,!0);case"lower-roman":return ts(t,!1);case"upper-roman":return ts(t,!0);default:return String(t)}}function tn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function rs(t){let e=new WeakMap,n=yr(t)?t.documentElement:t,r=f=>f&&f.tagName==="LI",i=new WeakMap,o=f=>{let l=new Map;for(let[u,p]of f)l.set(u,p.slice());return l},s=(f,l,u)=>{let p=o(f),h;try{h=getComputedStyle(u)}catch{h=u.style}let d;try{d=h?.counterReset}catch{}if(d&&d!=="none")for(let[y,b]of tn(d,0)){let w=l.get(y);if(w&&w.length){let C=w.slice();C.push(b),p.set(y,C)}else p.set(y,[b])}let m;try{m=h?.counterSet}catch{}if(m&&m!=="none")for(let[y,b]of tn(m,0)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of tn(g,1)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,p.set(y,w)}try{if(h?.display==="list-item"&&r(u)){let y=u.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,C=b===void 0?Number.isFinite(w)?w:1:b+1,x=y?.tagName==="OL"?parseInt(u.getAttribute("value"),10):NaN;Number.isFinite(x)&&(C=x),y&&i.set(y,C);let S=p.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=C,p.set("list-item",S)}}catch{}return p},a=(f,l,u)=>{let p=s(u,l,f);e.set(f,p);let h=p;for(let m of f.children)h=a(m,p,h);let d=new Map;for(let[m,g]of u){let y=g.length,b=h.get(m);d.set(m,b&&b.length?b.slice(0,y):g.slice())}for(let[m,g]of h)!d.has(m)&&g.length&&!l.has(m)&&d.set(m,g.slice(0,1));return d},c=new Map;return a(n,c,c),{get(f,l){let u=e.get(f)?.get(l);return u&&u.length?u[u.length-1]:0},getStack(f,l){let u=e.get(f)?.get(l);return u?u.slice():[]}}}function os(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return es(l,f)}else{let c=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),u=n.getStack(e,c);return u.length?u.map(h=>es(h,l)).join(f):""}})}catch{return"- "}}de();var Ee=new WeakMap,is=1e3;function Dl(t,e){let n=ls(t);return e?(e.__pseudoPreflightFp!==n&&(Rt(),e.__pseudoPreflight=ss(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Rt(),ss(t,n))}function Pn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function ls(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let f=a.sheet,l=f?Pn(f):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",f=a.getAttribute("media")||"all";n+=`L${c}|m:${f}|`;let l=a.sheet,u=l?Pn(l):null;u&&(r+=u.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Pn(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function Yr(t,e,n){let r=Pn(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&Yr(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],f=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(f.includes(l))return!0}if(n.budget<=0)return!1}return!1}function ss(t=document,e=ls(t)){let n=Ee.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Se();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let f of i)if(c.includes(f))return Ee.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:is};try{for(let c of s)if(Yr(c,i,a))return Ee.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:is};for(let f=0;f<a.length&&c.budget>0;f++){let l=a[f],u=null;if(l.tagName,u=l.sheet||null,u&&Yr(u,i,c))return Ee.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Ee.set(t,{fingerprint:e,result:!0}),!0):(Ee.set(t,{fingerprint:e,result:!1}),!1)}function as(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Bl(t,e){let n=null,r=()=>{if(!n)try{n=rs(t)}catch(i){D(e,"buildCounterContext failed",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Ul(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function Hl(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
15
|
-
`?"":r})}function zl(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Hl(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function Kr(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],c),f}return a}}:e}function Qr(t,e,n){let r=new Map,i=(f,l)=>tn(f,l).map(([u,p])=>({name:u,num:p})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(f){if(r.has(f))return r.get(f).slice();let l=n.getStack(t,f);l=l.length?l.slice():[];let u=o.find(d=>d.name===f);if(u){let d=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,d]:[d]}let p=s.find(d=>d.name===f);if(p){let d=Number.isFinite(p.num)?p.num:0;l.length===0&&(l=[0]),l[l.length-1]=d}let h=a.find(d=>d.name===f);if(h){let d=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=d}return r.set(f,l.slice()),l}return{get(f,l){let u=c(l);return u.length?u[u.length-1]:0},getStack(f,l){return c(l)},__incs:a}}var jl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Vl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function cs(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let u=W(t).display||"";if(i==="::marker"?!u.includes("list-item"):!(u==="block"||u==="flow-root"||u==="list-item"||u==="inline-block"||u==="table-cell"||u==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(W(t).display||"").includes("list-item"))return;let s=W(t,i),a=W(t);if(!s)return;let c="";for(let u of o){let p=s.getPropertyValue(u);p&&p!==a.getPropertyValue(u)&&!(u==="background-color"&&p==="rgba(0, 0, 0, 0)")&&!(u==="vertical-align"&&p==="baseline")&&(c+=`${u}:${p};`)}if(i==="::marker"){let u=s.getPropertyValue("content");u&&u!=="normal"&&u!=="none"&&(c+=`content:${u};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function ql(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=W(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Gl(t,e,n,r){let i;try{i=W(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Ul(o),o=ql(o,t);let s=Kr(t,n,r),a=Qr(t,i,s),c=ns(o)?os(o,t,a):o;return{text:zl(c),incs:a.__incs||[]}}function Xl(t,e){if(e.__shadowPseudo)return!1;let n=ve(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function _e(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||t.tagName==="TEXTAREA")return;let o=t.ownerDocument||document;if(!i&&!Dl(o,n)&&!n.__shadowPseudo||!i&&Xl(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Bl(t.ownerDocument||document,n));let s=n.__counterCtx,a=ve(t);a.marker!==""&&cs(t,e,n,a.marker,"::marker",jl),a.firstLine!==""&&cs(t,e,n,a.firstLine,"::first-line",Vl);for(let f of["::before","::after","::first-letter"]){let l=a[f==="::before"?"before":f==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let u=W(t,f);if(!u||u.content==="none"&&u.backgroundImage==="none"&&(u.backgroundColor==="transparent"||u.backgroundColor==="rgba(0, 0, 0, 0)")&&!as(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(u.display==="none"||f!=="::first-letter"&&(u.content==="none"||u.content==="normal")){f==="::before"&&(e.dataset.snapdomHasBefore="1"),f==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(f==="::first-letter"){let U=W(t),G=(U?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let j=Wt=>u[Wt]!==U[Wt]&&(parseFloat(u[Wt])||0)!==0;if(!(u.color!==U.color||u.fontSize!==U.fontSize||u.fontWeight!==U.fontWeight||u.fontFamily!==U.fontFamily||u.fontStyle!==U.fontStyle||u.textTransform!==U.textTransform||u.float!==U.float&&u.float!=="none"||j("paddingTop")||j("paddingRight")||j("paddingBottom")||j("paddingLeft")||j("marginTop")||j("marginRight")||j("marginBottom")||j("marginLeft")))continue;let Et=Array.from(e.childNodes).find(Wt=>Wt.nodeType===Node.TEXT_NODE&&Wt.textContent?.trim().length>0);if(!Et)continue;let gt=Et.textContent,fe=/^\s*/.exec(gt)[0],fn=gt.slice(fe.length),Oe=fn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],lr=fn.slice(Oe?.length||0);if(!Oe||/[\uD800-\uDFFF]/.test(Oe))continue;let It=document.createElement("span");It.textContent=Oe,It.dataset.snapdomPseudo="::first-letter";let fr=ge(u,mn(t)),ur=me(fr,"span");n.styleMap.set(It,ur);let un=document.createTextNode(lr);e.replaceChild(un,Et),e.insertBefore(It,un),fe&&e.insertBefore(document.createTextNode(fe),It);continue}let d=u.content??"",m=d===""||d==="none"||d==="normal",{text:g,incs:y}=Gl(t,f,s,n.__siblingCounters),b=u.backgroundImage,w=u.backgroundColor,C=u.fontFamily,x=parseInt(u.fontSize)||32,S=parseInt(u.fontWeight)||!1,A=u.fontStyle||"normal",v=u.color||"#000",M=u.transform,k=At(C,r?.__iconMatchers),R=!m&&g!=="",E=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",N=as(u),O=M&&M!=="none",H=d!=="none"&&d!=="normal",_=/^inline-/.test(u.display||""),L=H&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0||_),$=H&&u.boxShadow&&u.boxShadow!=="none",F=H&&u.outlineStyle&&u.outlineStyle!=="none"&&(parseFloat(u.outlineWidth)||0)>0;if(!(R||E||T||N||O||L||$||F)){if(y&&y.length&&t.parentElement){let U=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let j=Kr(t,s,n.__siblingCounters),Et=Qr(t,W(t,f),j).get(t,G);U.set(G,Et)}n.__siblingCounters.set(t.parentElement,U)}continue}let z=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),q=!1;if(R&&!k&&g.length>1&&!z){let U=W(t),G=parseFloat(U.fontSize)||16,j=parseFloat(U.lineHeight);Number.isFinite(j)||(j=G*1.5),t.getBoundingClientRect().height<j*1.6&&(e.style.whiteSpace="nowrap",q=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=f,B.style.pointerEvents="none",q&&(B.style.whiteSpace="nowrap");let Z=mi(t,f,u,n,r),Mt=(W(t).display||"").toLowerCase(),Lt=Mt.includes("flex")||Mt.includes("grid");if(Lt){let U=Z["min-width"];(!U||U==="auto"||U==="0px")&&(Z["min-width"]="0px")}let mt=me(Z,"span",R,Lt);if(n.styleMap.set(B,mt),k&&g&&g.length===1){let{dataUrl:U,width:G,height:j}=await qi(g,C,S,x,v,A),ft=document.createElement("img");ft.src=U,ft.style=`height:${x}px;width:${G/j*x}px;object-fit:contain;`,B.appendChild(ft),e.dataset.snapdomHasIcon="true"}else if(g&&z){let U=Ue(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Kt(g);if(U?.trim())try{let G=await it(Dt(U),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let j=document.createElement("img");j.src=G.data,j.style=`width:${x}px;height:auto;object-fit:contain;`,B.appendChild(j)}}catch(G){console.error(`[snapdom] Error in pseudo ${f} for`,t,G)}}else!k&&R&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=u.backgroundRepeat,B.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(B.style.backgroundPositionX=u.backgroundPositionX,B.style.backgroundPositionY=u.backgroundPositionY):B.style.backgroundPosition=u.backgroundPosition,B.style.backgroundOrigin=u.backgroundOrigin,B.style.backgroundClip=u.backgroundClip,B.style.backgroundAttachment=u.backgroundAttachment,B.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(E)try{let U=Ht(b),G=await Promise.all(U.map(j=>pe(j,r)));B.style.backgroundImage=G.join(", ")}catch(U){console.warn(`[snapdom] Failed to inline background-image for ${f}`,U)}T&&(B.style.backgroundColor=w);let st=u.maskImage||u.webkitMaskImage;if(st&&st!=="none")try{let G=(await Promise.all(Ht(st).map(j=>pe(j,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let j of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])u[j]&&(B.style[j]=u[j])}catch(U){console.warn(`[snapdom] Failed to inline mask-image for ${f}`,U)}let $t=B.childNodes.length>0||B.textContent?.trim()!==""||E||T||N||O||L||$||F;if(y&&y.length&&t.parentElement){let U=n.__siblingCounters.get(t.parentElement)||new Map,G=Kr(t,s,n.__siblingCounters),j=Qr(t,W(t,f),G);for(let{name:ft}of y){if(!ft)continue;let Et=j.get(t,ft);U.set(ft,Et)}n.__siblingCounters.set(t.parentElement,U)}if(!$t)continue;f==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(u){console.warn(`[snapdom] Failed to capture ${f} for`,t,u)}}let c=Array.from(e.children).filter(f=>!f.dataset.snapdomPseudo);if(n.nodeMap)for(let f of c){let l=n.nodeMap.get(f);l?.nodeType===1&&await _e(l,f,n,r,!0)}else{let f=Array.from(t.children);for(let l=0;l<Math.min(f.length,c.length);l++)await _e(f[l],c[l],n,r,!0)}}yt();function fs(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=Bt(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),f="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let A=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(f,"href"):null);if(A)return A;let v=S.attributes;if(!v)return null;for(let M=0;M<v.length;M++){let k=v[M];if(!k||!k.name)continue;if(k.name==="href")return k.value;let R=k.name.indexOf(":");if(R!==-1&&k.name.slice(R+1)==="href")return k.value}return null},u=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),p=new Set,h=!1,d=(S,A=null)=>{if(!S)return;s.lastIndex=0;let v;for(;v=s.exec(S);){h=!0;let M=(v[1]||"").trim();M&&(u.has(M)||(p.add(M),A&&!A.has(M)&&A.add(M)))}},m=S=>{let A=S.querySelectorAll("use");for(let k of A){let R=l(k);if(!R||!R.startsWith("#"))continue;h=!0;let E=R.slice(1).trim();E&&!u.has(E)&&p.add(E)}let v='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';d(S.getAttribute("style")||"");for(let k of a)d(S.getAttribute(k));let M=S.querySelectorAll(v);for(let k of M){d(k.getAttribute("style")||"");for(let R of a)d(k.getAttribute(R))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let A="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",v=!1;try{v=!!(i.querySelector&&i.querySelector(A))}catch{return}if(!v)return;let M=["filter","clipPath","mask","maskImage","webkitMaskImage"],k=R=>{if(Bt(R))return;let E;try{E=getComputedStyle(R)}catch{return}for(let T of M){let N=E[T];N&&N.includes("url(")&&d(N)}};k(S);for(let R of S.querySelectorAll("*"))k(R)};for(let S of o)m(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||u.has(S))return null;let A=c(S),v=M=>{let k=i.querySelector(M);return k&&!t.contains(k)?k:null};return v(`svg defs > *#${A}`)||v(`svg > symbol#${A}`)||v(`*#${A}`)};if(!p.size)return;let C=new Set(p),x=new Set;for(;C.size;){let S=C.values().next().value;if(C.delete(S),!S||u.has(S)||x.has(S))continue;let A=w(S);if(!A){x.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let v=A.cloneNode(!0);v.id||v.setAttribute("id",S),b.appendChild(v),x.add(S),u.add(S);let M=[v,...v.querySelectorAll("*")];for(let k of M){let R=l(k);if(R&&R.startsWith("#")){let T=R.slice(1).trim();T&&!u.has(T)&&!x.has(T)&&C.add(T)}let E=k.getAttribute?.("style")||"";E&&d(E,C);for(let T of a){let N=k.getAttribute?.(T);N&&d(N,C)}}}}yt();var Jr=new WeakMap,Zr=new WeakMap;function Nn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([f,l])=>{let u={property:f,value:i.getPropertyValue(f),priority:i.getPropertyPriority(f)};return i.setProperty(f,l,"important"),u.forcedValue=i.getPropertyValue(f),u}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function us(t){if(Jr.has(t))return Nn(t,[],Jr);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return Nn(t,s,Jr)}return()=>{}}function Ln(t,e=null){let n=[],r=i=>{if(!vt(i))return;if(Zr.has(i)){n.push(Nn(i,[],Zr));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(Nn(i,[["content-visibility","visible"]],Zr))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}pt();ut();bt();ye();bt();function eo(t){return ps(t.boxShadow)}function no(t){return ps(t.textShadow)}function ps(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let f=t[c];f==="("?r++:f===")"&&(r=Math.max(0,r-1)),f===","&&r===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let f=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(f.length<2)continue;let[l,u,p=0,h=0]=f,d=Math.abs(l)+p+h,m=Math.abs(u)+p+h;o=Math.max(o,d+Math.max(l,0)),a=Math.max(a,d+Math.max(-l,0)),s=Math.max(s,m+Math.max(u,0)),i=Math.max(i,m+Math.max(-u,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function ro(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function oo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function io(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let f=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[l=0,u=0,p=0]=f,h=Math.abs(l)+p,d=Math.abs(u)+p;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,d+Math.max(u,0)),r=Math.max(r,d+Math.max(-u,0))}return{bleed:{top:I(r),right:I(i),bottom:I(o),left:I(s)},has:a}}function Yl(t){let e=eo(t),n=no(t),r=ro(t),i=oo(t),o=io(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function Kl(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function ds(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function hs(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,f=ds(n.get(t)||W(t));if(f.x&&f.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let u of e.values()){if(u===t||u.nodeType!==1||u.ownerDocument!==t.ownerDocument)continue;let p=n.get(u);if(!p||!Kl(p))continue;let h=Yl(p);if(!(h.top||h.right||h.bottom||h.left))continue;let d=u.getBoundingClientRect(),m={left:d.left-h.left/r,top:d.top-h.top/i,right:d.right+h.right/r,bottom:d.bottom+h.bottom/i};for(let g=u.parentElement;g;g=g.parentElement){let y=ds(n.get(g)||W(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(m.left=Math.max(m.left,b.left),m.right=Math.min(m.right,b.right)),y.y&&(m.top=Math.max(m.top,b.top),m.bottom=Math.min(m.bottom,b.bottom))}if(g===t)break}f.x||(c=Math.max(c,(l.left-m.left)*r),s=Math.max(s,(m.right-l.right)*r)),f.y||(o=Math.max(o,(l.top-m.top)*i),a=Math.max(a,(m.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function ms(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=se(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let f=qt({scale:c});return{a:f.a,b:f.b,c:f.c,d:f.d}}function i(c,f,l,u){let p=Math.sqrt(c*c+f*f)||0,h=0,d=0;if(p>0){let m=c/p,g=f/p;h=m*l+g*u;let y=l-m*h,b=u-g*h;d=Math.sqrt(y*y+b*b)||0,d>0?h=h/d:h=0}return{a:p,b:0,c:h*d,d}}let o=c=>{let f=se(t).scale;if(!f)return c;let l=qt({scale:f,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===6&&c.every(Number.isFinite)){let[f,l,u,p]=c,h=i(f,l,u,p);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===16&&c.every(Number.isFinite)){let f=c[0],l=c[1],u=c[4],p=c[5],h=i(f,l,u,p);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),f=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return o(f)}catch{return null}}function Re(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,f=n.e||0,l=n.f||0;function u(y,b){let w=y-r,C=b-i,x=o*w+a*C,S=s*w+c*C;return x+=r+f,S+=i+l,[x,S]}let p=[u(0,0),u(t,0),u(0,e),u(t,e)],h=1/0,d=1/0,m=-1/0,g=-1/0;for(let[y,b]of p)y<h&&(h=y),b<d&&(d=b),y>m&&(m=y),b>g&&(g=b);return{minX:h,minY:d,maxX:m,maxY:g,width:m-h,height:g-d}}function en(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let f=a.toLowerCase();return f==="left"||f==="top"?0:f==="center"?c/2:f==="right"||f==="bottom"?c:f.endsWith("px")?parseFloat(f)||0:f.endsWith("%")?(parseFloat(f)||0)*c/100:/^-?\d+(\.\d+)?$/.test(f)&&parseFloat(f)||0};return{ox:s(i,e),oy:s(o,n)}}function se(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":f.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var to=null;function Ql(){if(to?.isConnected)return to;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),J(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),to=t,t}function qt(t){let e=o=>{let s=[],a=0,c=0,f=String(o).trim();for(let l=0;l<f.length;l++)f[l]==="("?a++:f[l]===")"?a--:/\s/.test(f[l])&&!a&&(l>c&&s.push(f.slice(c,l)),c=l+1);return c<f.length&&s.push(f.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=Ql(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("Invalid transform composition");o.appendChild(s);try{return Jl(s)}finally{s.remove()}}}function gs(t){let e=W(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function Jl(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Ss=new WeakSet;function In(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function so(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return ue(e)?e.host:null}function Zl(t,e){for(let n=e;n;n=so(n))if(n===t)return!0;return!1}function tf(t,e){for(let n=so(t);n&&n!==e&&n?.nodeType===1;n=so(n)){let r=W(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function co(t,e){try{return qt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function xs(t,e,n,r,i){let o=t.getBoundingClientRect();vt(e)&&W(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!vt(a)||c?.nodeType!==1||c===t||!Zl(t,c))continue;let f=r.get(c)||W(c),l=f.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let u=c.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;Ss.add(a);let p=f.transform&&f.transform!=="none"?f.transform:"",h=se(c),d=!!(p||h.rotate!=="0deg"||h.scale||h.translate),m=d?co(p,h):null,g=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,y=u.width,b=u.height;g||(y=c.offsetWidth||u.width,b=c.offsetHeight||u.height);let w=c.getRootNode&&ue(c.getRootNode()),C=o,x=t.clientLeft||0,S=t.clientTop||0;if(w){let R=tf(c,t);R&&(C=R.getBoundingClientRect(),x=R.clientLeft||0,S=R.clientTop||0)}let A=u.left-C.left-x,v=u.top-C.top-S;if(d)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:R,oy:E}=en(f,y,b),T=Re(y,b,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},R,E);A-=T.minX,v-=T.minY}if(l!=="fixed"){let R=a.cloneNode(!1);R.setAttribute("data-snap-ph","1"),R.style.position="static",R.style.visibility="hidden",R.style.width=`${y}px`,R.style.height=`${b}px`,R.style.boxSizing="border-box",a.parentElement?.insertBefore(R,a)}let M=y+2,k=b;i&&(Math.abs(v-i.y)<.5&&(v-=1,k+=1),Math.abs(A-i.x)<.5&&(A-=1,M+=1)),a.style.position="absolute",a.style.left=`${A}px`,a.style.top=`${v}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${M}px`,a.style.height=`${k}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function vs(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){D(n,"stripRootShadows boxShadow",s)}try{e.style.textShadow="none"}catch(s){D(n,"stripRootShadows textShadow",s)}try{e.style.outline="none"}catch(s){D(n,"stripRootShadows outline",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){D(n,"stripRootShadows filter",s)}}function ks(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function ys(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function ef(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Cs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!ys(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=ef(s,i);if(!c)break;let f=n?Array.from(a.children).find(p=>n.get(p)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),u=parseFloat(l[`margin${o}`])||0;if(f&&f.style&&u>0&&(f.style[`margin${o}`]="0px"),ys(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=f}}}var nf=new Set(["xml","xlink"]);function rf(t,e){if(t.startsWith("*")||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!nf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var of=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,bs=t=>t.replace(of,e=>e.length===2?e:""),sf=/^data:[^,]{0,120};base64,/;function Wn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(rf(c.name,n)){a.removeAttribute(c.name);continue}if(sf.test(c.value))continue;let f=bs(c.value);if(f!==c.value)try{a.setAttribute(c.name,f)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=bs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function af(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var cf=new Set(["img","canvas","video","iframe","object","embed"]);function lf(t){return Bt(t)||cf.has(t?.localName)}function ff(t,e){if(t?.nodeType!==1||af(t)||lf(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function As(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&ff(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",u=c.overflowX||c.overflowInline||"visible";(l!=="visible"||u!=="visible")&&(s.style.overflow="visible")}let f=Array.from(s.children);if(r)for(let l of f){let u=r.get(l);u&&u.nodeType===1&&i(u,l)}else{let l=Array.from(o.children);for(let u=0;u<Math.min(l.length,f.length);u++)i(l[u],f[u])}}i(t,e)}function uf(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function df(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){D(e,"exclude selector match failed",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){D(e,"exclude predicate failed",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){D(e,"filter function failed",n)}return!1}function lo(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let h of a){if(df(h,e)||!uf(h))continue;let d=h.getBoundingClientRect(),m=d.top-r.top,g=d.bottom-r.top;g<=m||(m<i&&(i=m),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,f=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,u=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return f+l+u+p+c}var I=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,Fe=.75;function Ms(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,f=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-f)>.02)return 0;let l=s.createElement("div");J(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let u=l.attachShadow({mode:"open"}),p=s.createElement("style");p.textContent=n,u.appendChild(p);let h=e.cloneNode(!0);u.appendChild(h),s.body.appendChild(l);let d=0,m=(g,y,b)=>{let w=W(g),C=w.boxSizing==="border-box",x=(S,A,...v)=>{let M=parseFloat(S);if(!Number.isFinite(M))return A;let k=M+(C?0:v.reduce((R,E)=>R+(parseFloat(E)||0),0));return Math.abs(k-A)<=.51?k:A};return{width:x(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:x(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,C=b>0&&g.height>0?g.height/b:1,x=(S,A,v=!1)=>{let M=S.children,k=A.children,R=Math.min(M.length,k.length);for(let E=0;E<R;E++){let T=M[E],N=k[E],O=r.get(T),H=v||Ss.has(T);if(O?.nodeType===1&&vt(T)&&T.style&&O.isConnected){let _=O.getBoundingClientRect();if(_.width>0&&_.height>0){let L=N.getBoundingClientRect(),$=_.width/c,F=_.height/f,V=L.width,z=L.height,q=O.offsetWidth||$,B=O.offsetHeight||F,Z=N.offsetWidth||V,Mt=N.offsetHeight||z,Lt=Math.abs($-q)>Fe||Math.abs(F-B)>Fe||Math.abs(V-Z)>Fe||Math.abs(z-Mt)>Fe;if(H){let at=m(N,Z,Mt);$=V>0?$*w*at.width/V:$,F=z>0?F*C*at.height/z:F,V=at.width,z=at.height}else if(Lt){let at=m(O,q,B),$t=m(N,Z,Mt);$=at.width,F=at.height,V=$t.width,z=$t.height}let mt=V-$,st=z-F;(Math.abs(mt)>Fe||Math.abs(st)>Fe)&&(T.style.boxSizing="border-box",T.style.width=`${I($)}px`,T.style.height=`${I(F)}px`,d++)}}x(T,N,H)}};x(e,h)}finally{l.remove()}return d}var pf=/::-webkit-scrollbar(-[a-z]+)?\b/i;function ao(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=ao(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=ao(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(pf.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var ws=new WeakMap;function hf(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function mf(t){if(!t||!t.styleSheets)return"";let e=hf(t),n=ws.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=ao(s,r))}catch{}return ws.set(t,{fp:e,css:i}),i}function Es(t,e){let n=Mr(t.clone).sort(),r=n.join(","),i;P.baseStyle.has(r)?i=P.baseStyle.get(r):(i=Er(n,Ke(t.element)),P.baseStyle.set(r,i));let o=mf(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=i,t.scrollbarCSS=o,{baseCSS:i,scrollbarCSS:o,fontsCSS:e}}kt();var On=new Set;async function _s(t,e={}){Rt(),wn(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e},i=null,o=null;if(e.clip&&(o=In(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=Li(t)}catch(d){D(r,"prepareSelectionContext failed",d)}let s,a="",c="";if(On.size){let d=(m,g)=>{for(let y=g;y;y=y.assignedSlot||y.parentElement||y.getRootNode()?.host)if(y===m)return!0;return!1};for(;;){let m=[...On].filter(({root:g})=>d(g,t)||d(t,g)).map(({promise:g})=>g.catch(()=>{}));if(!m.length)break;await Promise.all(m)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let d=t.getBoundingClientRect(),m=t.ownerDocument?.defaultView||window,g=d.right<=0||d.bottom<=0||d.left>=m.innerWidth||d.top>=m.innerHeight,y=[];if(g&&(()=>{let w=[];t.shadowRoot&&w.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&w.push(C.shadowRoot);for(;w.length;){let C=w.pop(),x=C.host?.localName==="calcite-icon";for(let S of C.querySelectorAll("*")){if(S.shadowRoot&&w.push(S.shadowRoot),!x||S.localName!=="svg")continue;let A=S.querySelectorAll("path");if(!A.length||[...A].some(M=>M.getAttribute("d")?.trim()))continue;let v=S.getBoundingClientRect();v.width&&v.height&&y.push(S)}}})(),y.length){let w=(async()=>{let x=t.style,S=t.hasAttribute("style"),A=new Map,v=(M,k)=>{A.has(M)||A.set(M,{value:x.getPropertyValue(M),priority:x.getPropertyPriority(M)}),x.setProperty(M,k,"important");let R=A.get(M);R.forcedValue=x.getPropertyValue(M),R.forcedPriority=x.getPropertyPriority(M)};try{v("left","0"),v("top","0"),v("right","auto"),v("bottom","auto"),v("margin-top","0"),v("margin-right","0"),v("margin-bottom","0"),v("margin-left","0"),v("transform","none"),v("translate","none"),v("opacity","0"),v("pointer-events","none");let M=t.getBoundingClientRect();if(M.right<=0||M.bottom<=0||M.left>=m.innerWidth||M.top>=m.innerHeight){let E=t.parentElement?.getBoundingClientRect(),T=E&&E.right>0&&E.left<m.innerWidth?Math.max(0,E.left):0,N=E&&E.bottom>0&&E.top<m.innerHeight?Math.max(0,E.top):0;v("position","fixed"),v("left",`${T}px`),v("top",`${N}px`)}await dt(100);let k=Date.now()+1500,R=()=>y.some(E=>{if([...E.querySelectorAll("path")].some(N=>N.getAttribute("d")?.trim()))return!1;let T=E.getBoundingClientRect();return T.width&&T.height&&T.right>0&&T.bottom>0&&T.left<m.innerWidth&&T.top<m.innerHeight});for(;Date.now()<k&&R();)await new Promise(E=>setTimeout(E,25));await dt(100)}finally{for(let[M,k]of A)x.getPropertyValue(M)!==k.forcedValue||x.getPropertyPriority(M)!==k.forcedPriority||(k.value?x.setProperty(M,k.value,k.priority):x.removeProperty(M));!S&&!x.length&&t.removeAttribute("style"),await dt(100)}})(),C={root:t,promise:w};On.add(C);try{await w}finally{On.delete(C)}}}catch{}let f=us(t),l=Ln(t,o);if(o){let d=t.getBoundingClientRect(),m=t.offsetWidth||d.width,g=t.offsetHeight||d.height,y=d.width&&Math.abs(m-d.width)>=1?m/d.width:1,b=d.height&&Math.abs(g-d.height)>=1?g/d.height:1;i={x:(o.left-d.left)*y,y:(o.top-d.top)*b,width:o.width*y,height:o.height*b}}try{s=await ie(t,r,e)}catch(d){throw console.warn("deepClone failed:",d),d}finally{l(),f()}try{fs(s,void 0,t)}catch(d){console.warn("inlineExternal defs or symbol failed:",d)}try{await _e(t,s,r,e)}catch(d){console.warn("inlinePseudoElements failed:",d)}await vn(s,r);for(let[d,m]of r.nodeMap.entries())if(m?.tagName==="STYLE"&&d?.tagName==="STYLE"&&!d.hasAttribute("data-sd"))try{let g=m.sheet&&m.sheet.cssRules;g&&/@media/i.test(d.textContent||"")&&(d.textContent=oe(g))}catch{}try{let d=s.querySelectorAll("style[data-sd]");for(let m of d)c+=m.textContent||"",m.remove()}catch(d){D(r,"Failed to extract shadow CSS from style[data-sd]",d)}let u=je(r.styleMap);a=Array.from(u.entries()).map(([d,m])=>`.${m}{${d}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__pseudoCSS||"");a=h+a;for(let[d,m]of r.styleMap.entries())fo(d,m,u);try{gf(t,s,r.nodeMap)}catch(d){D(r,"top-layer lift failed",d)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let d=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};xs(t,s,r.nodeMap,r.styleCache,d)}catch(d){D(r,"freezeViewportPositioned failed",d)}for(let[d,m]of r.nodeMap.entries())r.clip&&m===t||uo(d,m);if(t===r.nodeMap.get(s)){let d=r.styleCache.get(t)||W(t);r.styleCache.set(t,d);let m=hr(d.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=m||"",s.style.translate="none"}for(let[d,m]of r.nodeMap.entries())m.tagName==="PRE"&&(d.style.marginTop="0",d.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function gf(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),f=c.backgroundColor,l=c.backgroundImage;if(f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||l&&l!=="none"){let p=document.createElement("div");p.setAttribute("data-sd-backdrop",""),p.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${f};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(p)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function fo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&ue(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function uo(t,e){let n=e.scrollLeft,r=e.scrollTop;if(!(n||r)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let s=t.querySelectorAll("*");for(let a of s){if(a.nodeType!==1||a.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=a.style.position;if(c==="fixed"||c==="absolute"){let f=parseFloat(a.style.top)||0,l=parseFloat(a.style.left)||0;a.style.top=`${f+r}px`,a.style.left=`${l+n}px`,c==="fixed"&&(a.style.position="absolute")}}}catch{}let o=document.createElement("div");for(o.style.all="unset",o.style.transform=`translate(${-n}px, ${-r}px)`,o.style.willChange="transform",o.style.display="inline-block",o.style.width="100%";t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}de();Qt();ut();var Rs="http://www.w3.org/1999/xlink";function yf(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Rs,"href"):null)}function bf(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Dn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let d=a.currentSrc||a.src||Ce(a.getAttribute("srcset"),a)||"";d&&a.setAttribute("src",d)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let f=P.image?.get(c);if(f){a.src=f,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await it(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){P.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:p}=bf(a),{fallbackURL:h}=e||{};if(h)try{let d=typeof h=="function"?await h({width:u,height:p,src:c,element:a}):h;if(d){let m=await it(d,{as:"dataURL",useProxy:e.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=u),a.height||(a.height=p);return}}}catch{}if(e.placeholders!==!1){wt(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let d=document.createElement("div");d.style.cssText=[`width:${u}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",a.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${u}px;height:${p}px;visibility:hidden;`,a.replaceWith(d)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=yf(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let f=await it(c,{as:"dataURL",useProxy:e.useProxy});f.ok&&typeof f.data=="string"&&f.data.startsWith("data:")&&(a.setAttribute("href",f.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Rs,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}kt();pt();var wf=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Sf=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],xf=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],vf=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function kf(t,e,n,r){let i=n.get(t)||W(t);n.has(t)||n.set(t,i);let o=ui(t),s=o?d=>d in o?o[d]:"":d=>i.getPropertyValue(d),a=s("border-image"),c=s("border-image-source"),f=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),u=s("background-color"),p=l&&l!=="none"||u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=zt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(p&&!h)for(let d of xf){let m=s(d);m&&e.style.setProperty(d,m)}for(let d of wf){if(h&&d==="background-image")continue;let m=i.getPropertyValue(d);if(d==="background-image"&&(!m||m==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(m=Ht(b).filter(w=>/url\s*\(/.test(w)).join(", ")||m)}if(!m||m==="none")continue;let g=Ht(m),y=await Promise.all(g.map(b=>pe(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(d,y.join(", "))}for(let d of Sf){let m=s(d);!m||m==="initial"||e.style.setProperty(d,m)}if(f)for(let d of vf){let m=s(d);!m||m==="initial"||e.style.setProperty(d,m)}if(p&&/fixed/.test(s("background-attachment")||""))try{await Af(t,e,i)}catch{}}function Cf(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let p=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*p,h:n*p}}let s=o.split(/\s+/),a=(p,h)=>{if(p==="auto"||p===void 0)return null;if(p.endsWith("px"))return parseFloat(p);if(p.endsWith("%"))return h*parseFloat(p)/100},c=a(s[0],r),f=a(s[1],i);if(c===void 0||f===void 0)return null;let l=c,u=f;return l==null&&u==null?(l=e||r,u=n||i):l==null?l=e&&n?u*(e/n):r:u==null&&(u=e&&n?l*(n/e):i),!l||!u?null:{w:l,h:u}}async function Af(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(d=>d.trim()),i=Ve();if(!i)for(let d=t.parentElement;d&&!i;d=d.parentElement){let m=W(d);(m.transform&&m.transform!=="none"||m.filter&&m.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,f=Ht(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(d=>d.trim()),u=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(d=>d.trim()),p=[],h=[];for(let d=0;d<f.length;d++){let m=r[d%r.length]||"scroll",g=l[d%l.length],y=u[d%u.length];if(m!=="fixed"){p.push(g),h.push(y);continue}let b=0,w=0,C=f[d]&&f[d].match(/url\(["']?([^"')]+)["']?\)/);if(C)try{let k=new Image;k.src=C[1],await k.decode(),b=k.naturalWidth,w=k.naturalHeight}catch{p.push(g),h.push(y);continue}let x=Cf(g,b,w,a,c);if(!x){p.push(g),h.push(y);continue}let S=y.split(/\s+/),A=(k,R,E)=>{if(!k)return 0;if(k.endsWith("px"))return parseFloat(k);if(k.endsWith("%"))return(R-E)*parseFloat(k)/100},v=A(S[0]||"0%",a,x.w),M=A(S[1]||S[0]||"0%",c,x.h);if(v===void 0||M===void 0){p.push(g),h.push(y);continue}p.push(`${Bn(x.w)}px ${Bn(x.h)}px`),h.push(`${Bn(v-o.left)}px ${Bn(M-o.top)}px`)}e.style.setProperty("background-size",p.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Bn=t=>Math.round(t*100)/100;async function Un(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Or(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let f of c.children){if(f.tagName==="STYLE")continue;let l=i.get(f);l&&Or(l)&&o.push([l,f]),s.push(f)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([f,l])=>kf(f,l,n,r)))}pt();function Ts(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let f=W(c),l=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:Rf(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let f=e.cloneNode(!0);_f(f,e,a.orig.getBoundingClientRect(),n),Ff(Fs(f,a.path));for(let l=0;l<c;l++){let u=Fs(f,r[l].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:c,bf:f,copy:l}of s)Mf.has(a.tagName)||Ef(a,c,f,l,o)}var Mf=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function Ef(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=W(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let f=document.createElement("div");f.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",f.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(u,s.getPropertyValue(u));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(f)}var Hn=128;function _f(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Hn||l.right<n.left-Hn||l.top>n.bottom+Hn||l.bottom<n.top-Hn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,f=s.children;for(let l=0;l<c.length;l++)i.push([c[l],f[l]])}}function Rf(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Fs(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function Ff(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}pt();ut();ut();function $s(t){return Uo(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}Qt();function jn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let f=o.getBoundingClientRect();if(f.width>0||f.height>0){let l=Math.max(f.right,f.left+(o.scrollWidth||0)),u=Math.max(f.bottom,f.top+(o.scrollHeight||0));if(l<e.left-r||f.left>e.right+r||u<e.top-r||f.top>e.bottom+r)return}}let s=getComputedStyle(o),a=Tf(o,s);a&&n.push(a);let c=$f(o,s);c&&n.push(c);for(let f of o.children||[])i(f)}return i(t),()=>n.forEach(o=>o())}function Tf(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Pf(e);if(n<=0)return()=>{};if(!Ls(t))return()=>{};let r=Ns(t),i=r.text,o=Lf(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Nf(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let f=0,l=i.length,u=-1;for(;f<=l;){let h=f+l>>1;r.write(i.slice(0,zn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(u=h,f=h+1):l=h-1}let p=(u>=0?i.slice(0,zn(i,u)):"")+"\u2026";return r.write(p),Ps(t,p,r)}function $f(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!Ls(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=Ns(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,zn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,zn(r,s)):"")+"\u2026";return n.write(a),Ps(t,a,n)}function Ps(t,e,n){return()=>{t.textContent===e&&n.restore()}}function Ns(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function zn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Pf(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Nf(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Lf(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Ls(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Is=["clone","render"],Vn={clone:0,render:1},xt="render";function Ws(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:xt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?xt:o.needs;if(!Object.prototype.hasOwnProperty.call(Vn,s))throw new Error(`[snapdom] plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${Is.join(", ")}`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,Vn[s])}if(n<0)return{stage:xt,loweredBy:[]};let i=Is[n];return{loweredBy:i===xt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Te(t,e){return Vn[t]>=Vn[e]}function Os(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[snapdom] no ${n}: this capture stopped at '${t}' because ${r} declared needs: '${t}' (result.needs says so too). It is not re-captured on demand \u2014 that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var nn=[];function rn(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Ds(...t){let e=t.flat();for(let n of e){let r=rn(n);if(r){if(r.needs!==void 0&&r.needs!==xt)throw new Error(`[snapdom] global plugin '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}. A global plugin must run to '${xt}': lowering it here would stop EVERY capture in the app short of pixels. Pass it per capture instead: snapdom(el, { plugins: [<plugin>] }).`);nn.some(i=>i&&i.name&&r.name&&i.name===r.name)||nn.push(r)}}}function Bs(t){return t&&Array.isArray(t.plugins)?t.plugins:nn}async function Nt(t,e,n){let r=n,i=Bs(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function qn(t,e,n){let r=[],i=Bs(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}var If=0;function Wf(t){let e=[];if(Array.isArray(t))for(let n of t){let r=rn(n);if(!r)continue;r.name||(r.name=`anonymous-${++If}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of nn)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function Us(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Wf(e)),t}function Hs(){return nn.slice()}var Of=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function Gn(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=rn(n);if(!(!r||r.pure===!0)){for(let i of Of)if(typeof r[i]=="function")return!0}}return!1}ut();ye();var ce="data-snapdom-asset",qs="http://www.w3.org/1999/xlink",Df=0;function Yn(t,e,n,r,i,o){let s=o.__compressedAssets||(o.__compressedAssets=new WeakMap),a=s.get(t);a||(a={token:String(++Df),properties:[]},s.set(t,a),t.setAttribute(ce,a.token));let c=a.properties.find(f=>f.kind===e&&f.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var Gs=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function Kn(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${ce}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(ce)!==o.token)continue;let s=o.properties.filter(a=>Gs(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function Qn(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${ce}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(ce,i.token))}}function Xs(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${ce}]`))for(let s of e.get(o.getAttribute(ce))||[])Gs(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(qs,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function zs(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function po(t,e){let n=e.element||t,r=n.isConnected?W(n):n.style,i=e.__compressionClip,o=(h,d)=>{try{return h[d]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),f=Number.isFinite(e.height);if(!i&&(c||f)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:qt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let d=Math.abs(h.a)*s+Math.abs(h.c)*a,m=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,d),a=Math.min(a,m)}}catch{s=0,a=0}let l=(c||f?Math.max(c?s?e.width/s:1/0:0,f?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let u=new WeakMap,p=h=>{if(!h||h.nodeType!==1)return 1;if(u.has(h))return u.get(h);let d=h.isConnected?W(h):h.style,m=1;try{d?.perspective&&d.perspective!=="none"&&(m=1/0);let g=d?.transform;if(g&&g!=="none")m*=zs(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<h.transform.baseVal.numberOfItems;b++){let w=h.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}m*=zs(y)}if(d?.scale&&d.scale!=="none"){let y=d.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));m*=Math.max(...y.map(Math.abs))}if(h!==n&&d?.zoom&&d.zoom!=="normal"&&(m*=parseFloat(d.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=x=>/^\d+(?:\.\d+)?px$/.test(d?.[x]||"")?parseFloat(d[x]):o(h,x),w=b("width"),C=b("height");m*=w>0&&C>0?Math.max(w/y.width,C/y.height):1/0}}catch{m=1/0}return Number.isFinite(m)||(m=1/0),h!==n&&(m*=p(h.parentElement||h.getRootNode?.().host)),u.set(h,m),m};return{density:l,stretch:p}}var Ys=.92,Ks=1;async function Bf(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Uf(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Hf=64*1024,js=32*1024*1024,Xn=new Map;function zf(t,e,n,r){if(n.length+(r?.length||0)>js)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>js;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function jf(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function Vf(t){let e=jf(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function Vs(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var qf=`self.onmessage = async (e) => {
|
|
14
|
+
`):l+=p[0]}return l+=a.slice(u),l}let s=Xi(t,e||location.href);return s=await o(s,e||location.href,0),s}var ts=/url\((["']?)([^"')]+)\1\)/g,Ul=/@font-face[^{}]*\{[^}]*\}/g;function xt(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function es(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let f=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[f,l]};if(s){let c=a(o),f=a(s),l=Array.isArray(c)?c[0]:c,u=Array.isArray(f)?f[1]:f;e.push([Math.min(l,u),Math.max(l,u)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function ns(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function Yr(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(ts)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function qr(t,e,n="",r){let i=t;for(let o of t.matchAll(ts)){let s=Zt(o[0]);if(!s)continue;let a=s;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,e||location.href).href}catch{}if(!Mt(a,r)){if(P.resource?.has(a)){i=i.replace(o[0],`url(${P.resource.get(a)})`);continue}try{let c=await it(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let f=c.data;P.resource?.set(a,f),i=i.replace(o[0],`url(${f})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return i}function Hl(t){if(!t.length)return null;let e=(a,c)=>t.some(([f,l])=>!(l<a||f>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function Yi(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Hl(o);if(s&&r.has(s))return!0}return!1}}function zl(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=xt(o,"font-family"),a=Xr(s),c=xt(o,"font-weight","400"),f=xt(o,"font-style","normal"),l=xt(o,"font-stretch","100%"),u=xt(o,"unicode-range"),p=xt(o,"src"),m=Yr(p,location.href),d=m.length?m.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),h=[String(a||"").toLowerCase(),c,f,l,u.toLowerCase(),d].join("|");n.has(h)||(n.add(h),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var Ki=new WeakMap,jl=0;function Vl(t){let e=Ki.get(t);return e===void 0&&(e=jl++,Ki.set(t,e)),e}function ql(t,e,n,r,i,o,s,a,c){let f=Array.from(t||[]).sort().join("|"),l=0,u=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,u++}let p=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",m=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),d=r||"",h=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Vl(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${f}::ex=${p}::lf=${m}::px=${d}::fd=${h}::doc=${g}::cp=${l}::n=${u}::ic=${y}::env=${c}`}async function Gr(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=Tn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Tn}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let f={...r,depth:(r.depth||0)+1};await Gr(a.styleSheet,c,n,f);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await Gr(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),f=Xr(c);if(!f||Mt(f,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),u=(a.style.getPropertyValue("font-style")||"").trim(),p=(a.style.getPropertyValue("font-stretch")||"").trim(),m=(a.style.getPropertyValue("font-variation-settings")||"").trim(),d=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=u||"normal",b=p||"100%",w=(u?`font-style:${u};`:"")+(l?`font-weight:${l};`:"")+(p?`font-stretch:${p};`:"")+(m?`font-variation-settings:${m};`:"")+(h?`unicode-range:${h};`:""),k=r.faceMatchesRequired(f,y,g,b);if(!k&&!r.requiredIndex.has(f.toLowerCase()))continue;let x=es(h);if(!ns(r.usedCodepoints,x))continue;let S={family:f,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:h,srcRaw:d,srcUrls:Yr(d,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,x))continue;if(!k){r.provisionalFaces.push({family:f.toLowerCase(),block:`@font-face{font-family:${f};src:${d};${w}}`,srcRaw:d,baseHref:e||location.href});continue}r.coveredFamilies.add(f.toLowerCase());let A=`"${String(f).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(d)){let v=await qr(d,e||location.href,r.useProxy,r.iconMatchers);await n(`@font-face{font-family:${A};src:${v};${w}}`)}else await n(`@font-face{font-family:${A};src:${d};${w}}`)}}}async function rs({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[A,v,M,C]=String(S).split("__");if(!A)continue;let R=A.toLowerCase(),_=c.get(R)||[];_.push({w:parseInt(v,10),s:M,st:parseInt(C,10)}),c.set(R,_)}function f(S,A,v,M){let C=String(S).toLowerCase();if(!c.has(C))return!1;let R=c.get(C),_=Nl(v),T=Ll(A),N=Il(M),O=_.min!==_.max,H=_.min,E=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),L=!1;for(let $ of R){let F=O?$.w>=_.min&&$.w<=_.max:$.w===H,V=E(Fn($.s)),z=$.st>=N.min&&$.st<=N.max;if(F&&V&&z){L=!0;break}}if(L)return!0;if(!O)for(let $ of R){let F=E(Fn($.s)),V=$.st>=N.min&&$.st<=N.max;if(Math.abs(H-$.w)<=300&&F&&V)return!0}if(!O&&T.kind==="normal"&&R.some(F=>Fn(F.s)!=="normal"))for(let F of R){let V=Math.abs(H-F.w)<=300,z=F.st>=N.min&&F.st<=N.max;if(V&&z)return!0}return!1}let l=Yi(n);Se(a),At();let u=ql(t,n,r,i,o,a,e,s,Se(a));if(P.resource?.has(u))return P.resource.get(u);let p=Dl(t),m=[],d=Zi;for(let S of a.querySelectorAll("style")){let A=S.textContent||"";for(let v of A.matchAll(d)){let M=(v[2]||v[4]||"").trim();if(!M||Vr(M,s))continue;a.querySelector(`link[rel="stylesheet"][href="${M}"]`)||m.push(M)}}let h=[];m.length&&await Promise.all(m.map(S=>new Promise(A=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return A(null);let v=a.createElement("link");v.rel="stylesheet",v.href=S,J(v),v.setAttribute("data-snapdom","injected-import");let M=setTimeout(()=>A(null),3e3),C=R=>{clearTimeout(M),A(R)};v.onload=()=>C(v),v.onerror=()=>C(null),a.head.appendChild(v),h.push(v)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of h)try{S.remove()}catch{}for(let S of w)try{if(Vr(S.href,s))continue;let A="",v=!1;try{v=new URL(S.href,location.href).origin===location.origin}catch{}if(!v){let C=Array.isArray(o)?o:[];if(!Ol(S.href,p,C))continue}if(v){let C=Array.from(a.styleSheets).find(R=>R.href===S.href);if(C)try{let R=C.cssRules||[];A=Array.from(R).map(_=>_.cssText).join("")}catch{}}if(!A){let C=await it(S.href,{as:"text",useProxy:i});C?.ok&&typeof C.data=="string"&&(A=C.data)}A=await Bl(A,S.href,i);let M="";for(let C of A.match(Ul)||[]){let R=xt(C,"font-family"),_=Xr(R);if(!_||Mt(_,s))continue;let T=xt(C,"font-weight","400"),N=xt(C,"font-style","normal"),O=xt(C,"font-stretch","100%"),H=xt(C,"unicode-range"),E=xt(C,"src"),L=Yr(E,S.href),$=f(_,N,T,O);if(!$&&!c.has(_.toLowerCase()))continue;let F=es(H);if(!ns(e,F))continue;let V={family:_,weightSpec:T,styleSpec:N,stretchSpec:O,unicodeRange:H,srcRaw:E,srcUrls:L,href:S.href};if(n&&l(V,F))continue;if(!$){b.push({family:_.toLowerCase(),block:C,srcRaw:E,baseHref:S.href});continue}y.add(_.toLowerCase());let z=/url\(/i.test(E)?await qr(C,S.href,i,s):C;M+=z}M.trim()&&(g+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",S.href)}let k={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:f,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?Yi(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},x=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of x)if(!(S.href&&w.some(A=>A.href===S.href)))try{let A=S.href||a.baseURI||location.origin+"/";A&&k.visitedSheets.add(A),await Gr(S,A,async v=>{g+=v},k)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await qr(S.block,S.baseHref,i,s):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let A=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Mt(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===A.toLowerCase()))continue;let v=S._snapdomSrc;if(!String(v).startsWith("data:"))if(P.resource?.has(S._snapdomSrc))v=P.resource.get(S._snapdomSrc);else try{let M=await it(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,P.resource?.set(S._snapdomSrc,v);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${A}';src:url(${v});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let A=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!A||Mt(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===A.toLowerCase()))continue;let v=S.weight!=null?String(S.weight):"normal",M=S.style!=null?String(S.style):"normal",C=S.stretchPct!=null?`${S.stretchPct}%`:"100%",R=String(S.src||""),_=R;if(!_.startsWith("data:"))if(P.resource?.has(R))_=P.resource.get(R);else try{let T=await it(R,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")_=T.data,P.resource?.set(R,_);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",R);continue}g+=`@font-face{font-family:'${A}';src:url(${_});font-style:${M};font-weight:${v};font-stretch:${C};}`}return g&&(g=zl(g),P.resource?.set(u,g)),g}function $n(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let u of l)r.add(u.codePointAt(0))},o=l=>{let u=$l(l.fontFamily);if(u.length)for(let p of u)n.add(`${p}__${Rn(l.fontWeight)}__${Fn(l.fontStyle)}__${Pl(l.fontStretch)}`)},s=ke(t),a=t.getRootNode(),c=l=>{o(W(l));let u=l.getRootNode()===a?s:ke(l);for(let p of["::before","::after"]){let m=p==="::before"?u.before:u.after;if(m!==null){if(m==="")continue;try{if(!l.matches(m))continue}catch{}}let d=W(l,p),h=d&&d.content;if(!(!h||h==="none"||h==="normal"))if(o(d),/^["']/.test(h))i(h.slice(1,-1));else{let g=h.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},f=[t];for(let l=0;l<f.length;l++){let u=f[l];u.nodeType===Node.ELEMENT_NODE&&c(u),u.shadowRoot&&f.push(u.shadowRoot);let p=(t.ownerDocument||document).createTreeWalker(u,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;p.nextNode();){let m=p.currentNode;if(m.nodeType===Node.TEXT_NODE){if(e&&m.parentElement&&!e(m.parentElement))continue;i(m.nodeValue||"")}else{if(e&&!e(m))continue;c(m),m.shadowRoot&&f.push(m.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Pn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");J(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await dt(),await dt()}yt();function as(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function os(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function is(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function ss(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return os(t,!1);case"upper-alpha":case"upper-latin":return os(t,!0);case"lower-roman":return is(t,!1);case"upper-roman":return is(t,!0);default:return String(t)}}function nn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function cs(t){let e=new WeakMap,n=br(t)?t.documentElement:t,r=f=>f&&f.tagName==="LI",i=new WeakMap,o=f=>{let l=new Map;for(let[u,p]of f)l.set(u,p.slice());return l},s=(f,l,u)=>{let p=o(f),m;try{m=getComputedStyle(u)}catch{m=u.style}let d;try{d=m?.counterReset}catch{}if(d&&d!=="none")for(let[y,b]of nn(d,0)){let w=l.get(y);if(w&&w.length){let k=w.slice();k.push(b),p.set(y,k)}else p.set(y,[b])}let h;try{h=m?.counterSet}catch{}if(h&&h!=="none")for(let[y,b]of nn(h,0)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set(y,w)}let g;try{g=m?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of nn(g,1)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,p.set(y,w)}try{if(m?.display==="list-item"&&r(u)){let y=u.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,k=b===void 0?Number.isFinite(w)?w:1:b+1,x=y?.tagName==="OL"?parseInt(u.getAttribute("value"),10):NaN;Number.isFinite(x)&&(k=x),y&&i.set(y,k);let S=p.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=k,p.set("list-item",S)}}catch{}return p},a=(f,l,u)=>{let p=s(u,l,f);e.set(f,p);let m=p;for(let h of f.children)m=a(h,p,m);let d=new Map;for(let[h,g]of u){let y=g.length,b=m.get(h);d.set(h,b&&b.length?b.slice(0,y):g.slice())}for(let[h,g]of m)!d.has(h)&&g.length&&!l.has(h)&&d.set(h,g.slice(0,1));return d},c=new Map;return a(n,c,c),{get(f,l){let u=e.get(f)?.get(l);return u&&u.length?u[u.length-1]:0},getStack(f,l){let u=e.get(f)?.get(l);return u?u.slice():[]}}}function ls(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return ss(l,f)}else{let c=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),u=n.getStack(e,c);return u.length?u.map(m=>ss(m,l)).join(f):""}})}catch{return"- "}}de();var Ee=new WeakMap,fs=1e3;function Gl(t,e){let n=hs(t);return e?(e.__pseudoPreflightFp!==n&&(At(),e.__pseudoPreflight=us(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(At(),us(t,n))}function Nn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function hs(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let f=a.sheet,l=f?Nn(f):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",f=a.getAttribute("media")||"all";n+=`L${c}|m:${f}|`;let l=a.sheet,u=l?Nn(l):null;u&&(r+=u.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Nn(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function Kr(t,e,n){let r=Nn(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&Kr(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],f=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(f.includes(l))return!0}if(n.budget<=0)return!1}return!1}function us(t=document,e=hs(t)){let n=Ee.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&xe();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let f of i)if(c.includes(f))return Ee.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:fs};try{for(let c of s)if(Kr(c,i,a))return Ee.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:fs};for(let f=0;f<a.length&&c.budget>0;f++){let l=a[f],u=null;if(l.tagName,u=l.sheet||null,u&&Kr(u,i,c))return Ee.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Ee.set(t,{fingerprint:e,result:!0}),!0):(Ee.set(t,{fingerprint:e,result:!1}),!1)}function ds(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Xl(t,e){let n=null,r=()=>{if(!n)try{n=cs(t)}catch(i){D(e,"buildCounterContext failed",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Yl(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function Kl(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
15
|
+
`?"":r})}function Ql(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Kl(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function Qr(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],c),f}return a}}:e}function Jr(t,e,n){let r=new Map,i=(f,l)=>nn(f,l).map(([u,p])=>({name:u,num:p})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(f){if(r.has(f))return r.get(f).slice();let l=n.getStack(t,f);l=l.length?l.slice():[];let u=o.find(d=>d.name===f);if(u){let d=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,d]:[d]}let p=s.find(d=>d.name===f);if(p){let d=Number.isFinite(p.num)?p.num:0;l.length===0&&(l=[0]),l[l.length-1]=d}let m=a.find(d=>d.name===f);if(m){let d=Number.isFinite(m.num)?m.num:1;l.length===0&&(l=[0]),l[l.length-1]+=d}return r.set(f,l.slice()),l}return{get(f,l){let u=c(l);return u.length?u[u.length-1]:0},getStack(f,l){return c(l)},__incs:a}}var Jl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Zl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function ps(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let u=W(t).display||"";if(i==="::marker"?!u.includes("list-item"):!(u==="block"||u==="flow-root"||u==="list-item"||u==="inline-block"||u==="table-cell"||u==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(W(t).display||"").includes("list-item"))return;let s=W(t,i),a=W(t);if(!s)return;let c="";for(let u of o){let p=s.getPropertyValue(u);p&&p!==a.getPropertyValue(u)&&!(u==="background-color"&&p==="rgba(0, 0, 0, 0)")&&!(u==="vertical-align"&&p==="baseline")&&(c+=`${u}:${p};`)}if(i==="::marker"){let u=s.getPropertyValue("content");u&&u!=="normal"&&u!=="none"&&(c+=`content:${u};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function tf(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=W(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function ef(t,e,n,r){let i;try{i=W(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Yl(o),o=tf(o,t);let s=Qr(t,n,r),a=Jr(t,i,s),c=as(o)?ls(o,t,a):o;return{text:Ql(c),incs:a.__incs||[]}}function nf(t,e){if(e.__shadowPseudo)return!1;let n=ke(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Re(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Gl(o,n)&&!n.__shadowPseudo||!i&&nf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Xl(t.ownerDocument||document,n));let s=n.__counterCtx,a=ke(t);a.marker!==""&&ps(t,e,n,a.marker,"::marker",Jl),a.firstLine!==""&&ps(t,e,n,a.firstLine,"::first-line",Zl);for(let f of["::before","::after","::first-letter"]){let l=a[f==="::before"?"before":f==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let u=W(t,f);if(!u||u.content==="none"&&u.backgroundImage==="none"&&(u.backgroundColor==="transparent"||u.backgroundColor==="rgba(0, 0, 0, 0)")&&!ds(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(u.display==="none"||f!=="::first-letter"&&(u.content==="none"||u.content==="normal")){f==="::before"&&(e.dataset.snapdomHasBefore="1"),f==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(f==="::first-letter"){let U=W(t),G=(U?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let j=Dt=>u[Dt]!==U[Dt]&&(parseFloat(u[Dt])||0)!==0;if(!(u.color!==U.color||u.fontSize!==U.fontSize||u.fontWeight!==U.fontWeight||u.fontFamily!==U.fontFamily||u.fontStyle!==U.fontStyle||u.textTransform!==U.textTransform||u.float!==U.float&&u.float!=="none"||j("paddingTop")||j("paddingRight")||j("paddingBottom")||j("paddingLeft")||j("marginTop")||j("marginRight")||j("marginBottom")||j("marginLeft")))continue;let Et=Array.from(e.childNodes).find(Dt=>Dt.nodeType===Node.TEXT_NODE&&Dt.textContent?.trim().length>0);if(!Et)continue;let gt=Et.textContent,ue=/^\s*/.exec(gt)[0],dn=gt.slice(ue.length),De=dn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],fr=dn.slice(De?.length||0);if(!De||/[\uD800-\uDFFF]/.test(De))continue;let Ot=document.createElement("span");Ot.textContent=De,Ot.dataset.snapdomPseudo="::first-letter";let ur=ge(u,yn(t)),dr=me(ur,"span");n.styleMap.set(Ot,dr);let pn=document.createTextNode(fr);e.replaceChild(pn,Et),e.insertBefore(Ot,pn),ue&&e.insertBefore(document.createTextNode(ue),Ot);continue}let d=u.content??"",h=d===""||d==="none"||d==="normal",{text:g,incs:y}=ef(t,f,s,n.__siblingCounters),b=u.backgroundImage,w=u.backgroundColor,k=u.fontFamily,x=parseInt(u.fontSize)||32,S=parseInt(u.fontWeight)||!1,A=u.fontStyle||"normal",v=u.color||"#000",M=u.transform,C=Mt(k,r?.__iconMatchers),R=!h&&g!=="",_=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",N=ds(u),O=M&&M!=="none",H=d!=="none"&&d!=="normal",E=/^inline-/.test(u.display||""),L=H&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0||E),$=H&&u.boxShadow&&u.boxShadow!=="none",F=H&&u.outlineStyle&&u.outlineStyle!=="none"&&(parseFloat(u.outlineWidth)||0)>0;if(!(R||_||T||N||O||L||$||F)){if(y&&y.length&&t.parentElement){let U=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let j=Qr(t,s,n.__siblingCounters),Et=Jr(t,W(t,f),j).get(t,G);U.set(G,Et)}n.__siblingCounters.set(t.parentElement,U)}continue}let z=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),q=!1;if(R&&!C&&g.length>1&&!z){let U=W(t),G=parseFloat(U.fontSize)||16,j=parseFloat(U.lineHeight);Number.isFinite(j)||(j=G*1.5),t.getBoundingClientRect().height<j*1.6&&(e.style.whiteSpace="nowrap",q=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=f,B.style.pointerEvents="none",q&&(B.style.whiteSpace="nowrap");let Z=Si(t,f,u,n,r),_t=(W(t).display||"").toLowerCase(),Wt=_t.includes("flex")||_t.includes("grid");if(Wt){let U=Z["min-width"];(!U||U==="auto"||U==="0px")&&(Z["min-width"]="0px")}let mt=me(Z,"span",R,Wt);if(n.styleMap.set(B,mt),C&&g&&g.length===1){let{dataUrl:U,width:G,height:j}=await Qi(g,k,S,x,v,A),ft=document.createElement("img");ft.src=U,ft.style=`height:${x}px;width:${G/j*x}px;object-fit:contain;`,B.appendChild(ft),e.dataset.snapdomHasIcon="true"}else if(g&&z){let U=He(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zt(g);if(U?.trim())try{let G=await it(Ut(U),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let j=document.createElement("img");j.src=G.data,j.style=`width:${x}px;height:auto;object-fit:contain;`,B.appendChild(j)}}catch(G){console.error(`[snapdom] Error in pseudo ${f} for`,t,G)}}else!C&&R&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=u.backgroundRepeat,B.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(B.style.backgroundPositionX=u.backgroundPositionX,B.style.backgroundPositionY=u.backgroundPositionY):B.style.backgroundPosition=u.backgroundPosition,B.style.backgroundOrigin=u.backgroundOrigin,B.style.backgroundClip=u.backgroundClip,B.style.backgroundAttachment=u.backgroundAttachment,B.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(_)try{let U=jt(b),G=await Promise.all(U.map(j=>pe(j,r)));B.style.backgroundImage=G.join(", ")}catch(U){console.warn(`[snapdom] Failed to inline background-image for ${f}`,U)}T&&(B.style.backgroundColor=w);let st=u.maskImage||u.webkitMaskImage;if(st&&st!=="none")try{let G=(await Promise.all(jt(st).map(j=>pe(j,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let j of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])u[j]&&(B.style[j]=u[j])}catch(U){console.warn(`[snapdom] Failed to inline mask-image for ${f}`,U)}let $t=B.childNodes.length>0||B.textContent?.trim()!==""||_||T||N||O||L||$||F;if(y&&y.length&&t.parentElement){let U=n.__siblingCounters.get(t.parentElement)||new Map,G=Qr(t,s,n.__siblingCounters),j=Jr(t,W(t,f),G);for(let{name:ft}of y){if(!ft)continue;let Et=j.get(t,ft);U.set(ft,Et)}n.__siblingCounters.set(t.parentElement,U)}if(!$t)continue;f==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(u){console.warn(`[snapdom] Failed to capture ${f} for`,t,u)}}let c=Array.from(e.children).filter(f=>!f.dataset.snapdomPseudo);if(n.nodeMap)for(let f of c){let l=n.nodeMap.get(f);l?.nodeType===1&&await Re(l,f,n,r,!0)}else{let f=Array.from(t.children);for(let l=0;l<Math.min(f.length,c.length);l++)await Re(f[l],c[l],n,r,!0)}}yt();function ms(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=Ht(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),f="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let A=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(f,"href"):null);if(A)return A;let v=S.attributes;if(!v)return null;for(let M=0;M<v.length;M++){let C=v[M];if(!C||!C.name)continue;if(C.name==="href")return C.value;let R=C.name.indexOf(":");if(R!==-1&&C.name.slice(R+1)==="href")return C.value}return null},u=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),p=new Set,m=!1,d=(S,A=null)=>{if(!S)return;s.lastIndex=0;let v;for(;v=s.exec(S);){m=!0;let M=(v[1]||"").trim();M&&(u.has(M)||(p.add(M),A&&!A.has(M)&&A.add(M)))}},h=S=>{let A=S.querySelectorAll("use");for(let C of A){let R=l(C);if(!R||!R.startsWith("#"))continue;m=!0;let _=R.slice(1).trim();_&&!u.has(_)&&p.add(_)}let v='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';d(S.getAttribute("style")||"");for(let C of a)d(S.getAttribute(C));let M=S.querySelectorAll(v);for(let C of M){d(C.getAttribute("style")||"");for(let R of a)d(C.getAttribute(R))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let A="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",v=!1;try{v=!!(i.querySelector&&i.querySelector(A))}catch{return}if(!v)return;let M=["filter","clipPath","mask","maskImage","webkitMaskImage"],C=R=>{if(Ht(R))return;let _;try{_=getComputedStyle(R)}catch{return}for(let T of M){let N=_[T];N&&N.includes("url(")&&d(N)}};C(S);for(let R of S.querySelectorAll("*"))C(R)};for(let S of o)h(S);if(g(n),!m)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||u.has(S))return null;let A=c(S),v=M=>{let C=i.querySelector(M);return C&&!t.contains(C)?C:null};return v(`svg defs > *#${A}`)||v(`svg > symbol#${A}`)||v(`*#${A}`)};if(!p.size)return;let k=new Set(p),x=new Set;for(;k.size;){let S=k.values().next().value;if(k.delete(S),!S||u.has(S)||x.has(S))continue;let A=w(S);if(!A){x.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let v=A.cloneNode(!0);v.id||v.setAttribute("id",S),b.appendChild(v),x.add(S),u.add(S);let M=[v,...v.querySelectorAll("*")];for(let C of M){let R=l(C);if(R&&R.startsWith("#")){let T=R.slice(1).trim();T&&!u.has(T)&&!x.has(T)&&k.add(T)}let _=C.getAttribute?.("style")||"";_&&d(_,k);for(let T of a){let N=C.getAttribute?.(T);N&&d(N,k)}}}}yt();var Zr=new WeakMap,to=new WeakMap;function Ln(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([f,l])=>{let u={property:f,value:i.getPropertyValue(f),priority:i.getPropertyPriority(f)};return i.setProperty(f,l,"important"),u.forcedValue=i.getPropertyValue(f),u}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function gs(t){if(Zr.has(t))return Ln(t,[],Zr);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return Ln(t,s,Zr)}return()=>{}}function In(t,e=null){let n=[],r=i=>{if(!kt(i))return;if(to.has(i)){n.push(Ln(i,[],to));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(Ln(i,[["content-visibility","visible"]],to))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}pt();ut();bt();ye();bt();function no(t){return bs(t.boxShadow)}function ro(t){return bs(t.textShadow)}function bs(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let f=t[c];f==="("?r++:f===")"&&(r=Math.max(0,r-1)),f===","&&r===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let f=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(f.length<2)continue;let[l,u,p=0,m=0]=f,d=Math.abs(l)+p+m,h=Math.abs(u)+p+m;o=Math.max(o,d+Math.max(l,0)),a=Math.max(a,d+Math.max(-l,0)),s=Math.max(s,h+Math.max(u,0)),i=Math.max(i,h+Math.max(-u,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function oo(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function io(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function so(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let f=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[l=0,u=0,p=0]=f,m=Math.abs(l)+p,d=Math.abs(u)+p;i=Math.max(i,m+Math.max(l,0)),s=Math.max(s,m+Math.max(-l,0)),o=Math.max(o,d+Math.max(u,0)),r=Math.max(r,d+Math.max(-u,0))}return{bleed:{top:I(r),right:I(i),bottom:I(o),left:I(s)},has:a}}function rf(t){let e=no(t),n=ro(t),r=oo(t),i=io(t),o=so(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function of(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function ys(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function ws(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,f=ys(n.get(t)||W(t));if(f.x&&f.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let u of e.values()){if(u===t||u.nodeType!==1||u.ownerDocument!==t.ownerDocument)continue;let p=n.get(u);if(!p||!of(p))continue;let m=rf(p);if(!(m.top||m.right||m.bottom||m.left))continue;let d=u.getBoundingClientRect(),h={left:d.left-m.left/r,top:d.top-m.top/i,right:d.right+m.right/r,bottom:d.bottom+m.bottom/i};for(let g=u.parentElement;g;g=g.parentElement){let y=ys(n.get(g)||W(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(h.left=Math.max(h.left,b.left),h.right=Math.min(h.right,b.right)),y.y&&(h.top=Math.max(h.top,b.top),h.bottom=Math.min(h.bottom,b.bottom))}if(g===t)break}f.x||(c=Math.max(c,(l.left-h.left)*r),s=Math.max(s,(h.right-l.right)*r)),f.y||(o=Math.max(o,(l.top-h.top)*i),a=Math.max(a,(h.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function Ss(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=ae(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let f=Yt({scale:c});return{a:f.a,b:f.b,c:f.c,d:f.d}}function i(c,f,l,u){let p=Math.sqrt(c*c+f*f)||0,m=0,d=0;if(p>0){let h=c/p,g=f/p;m=h*l+g*u;let y=l-h*m,b=u-g*m;d=Math.sqrt(y*y+b*b)||0,d>0?m=m/d:m=0}return{a:p,b:0,c:m*d,d}}let o=c=>{let f=ae(t).scale;if(!f)return c;let l=Yt({scale:f,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===6&&c.every(Number.isFinite)){let[f,l,u,p]=c,m=i(f,l,u,p);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return o(m)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===16&&c.every(Number.isFinite)){let f=c[0],l=c[1],u=c[4],p=c[5],m=i(f,l,u,p);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return o(m)}}try{let c=new DOMMatrix(r),f=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return o(f)}catch{return null}}function Fe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,f=n.e||0,l=n.f||0;function u(y,b){let w=y-r,k=b-i,x=o*w+a*k,S=s*w+c*k;return x+=r+f,S+=i+l,[x,S]}let p=[u(0,0),u(t,0),u(0,e),u(t,e)],m=1/0,d=1/0,h=-1/0,g=-1/0;for(let[y,b]of p)y<m&&(m=y),b<d&&(d=b),y>h&&(h=y),b>g&&(g=b);return{minX:m,minY:d,maxX:h,maxY:g,width:h-m,height:g-d}}function rn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let f=a.toLowerCase();return f==="left"||f==="top"?0:f==="center"?c/2:f==="right"||f==="bottom"?c:f.endsWith("px")?parseFloat(f)||0:f.endsWith("%")?(parseFloat(f)||0)*c/100:/^-?\d+(\.\d+)?$/.test(f)&&parseFloat(f)||0};return{ox:s(i,e),oy:s(o,n)}}function ae(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":f.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var eo=null;function sf(){if(eo?.isConnected)return eo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),J(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),eo=t,t}function Yt(t){let e=o=>{let s=[],a=0,c=0,f=String(o).trim();for(let l=0;l<f.length;l++)f[l]==="("?a++:f[l]===")"?a--:/\s/.test(f[l])&&!a&&(l>c&&s.push(f.slice(c,l)),c=l+1);return c<f.length&&s.push(f.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=sf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("Invalid transform composition");o.appendChild(s);try{return af(s)}finally{s.remove()}}}function xs(t){let e=W(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function af(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var As=new WeakSet;function Wn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function ao(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Pt(e)?e.host:null}function cf(t,e){for(let n=e;n;n=ao(n))if(n===t)return!0;return!1}function lf(t,e){for(let n=ao(t);n&&n!==e&&n?.nodeType===1;n=ao(n)){let r=W(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function lo(t,e){try{return Yt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Ms(t,e,n,r,i){let o=t.getBoundingClientRect();kt(e)&&W(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!kt(a)||c?.nodeType!==1||c===t||!cf(t,c))continue;let f=r.get(c)||W(c),l=f.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let u=c.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;As.add(a);let p=f.transform&&f.transform!=="none"?f.transform:"",m=ae(c),d=!!(p||m.rotate!=="0deg"||m.scale||m.translate),h=d?lo(p,m):null,g=!h||!h.is2D||h.a===1&&h.b===0&&h.c===0&&h.d===1,y=u.width,b=u.height;g||(y=c.offsetWidth||u.width,b=c.offsetHeight||u.height);let w=c.getRootNode&&Pt(c.getRootNode()),k=o,x=t.clientLeft||0,S=t.clientTop||0;if(w){let R=lf(c,t);R&&(k=R.getBoundingClientRect(),x=R.clientLeft||0,S=R.clientTop||0)}let A=u.left-k.left-x,v=u.top-k.top-S;if(d)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:R,oy:_}=rn(f,y,b),T=Fe(y,b,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},R,_);A-=T.minX,v-=T.minY}if(l!=="fixed"){let R=a.cloneNode(!1);R.setAttribute("data-snap-ph","1"),R.style.position="static",R.style.visibility="hidden",R.style.width=`${y}px`,R.style.height=`${b}px`,R.style.boxSizing="border-box",a.parentElement?.insertBefore(R,a)}let M=y+2,C=b;i&&(Math.abs(v-i.y)<.5&&(v-=1,C+=1),Math.abs(A-i.x)<.5&&(A-=1,M+=1)),a.style.position="absolute",a.style.left=`${A}px`,a.style.top=`${v}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${M}px`,a.style.height=`${C}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function _s(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){D(n,"stripRootShadows boxShadow",s)}try{e.style.textShadow="none"}catch(s){D(n,"stripRootShadows textShadow",s)}try{e.style.outline="none"}catch(s){D(n,"stripRootShadows outline",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){D(n,"stripRootShadows filter",s)}}function Es(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function vs(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function ff(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Rs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!vs(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=ff(s,i);if(!c)break;let f=n?Array.from(a.children).find(p=>n.get(p)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),u=parseFloat(l[`margin${o}`])||0;if(f&&f.style&&u>0&&(f.style[`margin${o}`]="0px"),vs(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=f}}}var uf=new Set(["xml","xlink"]);function df(t,e){if(t.startsWith("*")||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!uf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var pf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,ks=t=>t.replace(pf,e=>e.length===2?e:""),hf=/^data:[^,]{0,120};base64,/;function On(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(df(c.name,n)){a.removeAttribute(c.name);continue}if(hf.test(c.value))continue;let f=ks(c.value);if(f!==c.value)try{a.setAttribute(c.name,f)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=ks(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function mf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var gf=new Set(["img","canvas","video","iframe","object","embed"]);function yf(t){return Ht(t)||gf.has(t?.localName)}function bf(t,e){if(t?.nodeType!==1||mf(t)||yf(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Fs(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&bf(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",u=c.overflowX||c.overflowInline||"visible";(l!=="visible"||u!=="visible")&&(s.style.overflow="visible")}let f=Array.from(s.children);if(r)for(let l of f){let u=r.get(l);u&&u.nodeType===1&&i(u,l)}else{let l=Array.from(o.children);for(let u=0;u<Math.min(l.length,f.length);u++)i(l[u],f[u])}}i(t,e)}function wf(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function Sf(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){D(e,"exclude selector match failed",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){D(e,"exclude predicate failed",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){D(e,"filter function failed",n)}return!1}function fo(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let m of a){if(Sf(m,e)||!wf(m))continue;let d=m.getBoundingClientRect(),h=d.top-r.top,g=d.bottom-r.top;g<=h||(h<i&&(i=h),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,f=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,u=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return f+l+u+p+c}var I=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,Te=.75;function Ts(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,f=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-f)>.02)return 0;let l=s.createElement("div");J(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let u=l.attachShadow({mode:"open"}),p=s.createElement("style");p.textContent=n,u.appendChild(p);let m=e.cloneNode(!0);u.appendChild(m),s.body.appendChild(l);let d=0,h=(g,y,b)=>{let w=W(g),k=w.boxSizing==="border-box",x=(S,A,...v)=>{let M=parseFloat(S);if(!Number.isFinite(M))return A;let C=M+(k?0:v.reduce((R,_)=>R+(parseFloat(_)||0),0));return Math.abs(C-A)<=.51?C:A};return{width:x(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:x(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=m.getBoundingClientRect(),y=m.offsetWidth||i,b=m.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,k=b>0&&g.height>0?g.height/b:1,x=(S,A,v=!1)=>{let M=S.children,C=A.children,R=Math.min(M.length,C.length);for(let _=0;_<R;_++){let T=M[_],N=C[_],O=r.get(T),H=v||As.has(T);if(O?.nodeType===1&&kt(T)&&T.style&&O.isConnected){let E=O.getBoundingClientRect();if(E.width>0&&E.height>0){let L=N.getBoundingClientRect(),$=E.width/c,F=E.height/f,V=L.width,z=L.height,q=O.offsetWidth||$,B=O.offsetHeight||F,Z=N.offsetWidth||V,_t=N.offsetHeight||z,Wt=Math.abs($-q)>Te||Math.abs(F-B)>Te||Math.abs(V-Z)>Te||Math.abs(z-_t)>Te;if(H){let at=h(N,Z,_t);$=V>0?$*w*at.width/V:$,F=z>0?F*k*at.height/z:F,V=at.width,z=at.height}else if(Wt){let at=h(O,q,B),$t=h(N,Z,_t);$=at.width,F=at.height,V=$t.width,z=$t.height}let mt=V-$,st=z-F;(Math.abs(mt)>Te||Math.abs(st)>Te)&&(T.style.boxSizing="border-box",T.style.width=`${I($)}px`,T.style.height=`${I(F)}px`,d++)}}x(T,N,H)}};x(e,m)}finally{l.remove()}return d}var xf=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function co(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=co(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=co(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(xf.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var Cs=new WeakMap;function vf(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function kf(t){if(!t||!t.styleSheets)return"";let e=vf(t),n=Cs.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=co(s,r))}catch{}return Cs.set(t,{fp:e,css:i}),i}function $s(t,e){let n=_r(t.clone).sort(),r=n.join(","),i=Je(t.element),o=P.baseStyle.get(r),s;o&&o.universe===i?s=o.css:(s=Er(n,i),P.baseStyle.set(r,{universe:i,css:s}));let a=kf(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=s,t.scrollbarCSS=a,{baseCSS:s,scrollbarCSS:a,fontsCSS:e}}wt();var Dn=new Set;async function Ps(t,e={}){At(),Sn(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e,slicer:e.__slicer||null},i=null,o=null;if(e.clip&&(o=Wn(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=Bi(t)}catch(d){D(r,"prepareSelectionContext failed",d)}let s,a="",c="";if(Dn.size){let d=(h,g)=>{for(let y=g;y;y=y.assignedSlot||y.parentElement||y.getRootNode()?.host)if(y===h)return!0;return!1};for(;;){let h=[...Dn].filter(({root:g})=>d(g,t)||d(t,g)).map(({promise:g})=>g.catch(()=>{}));if(!h.length)break;await Promise.all(h)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let d=t.getBoundingClientRect(),h=t.ownerDocument?.defaultView||window,g=d.right<=0||d.bottom<=0||d.left>=h.innerWidth||d.top>=h.innerHeight,y=[];if(g&&(()=>{let w=[];t.shadowRoot&&w.push(t.shadowRoot);for(let k of t.querySelectorAll("*"))k.shadowRoot&&w.push(k.shadowRoot);for(;w.length;){let k=w.pop(),x=k.host?.localName==="calcite-icon";for(let S of k.querySelectorAll("*")){if(S.shadowRoot&&w.push(S.shadowRoot),!x||S.localName!=="svg")continue;let A=S.querySelectorAll("path");if(!A.length||[...A].some(M=>M.getAttribute("d")?.trim()))continue;let v=S.getBoundingClientRect();v.width&&v.height&&y.push(S)}}})(),y.length){let w=(async()=>{let x=t.style,S=t.hasAttribute("style"),A=new Map,v=(M,C)=>{A.has(M)||A.set(M,{value:x.getPropertyValue(M),priority:x.getPropertyPriority(M)}),x.setProperty(M,C,"important");let R=A.get(M);R.forcedValue=x.getPropertyValue(M),R.forcedPriority=x.getPropertyPriority(M)};try{v("left","0"),v("top","0"),v("right","auto"),v("bottom","auto"),v("margin-top","0"),v("margin-right","0"),v("margin-bottom","0"),v("margin-left","0"),v("transform","none"),v("translate","none"),v("opacity","0"),v("pointer-events","none");let M=t.getBoundingClientRect();if(M.right<=0||M.bottom<=0||M.left>=h.innerWidth||M.top>=h.innerHeight){let _=t.parentElement?.getBoundingClientRect(),T=_&&_.right>0&&_.left<h.innerWidth?Math.max(0,_.left):0,N=_&&_.bottom>0&&_.top<h.innerHeight?Math.max(0,_.top):0;v("position","fixed"),v("left",`${T}px`),v("top",`${N}px`)}await dt(100);let C=Date.now()+1500,R=()=>y.some(_=>{if([..._.querySelectorAll("path")].some(N=>N.getAttribute("d")?.trim()))return!1;let T=_.getBoundingClientRect();return T.width&&T.height&&T.right>0&&T.bottom>0&&T.left<h.innerWidth&&T.top<h.innerHeight});for(;Date.now()<C&&R();)await new Promise(_=>setTimeout(_,25));await dt(100)}finally{for(let[M,C]of A)x.getPropertyValue(M)!==C.forcedValue||x.getPropertyPriority(M)!==C.forcedPriority||(C.value?x.setProperty(M,C.value,C.priority):x.removeProperty(M));!S&&!x.length&&t.removeAttribute("style"),await dt(100)}})(),k={root:t,promise:w};Dn.add(k);try{await w}finally{Dn.delete(k)}}}catch{}let f=gs(t),l=In(t,o);if(o){let d=t.getBoundingClientRect(),h=t.offsetWidth||d.width,g=t.offsetHeight||d.height,y=d.width&&Math.abs(h-d.width)>=1?h/d.width:1,b=d.height&&Math.abs(g-d.height)>=1?g/d.height:1;i={x:(o.left-d.left)*y,y:(o.top-d.top)*b,width:o.width*y,height:o.height*b}}try{s=await se(t,r,e)}catch(d){throw console.warn("deepClone failed:",d),d}finally{l(),f()}r.slicer?.due()&&await r.slicer.pause();try{ms(s,void 0,t)}catch(d){console.warn("inlineExternal defs or symbol failed:",d)}try{await Re(t,s,r,e)}catch(d){console.warn("inlinePseudoElements failed:",d)}await kn(s,r);for(let[d,h]of r.nodeMap.entries())if(h?.tagName==="STYLE"&&d?.tagName==="STYLE"&&!d.hasAttribute("data-sd"))try{let g=h.sheet&&h.sheet.cssRules;g&&/@media/i.test(d.textContent||"")&&(d.textContent=ie(g))}catch{}try{let d=s.querySelectorAll("style[data-sd]");for(let h of d)c+=h.textContent||"",h.remove()}catch(d){D(r,"Failed to extract shadow CSS from style[data-sd]",d)}r.slicer?.due()&&await r.slicer.pause();let u=Ve(r.styleMap);a=Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");let m=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__pseudoCSS||"");a=m+a;for(let[d,h]of r.styleMap.entries())uo(d,h,u);try{Cf(t,s,r.nodeMap)}catch(d){D(r,"top-layer lift failed",d)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let d=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Ms(t,s,r.nodeMap,r.styleCache,d)}catch(d){D(r,"freezeViewportPositioned failed",d)}for(let[d,h]of r.nodeMap.entries())r.clip&&h===t||po(d,h);if(t===r.nodeMap.get(s)){let d=r.styleCache.get(t)||W(t);r.styleCache.set(t,d);let h=mr(d.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=h||"",s.style.translate="none"}for(let[d,h]of r.nodeMap.entries())h.tagName==="PRE"&&(d.style.marginTop="0",d.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:m,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function Cf(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),f=c.backgroundColor,l=c.backgroundImage;if(f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||l&&l!=="none"){let p=document.createElement("div");p.setAttribute("data-sd-backdrop",""),p.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${f};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(p)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function uo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Pt(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function po(t,e){let n=e.scrollLeft,r=e.scrollTop;if(!(n||r)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let s=t.querySelectorAll("*");for(let a of s){if(a.nodeType!==1||a.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=a.style.position;if(c==="fixed"||c==="absolute"){let f=parseFloat(a.style.top)||0,l=parseFloat(a.style.left)||0;a.style.top=`${f+r}px`,a.style.left=`${l+n}px`,c==="fixed"&&(a.style.position="absolute")}}}catch{}let o=document.createElement("div");for(o.style.all="unset",o.style.transform=`translate(${-n}px, ${-r}px)`,o.style.willChange="transform",o.style.display="inline-block",o.style.width="100%";t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}de();te();ut();var Ns="http://www.w3.org/1999/xlink";function Af(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Ns,"href"):null)}function Mf(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Bn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let d=a.currentSrc||a.src||Ae(a.getAttribute("srcset"),a)||"";d&&a.setAttribute("src",d)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let f=P.image?.get(c);if(f){a.src=f,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await it(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){P.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:p}=Mf(a),{fallbackURL:m}=e||{};if(m)try{let d=typeof m=="function"?await m({width:u,height:p,src:c,element:a}):m;if(d){let h=await it(d,{as:"dataURL",useProxy:e.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=u),a.height||(a.height=p);return}}}catch{}if(e.placeholders!==!1){St(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let d=document.createElement("div");d.style.cssText=[`width:${u}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",a.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${u}px;height:${p}px;visibility:hidden;`,a.replaceWith(d)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=Af(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let f=await it(c,{as:"dataURL",useProxy:e.useProxy});f.ok&&typeof f.data=="string"&&f.data.startsWith("data:")&&(a.setAttribute("href",f.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Ns,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}wt();pt();var _f=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Ef=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],Rf=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Ff=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function Tf(t,e,n,r){let i=n.get(t)||W(t);n.has(t)||n.set(t,i);let o=gi(t),s=o?d=>d in o?o[d]:"":d=>i.getPropertyValue(d),a=s("border-image"),c=s("border-image-source"),f=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),u=s("background-color"),p=l&&l!=="none"||u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),m=Vt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(p&&!m)for(let d of Rf){let h=s(d);h&&e.style.setProperty(d,h)}for(let d of _f){if(m&&d==="background-image")continue;let h=i.getPropertyValue(d);if(d==="background-image"&&(!h||h==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(h=jt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||h)}if(!h||h==="none")continue;let g=jt(h),y=await Promise.all(g.map(b=>pe(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(d,y.join(", "))}for(let d of Ef){let h=s(d);!h||h==="initial"||e.style.setProperty(d,h)}if(f)for(let d of Ff){let h=s(d);!h||h==="initial"||e.style.setProperty(d,h)}if(p&&/fixed/.test(s("background-attachment")||""))try{await Pf(t,e,i)}catch{}}function $f(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let p=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*p,h:n*p}}let s=o.split(/\s+/),a=(p,m)=>{if(p==="auto"||p===void 0)return null;if(p.endsWith("px"))return parseFloat(p);if(p.endsWith("%"))return m*parseFloat(p)/100},c=a(s[0],r),f=a(s[1],i);if(c===void 0||f===void 0)return null;let l=c,u=f;return l==null&&u==null?(l=e||r,u=n||i):l==null?l=e&&n?u*(e/n):r:u==null&&(u=e&&n?l*(n/e):i),!l||!u?null:{w:l,h:u}}async function Pf(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(d=>d.trim()),i=qe();if(!i)for(let d=t.parentElement;d&&!i;d=d.parentElement){let h=W(d);(h.transform&&h.transform!=="none"||h.filter&&h.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,f=jt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(d=>d.trim()),u=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(d=>d.trim()),p=[],m=[];for(let d=0;d<f.length;d++){let h=r[d%r.length]||"scroll",g=l[d%l.length],y=u[d%u.length];if(h!=="fixed"){p.push(g),m.push(y);continue}let b=0,w=0,k=f[d]&&f[d].match(/url\(["']?([^"')]+)["']?\)/);if(k)try{let C=new Image;C.src=k[1],await C.decode(),b=C.naturalWidth,w=C.naturalHeight}catch{p.push(g),m.push(y);continue}let x=$f(g,b,w,a,c);if(!x){p.push(g),m.push(y);continue}let S=y.split(/\s+/),A=(C,R,_)=>{if(!C)return 0;if(C.endsWith("px"))return parseFloat(C);if(C.endsWith("%"))return(R-_)*parseFloat(C)/100},v=A(S[0]||"0%",a,x.w),M=A(S[1]||S[0]||"0%",c,x.h);if(v===void 0||M===void 0){p.push(g),m.push(y);continue}p.push(`${Un(x.w)}px ${Un(x.h)}px`),m.push(`${Un(v-o.left)}px ${Un(M-o.top)}px`)}e.style.setProperty("background-size",p.join(", ")),e.style.setProperty("background-position",m.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Un=t=>Math.round(t*100)/100;async function Hn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Dr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let f of c.children){if(f.tagName==="STYLE")continue;let l=i.get(f);l&&Dr(l)&&o.push([l,f]),s.push(f)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([f,l])=>Tf(f,l,n,r)))}pt();function Is(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let f=W(c),l=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:Wf(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let f=e.cloneNode(!0);If(f,e,a.orig.getBoundingClientRect(),n),Of(Ls(f,a.path));for(let l=0;l<c;l++){let u=Ls(f,r[l].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:c,bf:f,copy:l}of s)Nf.has(a.tagName)||Lf(a,c,f,l,o)}var Nf=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function Lf(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=W(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let f=document.createElement("div");f.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",f.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(u,s.getPropertyValue(u));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(f)}var zn=128;function If(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+zn||l.right<n.left-zn||l.top>n.bottom+zn||l.bottom<n.top-zn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,f=s.children;for(let l=0;l<c.length;l++)i.push([c[l],f[l]])}}function Wf(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Ls(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function Of(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}pt();wt();ut();ut();function ho(t){return Ho(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}te();function Vn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let f=o.getBoundingClientRect();if(f.width>0||f.height>0){let l=Math.max(f.right,f.left+(o.scrollWidth||0)),u=Math.max(f.bottom,f.top+(o.scrollHeight||0));if(l<e.left-r||f.left>e.right+r||u<e.top-r||f.top>e.bottom+r)return}}let s=getComputedStyle(o),a=Df(o,s);a&&n.push(a);let c=Bf(o,s);c&&n.push(c);for(let f of o.children||[])i(f)}return i(t),()=>n.forEach(o=>o())}function Df(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Uf(e);if(n<=0)return()=>{};if(!Ds(t))return()=>{};let r=Os(t),i=r.text,o=zf(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Hf(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let f=0,l=i.length,u=-1;for(;f<=l;){let m=f+l>>1;r.write(i.slice(0,jn(i,m))+"\u2026"),t.scrollHeight<=c+.5?(u=m,f=m+1):l=m-1}let p=(u>=0?i.slice(0,jn(i,u)):"")+"\u2026";return r.write(p),Ws(t,p,r)}function Bf(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!Ds(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=Os(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,jn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,jn(r,s)):"")+"\u2026";return n.write(a),Ws(t,a,n)}function Ws(t,e,n){return()=>{t.textContent===e&&n.restore()}}function Os(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function jn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Uf(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Hf(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function zf(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Ds(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Bs=["clone","render"],qn={clone:0,render:1},vt="render";function Us(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:vt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?vt:o.needs;if(!Object.prototype.hasOwnProperty.call(qn,s))throw new Error(`[snapdom] plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${Bs.join(", ")}`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,qn[s])}if(n<0)return{stage:vt,loweredBy:[]};let i=Bs[n];return{loweredBy:i===vt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function $e(t,e){return qn[t]>=qn[e]}function Hs(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[snapdom] no ${n}: this capture stopped at '${t}' because ${r} declared needs: '${t}' (result.needs says so too). It is not re-captured on demand \u2014 that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var on=[];function sn(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function zs(...t){let e=t.flat();for(let n of e){let r=sn(n);if(r){if(r.needs!==void 0&&r.needs!==vt)throw new Error(`[snapdom] global plugin '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}. A global plugin must run to '${vt}': lowering it here would stop EVERY capture in the app short of pixels. Pass it per capture instead: snapdom(el, { plugins: [<plugin>] }).`);on.some(i=>i&&i.name&&r.name&&i.name===r.name)||on.push(r)}}}function js(t){return t&&Array.isArray(t.plugins)?t.plugins:on}async function It(t,e,n){let r=n,i=js(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Gn(t,e,n){let r=[],i=js(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}var jf=0;function Vf(t){let e=[];if(Array.isArray(t))for(let n of t){let r=sn(n);if(!r)continue;r.name||(r.name=`anonymous-${++jf}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of on)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function Vs(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Vf(e)),t}function qs(){return on.slice()}var qf=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function Xn(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=sn(n);if(!(!r||r.pure===!0)){for(let i of qf)if(typeof r[i]=="function")return!0}}return!1}ut();ye();var le="data-snapdom-asset",Ks="http://www.w3.org/1999/xlink",Gf=0;function Kn(t,e,n,r,i,o){let s=o.__compressedAssets||(o.__compressedAssets=new WeakMap),a=s.get(t);a||(a={token:String(++Gf),properties:[]},s.set(t,a),t.setAttribute(le,a.token));let c=a.properties.find(f=>f.kind===e&&f.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var Qs=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function Qn(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${le}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(le)!==o.token)continue;let s=o.properties.filter(a=>Qs(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function Jn(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${le}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(le,i.token))}}function Js(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${le}]`))for(let s of e.get(o.getAttribute(le))||[])Qs(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(Ks,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function Gs(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function mo(t,e){let n=e.element||t,r=n.isConnected?W(n):n.style,i=e.__compressionClip,o=(m,d)=>{try{return m[d]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),f=Number.isFinite(e.height);if(!i&&(c||f)&&s&&a)try{let m=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Yt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(m.is2D===!1)s=0,a=0;else{let d=Math.abs(m.a)*s+Math.abs(m.c)*a,h=Math.abs(m.b)*s+Math.abs(m.d)*a;s=Math.min(s,d),a=Math.min(a,h)}}catch{s=0,a=0}let l=(c||f?Math.max(c?s?e.width/s:1/0:0,f?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let u=new WeakMap,p=m=>{if(!m||m.nodeType!==1)return 1;if(u.has(m))return u.get(m);let d=m.isConnected?W(m):m.style,h=1;try{d?.perspective&&d.perspective!=="none"&&(h=1/0);let g=d?.transform;if(g&&g!=="none")h*=Gs(new DOMMatrix(g));else if(m.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<m.transform.baseVal.numberOfItems;b++){let w=m.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}h*=Gs(y)}if(d?.scale&&d.scale!=="none"){let y=d.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));h*=Math.max(...y.map(Math.abs))}if(m!==n&&d?.zoom&&d.zoom!=="normal"&&(h*=parseFloat(d.zoom)||1),m.localName==="svg"&&m.viewBox?.baseVal?.width>0&&m.viewBox.baseVal.height>0){let y=m.viewBox.baseVal,b=x=>/^\d+(?:\.\d+)?px$/.test(d?.[x]||"")?parseFloat(d[x]):o(m,x),w=b("width"),k=b("height");h*=w>0&&k>0?Math.max(w/y.width,k/y.height):1/0}}catch{h=1/0}return Number.isFinite(h)||(h=1/0),m!==n&&(h*=p(m.parentElement||m.getRootNode?.().host)),u.set(m,h),h};return{density:l,stretch:p}}var Zs=.92,ta=1;async function Xf(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Yf(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Kf=64*1024,Xs=32*1024*1024,Yn=new Map;function Qf(t,e,n,r){if(n.length+(r?.length||0)>Xs)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>Xs;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Jf(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function Zf(t){let e=Jf(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function Ys(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var tu=`self.onmessage = async (e) => {
|
|
16
16
|
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
17
17
|
try {
|
|
18
18
|
const blob = given || await (await fetch(dataURL)).blob()
|
|
@@ -36,4 +36,4 @@ ${g}
|
|
|
36
36
|
} catch (err) {
|
|
37
37
|
self.postMessage({ id, error: String(err) })
|
|
38
38
|
}
|
|
39
|
-
}`,Gf=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,Xf=0,Yf=0,ae=new Map;function Qs(){for(let t of ae.values())t(void 0);if(ae.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function Kf(){let t,e=null;try{t=URL.createObjectURL(new Blob([qf],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ae.get(n.data.id);r&&(ae.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=Qs}catch{e=null}return t&&URL.revokeObjectURL(t),e}function Qf(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=Xf++%Gf;if(!Ft[t]){let e=Kf();if(!e)return Qs(),!1;Ft[t]=e}return Ft[t]}var Jf=5e3;function Zf(t,e,n,r,i){let o=Qf();return o?new Promise(s=>{let a=++Yf,c=setTimeout(()=>{ae.delete(a),s(void 0)},Jf);ae.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:Ks,quality:Ys,mime:r})}catch{clearTimeout(c),ae.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function ho(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=P.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Xn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Uf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=Vf(t);if(p&&p.w>0&&p.h>0&&!Vs(p.w,p.h,e,n))return null;if(t.length>=Hf){let S=await Zf(t,e,n,u,r);if(S!==void 0)return S}let h;try{h=await Bf(t)}catch{return null}let d=h.naturalWidth||h.width,m=h.naturalHeight||h.height;if(!d||!m)return null;let g=Vs(d,m,e,n);if(!g)return null;let y=g*Ks,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(m*y)),C=document.createElement("canvas");C.width=b,C.height=w;let x=C.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(h,0,0,b,w);try{let S=C.toDataURL(u,Ys);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Xn.set(i,f);try{let l=await c;return zf(o,i,t,l),l}finally{Xn.get(i)===f&&Xn.delete(i)}}async function tu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let d=r.value||(r.value=po(t,e)),m=d.density*d.stretch(n.get(l)||l),g=await ho(u,p*m,h*m,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Yn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var eu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function nu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function ru(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(v=>!eu.test(v.trim())))return;let{w:d,h:m}=nu(l);if(!d||!m)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||(r.value=po(t,e)),b=y.density*y.stretch(l)*g,w=d*b,C=m*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let k=await ho(M,w,C);k&&(A=A.split(M).join(k),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Yn(f,"style","background-image",x,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function ou(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),h=p?W(p):c.style,d=(C,x)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[C]||""))return parseFloat(h[C]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[C]?.baseVal?.value||0}catch{return 0}},m=d("width",l),g=d("height",u);if(!m||!g)return;let y=r.value||(r.value=po(t,e)),b=y.density*y.stretch(p||c),w=await ho(f,m*b,g*b);w&&(c.setAttribute("href",w),Yn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(qs,"xlink:href",w),Yn(c,"attribute","xlink:href",f,w,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function Jn(t,e,n){if(!e.compress)return;let r={};await tu(t,e,n,r),await ru(t,e,n,r),await ou(t,e,n,r)}pt();ut();bt();function iu(t,e){if(Y())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=su(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,h=0,d=[],m=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(h++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,m):y.text;return t.slice(0,n)+d.join("")+g}function su(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function Zn(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Es(t,s),await Nt("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),h=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(h=Math.max(h,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(h=Math.max(h,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Xt=nt.attachShadow({mode:"open"}),Yt=d.createElement("style");Yt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Xt.appendChild(Yt),Xt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let De=nt.scrollHeight,Ot=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:De,csw:Ot}),De>0&&(h=Math.max(h,I(De))),Ot>0&&(p=Math.max(p,I(Ot)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=lo(t.element,t.options),tt=1,Q=lo(t.element,{}),et=Math.max(2,h*.15);Number.isFinite(Q)&&Q>=h-et&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ms(t.element,t.clone,K,t.nodeMap,p,h)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),w=n?I(n.width):p,C=n?I(n.height):h,x=w,S=C,A=Number.isFinite(y),v=Number.isFinite(b),M=C>0?w/C:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let k=0,R=0,E=p,T=h;if(n){let K=0,tt=0;if(mo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=se(t.element),nt=co(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=en(l,p,h),Xt=Re(p,h,Q,et,nt);K=Xt.minX,tt=Xt.minY}}k=I(n.x+K),R=I(n.y+tt),E=I(k+n.width),T=I(R+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Re(p,h,K,0,0);k=I(tt.minX),R=I(tt.minY),E=I(tt.maxX),T=I(tt.maxY)}else if(r&&mo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=se(t.element),et=qt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:h}),{ox:nt,oy:Xt}=en(l,p,h),Yt=et.is2D?et:new DOMMatrix(et.toString()),De={a:Yt.a,b:Yt.b,c:Yt.c,d:Yt.d,e:0,f:0},Ot=Re(p,h,De,nt,Xt);k=I(Ot.minX),R=I(Ot.minY),E=I(Ot.maxX),T=I(Ot.maxY)}let N=eo(l),O=no(l),H=ro(l),_=oo(l),L=io(l),$=u.width>0?(E-k)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?hs(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+_.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+_.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+_.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+_.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};k=I(k-z.left),R=I(R-z.top),E=I(E+z.right),T=I(T+z.bottom);let q=Math.max(1,I(E-k)),B=Math.max(1,I(T-R)),Z="http://www.w3.org/2000/svg",Mt=mo(t.element)?2:0,mt=I(Mt+(r?0:1)),st=Math.ceil(q+mt*2),at=Math.ceil(B+mt*2),$t=I(-(I(k)-mt)),U=I(-(I(R)-mt)),G=Math.max(0,$t),j=Math.max(0,U),ft=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,$t))),gt.setAttribute("y",String(Math.min(0,U))),gt.setAttribute("width",String(ft)),gt.setAttribute("height",String(Et)),gt.style.overflow="visible";let fe=document.createElement("style"),fn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";fe.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+fn+t.classCSS,gt.appendChild(fe);let We=document.createElement("div");We.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),We.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ft}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),We.appendChild(t.clone),gt.appendChild(We);let lr=new XMLSerializer().serializeToString(gt),It=A||v,fr=Object.freeze({w0:w,h0:C,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?k:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(k),y:I(R),width:w,height:C}):null});Object.defineProperty(a,"meta",{value:fr,enumerable:!0,writable:!1,configurable:!0});let ur=!It||Y()?st:A?x:I(st*(S/at)),un=!It||Y()?at:v?S:I(at*(x/st)),Wt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${ur}" height="${un}" viewBox="0 0 ${st} ${at}" font-size="${Wt}px">`+iu(lr,gt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Nt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let dr=[...document.querySelectorAll("#snapdom-sandbox")].find(Ut);return dr&&dr.style.position==="absolute"&&dr.remove(),t.dataURL}function mo(t){return gs(t)}function au(t){let e=Array.isArray(t.plugins)?t.plugins:Hs(),n=[];for(let r of e){let i=rn(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function Js(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=$s(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=au(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||xt,h=n.format,d=n.type;await Nt("beforeSnap",n);let m=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(m||g){let E=String(m?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Nt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?In(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=di(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let C=jn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await _s(n.element,n.options)),c>0&&!e.reconcile&&(wt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),P.warnedReconcile||(P.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=ms(n.element,r)),!b&&r&&vs(n.element,r,n.options),r&&(Cs(n.element,r,a),ks(n.element,r))}finally{C()}if(n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Nt("afterClone",n),!Te(p,"render"))return null;if(Wn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{As(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){wt(e.__session,"shrink-failed","shrink pass failed",E),console.warn("[snapdom] shrink pass failed:",E)}try{await En(n.clone,n.element,n.nodeMap)}catch{}let x=E=>Promise.resolve().then(E),S=(async()=>{await Promise.all([x(()=>Dn(n.clone,n.options)),x(()=>Un(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Ts(n.element,n.clone,n.nodeMap)}catch(E){wt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),console.warn("[snapdom] backdrop-filter emulation failed:",E)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>Jn(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Oi(n.nodeMap)}catch(E){wt(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let E=n.element.ownerDocument||document,T=w?H=>{try{let _=H.getBoundingClientRect();return _.right>=w.left-200&&_.left<=w.right+200&&_.bottom>=w.top-200&&_.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||Tn(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of E.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(_=>String(_).split("__")[0]).filter(Boolean));await $n(H,1,E)}l=await Ji({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));n.options.engine;let k=n.clone;Qn(k,e.__compressedAssets);let R=await Zn(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Kn(k,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return R}ut();yt();var cu=new Set(["png","jpeg","jpg","webp","svg"]);function Zs(t={}){let e=typeof t.type=="string"&&cu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=Bo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Hi(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}kt();Qt();pt();var ta="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function lu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var fu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function uu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(fu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function du(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var go=new WeakMap;function pu(t,e){if(go.has(e))return go.get(e);let n=!1,r={budget:2e4},i=o=>{for(let s=0;s<o.length&&!n;s++){if(--r.budget<0){n=!0;return}let a=o[s],c=a.selectorText;if(c&&/[+~]|:has\(/.test(c)){n=!0;return}let f=a.style;if(f&&(f.counterReset||f.counterIncrement||f.counterSet||f.content&&f.content.includes("counter"))){n=!0;return}a.cssRules&&a.cssRules.length&&i(a.cssRules)}};try{for(let o of t.styleSheets){let s=null;try{s=o.cssRules}catch{n=!0}if(n)break;s&&i(s)}if(!n){let o=t.adoptedStyleSheets;if(Array.isArray(o))for(let s of o){if(n)break;try{i(s.cssRules)}catch{n=!0}}}}catch{n=!0}return go.set(e,n),n}var hu=1/16;function mu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=hu}var tr=new Map,gu=["width","height","min-width","min-height"];function yu(t){let e=tr.get(t);if(e===void 0){e=null;for(let n of gu){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}tr.size>5e3&&tr.clear(),tr.set(t,e)}return e}function bu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function wu(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var yo={attempts:0,served:0,reconciled:0};async function ea(t,e,n){yo.attempts++;try{let r=await Su(t,e,n);return r&&yo.served++,r}catch{return null}}async function Su(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||lu(t)||uu(r)||r.fontsCSS||Gn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=Ke(t);if(!o||pu(i,o))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(ta)||u.querySelector?.(ta)||du(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let h=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},m=jn(u,null),g=Ln(u),y;try{y=await ie(u,d,n)}finally{g(),m()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await _e(u,y,d,n),d.__pseudoCSS))return null;await vn(y,d),Wn(y);try{await En(y,u,h)}catch{}if(await Promise.all([Dn(y,n),Un(u,y,r.styleCache,n,h)]),n.compress)try{await Jn(y,n,h)}catch{}for(let[b,w]of h.entries())uo(b,w);p.replaceWith(y),wu(p,r);for(let[b,w]of h.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(u);if(!h)continue;let d=yu(h);if(!d)continue;let m=null,g=!1;for(let y in d)if(m||(m=getComputedStyle(p)),!mu(m.getPropertyValue(y),d[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;yo.reconciled++,await lt(p,u,a,n)}}let c=je(r.styleMap);for(let[u,p]of r.styleMap.entries())bu(u),fo(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");Qn(r.clone,n.__compressedAssets);let l=await Zn({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Kn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}yt();var wo=new WeakMap,nr=new WeakMap,ua=new WeakSet,bo=new WeakMap,xu=64,on=new Map,da=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],vu=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function ku(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":vu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function na(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function ra(t,e){if(e.disposed||(on.delete(t),on.set(t,e),on.size<=xu))return;let[n,r]=on.entries().next().value;pa(n,r)}function pa(t,e){e.disposed=!0,on.delete(t),wo.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of da)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of xo)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function ha(t){if(ua.has(t))return!1;nr.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=bo.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Ne(f)||Ne(l)},bo.set(a,u)),u.animated)return!1}else u&&bo.delete(a)}}return nr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function So(t,e){if(!t.querySelectorAll)return!1;let n=nr.get(t);nr.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of xo)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of xo)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var xo=["scroll","change","beforetoggle","toggle"];function rr(t,e){return[t,...e.trackedShadowRoots.keys()]}function vo(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of rr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Cu(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(te(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Au=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Pe=t=>t&&(typeof t=="object"||typeof t=="function")?er(t):"-";function Mu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Eu(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Mu(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function oa(t){let e=String(t||"").trim();return e?Au.test(e)?!0:/^data:/i.test(e)?Eu(e):!1:!1}function Ne(t){let e=String(t||"");if(oa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(oa(n[1]??n[2]??n[3]))return!0;return!1}function ia(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of ma(i))if(Ne(o.getAttribute?.("src"))||Ne(o.getAttribute?.("href"))||Ne(o.getAttribute?.("style"))||Ne(t.styleMap?.get(o)))return!0;return!1}function ma(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function ko(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of rr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Co(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of rr(t,e))for(let s of ma(o))i(s);e.scrollNodes=n}function sa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",ku(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Pe))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Pe))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Pe(o)),(s?.contains(t)||t.contains(s))&&i.push(Pe(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,He(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function $e(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function aa(t,e){let n=new Set;for(let r of rr(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ca(t){return t.map(e=>[Pe(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function _u(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Ru(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:we(),styleEpoch:ee(),styleStamp:Ye(t),outsideMutations:yn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)te(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of da)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return So(t,e)||ko(t,e),Co(t,e),vo(t,e),e}var Fu=0,la=new WeakMap;function er(t){let e=la.get(t);return e||(e="@"+ ++Fu,la.set(t,e)),e}function Ao(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(er(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(er(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Ao(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(er(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Ao(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function fa(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Ao(i,new Set);return o===null?null:`${(e||[]).map(Pe).join(",")}:${o}`}catch{return null}}function ga(t,e,n,r,i=null){let o=wo.get(t);o||(o=Ru(t),o.baselineSignature=fa(e,n.plugins),wo.set(t,o));let s=fa(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,So(t,o),vo(t,o);for(let A of o.observers)A.__flush(A.takeRecords());Rt();let l=yn(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),wn(t.ownerDocument||document,p);let h=Ye(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let d=sa(t,o),m=aa(t,o);d.animation=ca(m),o.renderState&&(!$e(o.renderState,d,"style")&&(Se(),o.dirtyAll()),$e(o.renderState,d,"scroll")||o.dirtyAll(),$e(o.renderState,d,"controls")||(ne(t),o.dirtyAll()),!$e(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=we();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=ee();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=na(t);o.geometry!==null&&A!==o.geometry&&(ne(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!$e(o.renderState,d,"animation");try{let A=new Set;w&&m.length===0&&(A=null);for(let v of m){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let k=v.effect?.target;if(_u(t,o,k)===t)A.add(k);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),ne(v)}else w&&!A&&o.dirtyAll()}catch{}let C=d.frameDriven,x=b||C;if(x&&(o.last=null),C&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return ra(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let k=await ea(t,o,n);k&&(A=await i(k),v=!0)}if(A||(f||(n.__retain=k=>{let R=new Map;for(let[E,T]of k.nodeMap.entries())R.set(T,E);S={...k,srcToClone:R}}),A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=ia(S),ko(t,o),Co(t,o)):v&&(o.retainedFrameDriven||(o.retainedFrameDriven=ia(o.retained,M)),ko(t,o),Co(t,o));let k=sa(t,o);k.animation=ca(aa(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let E=R.every(T=>$e(d,k,T));o.renderState=k,o.styleEpoch=ee(),o.styleStamp=Ye(t),o.geometry=na(t),o.renderState.frameDriven?(ua.add(t),pa(t,o)):E?!x&&!o.renderState.frameDriven&&(o.last=A,ra(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);Rt();let A=yn(t);(o.torn||Cu(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=ee(),o.styleStamp=Ye(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(So(t,o),vo(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var or=null;function wa(t){or=t}var Tu='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Mo=!1,sn=null,Eo=new WeakMap,ya=!1;function Sa(t,e){!Mo||!sn||e&&e.burst===!1||Eo.set(sn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function xa(t){let e={control:t};sn=e,setTimeout(()=>{sn===e&&(sn=null)},0)}function Ro(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Tu):null}function ba(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ro(t);e&&(xa(e),_o(t,!1))}function $u(t){let e=Ro(t);e&&xa(e)}function _o(t,e=!0){if(!or||document.visibilityState==="hidden")return;let n=Ro(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Eo.get(n);if(r){if(!r.element.isConnected){Eo.delete(n);return}or(r.element,r.options).catch(()=>{});return}e&&!ya&&(ya=!0,or(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function va(){if(Mo||typeof document>"u"||typeof document.addEventListener!="function")return;Mo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",ba,t),document.addEventListener("keydown",ba,t),document.addEventListener("click",$u,t),document.addEventListener("pointerenter",_o,t),document.addEventListener("focusin",_o,t)}bt();function Ju(...t){return Ds(...t),X}async function Zu(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await dt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Do(i,{...e||{},burst:!1})}finally{n.remove()}}var td="3.0.0",X=Object.assign(Do,{plugins:Ju,fromString:Zu,version:td,preCapture:va});wa(Do);var Oo=Symbol("snapdom.internal"),ed=Symbol("snapdom.internal.silent"),Na=new Set(["png","jpeg","jpg","webp","svg"]);async function Do(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=Zs(e);n.element=t,n.invalidate&&Se(),Us(n,e&&e.plugins);let{stage:r,loweredBy:i}=Ws(n);n.needs=r,n.__needsLoweredBy=i;let o=Te(r,"render"),s=n.burst===!0||!Gn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&ha(t);return f&&Sa(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?ga(t,e,n,()=>X.capture(t,n,Oo),l=>La(l,n)):X.capture(t,n,Oo)}X.capture=async(t,e,n)=>{if(n!==Oo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Te(e.needs||xt,"render")&&Y()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Tn(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await $n(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(Ze(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await Js(t,e);return La(r,e)};async function La(t,e){let n=e.needs||xt,r=Te(n,"render"),i=_=>Os(n,e.__needsLoweredBy||[],_),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),m=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=_=>{if(o||!f?.size)return c;let L=p.vbW,$=p.vbH,F=_.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(_.width),z=Number.isFinite(_.height);return(V&&z?Math.max(_.width/L,_.height/$):V?_.width/L*(F?Math.max(1,g/m):1):z?_.height/$*(F?Math.max(1,m/g):1):(_.scale||1)*Math.max(m,g))*(_.dpr||1)<=l?c:u??(u=Xs(a(),f))},b=async(_,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Ie(),ln));return $(c,{..._,...L||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let _=t.indexOf(",");return _>=0?decodeURIComponent(t.slice(_+1)):""},C=_=>Object.defineProperty({..._||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(_,L)=>{if(o)return b(_,L);let{toImg:$}=await Promise.resolve().then(()=>(Lo(),No)),F={..._,...L||{}};return $(y(F),F)},svg:async(_,L)=>{if(o)return b(_,L);let{toSvg:$}=await Promise.resolve().then(()=>(Lo(),No)),F={..._,...L||{}};return $(y(F),F)},canvas:async(_,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(Le(),Ra)),F={..._,...L||{}};return $(y(F),F)},blob:async(_,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Wo(),Fa)),F={..._,...L||{}};return $(y(F),F)},png:async(_,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Ie(),ln)),F={..._,...L||{},format:"png"};return $(y(F),F)},jpeg:async(_,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Ie(),ln)),F={..._,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(_,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Ie(),ln)),F={..._,...L||{},format:"webp"};return $(y(F),F)},download:async(_,L)=>{let{download:$}=await Promise.resolve().then(()=>(Pa(),$a)),F={..._,...L||{}};return $(y(F),F)}};if(!r)for(let _ of Object.keys(x)){let L=_==="download"?"download()":`to${_.charAt(0).toUpperCase()}${_.slice(1)}()`;x[_]=async()=>{throw i(L)}}let S={};for(let _ of["img","svg","canvas","blob","png","jpeg","webp"])S[_]=async L=>x[_](e,{...E(_,L||{}),[ed]:!0});S.jpg=S.jpeg;let A=_=>Object.defineProperty({...e,..._},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:C(),exports:S}),M=await qn("defineExports",v),k=Object.assign({},...M.filter(_=>_&&typeof _=="object").reverse()),R={...x,...k};R.jpeg&&!R.jpg&&(R.jpg=(_,L)=>R.jpeg(_,L));function E(_,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.format.toLowerCase():Na.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,_==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[_,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,N=Promise.resolve();async function O(_,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[_];if(!z)throw new Error(`[snapdom] Unknown export type: ${_}`);let q=E(_,$),B=A({artifacts:e.__artifacts||null,export:C({type:_,options:q,requestedOptions:$})}),Z=q.format,Mt=q.type;await qn("beforeExport",B,{format:_,options:q});let Lt=q.format!==Z?q.format:q.type!==Mt?q.type:"",mt=typeof Lt=="string"?Lt.toLowerCase():"";Na.has(mt)&&(q.format=mt==="jpg"?"jpeg":mt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await qn("afterExport",B,{format:_,options:q,result:st}),T||(T=!0,await Nt("afterSnap",e)),st},V=N.then(F);return N=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(_,L)=>O(_,L),toImg:_=>O("img",_),toSvg:_=>O("svg",_),toCanvas:_=>O("canvas",_),toBlob:_=>O("blob",_),toPng:_=>O("png",_),toJpg:_=>O("jpg",_),toWebp:_=>O("webp",_),download:_=>O("download",_)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let _ of Object.keys(R)){let L="to"+_.charAt(0).toUpperCase()+_.slice(1);H[L]||(H[L]=$=>O(_,$))}return H}X.toRaw=(t,e)=>X(t,e).then(n=>n.toRaw());X.toImg=(t,e)=>X(t,e).then(n=>n.toImg());X.toSvg=(t,e)=>X(t,e).then(n=>n.toSvg());X.toCanvas=(t,e)=>X(t,e).then(n=>n.toCanvas());X.toBlob=(t,e)=>X(t,e).then(n=>n.toBlob());X.toPng=(t,e)=>X(t,{...e,format:"png"}).then(n=>n.toPng());X.toJpg=(t,e)=>X(t,{...e,format:"jpeg"}).then(n=>n.toJpg());X.toWebp=(t,e)=>X(t,{...e,format:"webp"}).then(n=>n.toWebp());X.download=(t,e)=>X(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=X);})();
|
|
39
|
+
}`,eu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,nu=0,ru=0,ce=new Map;function ea(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function ou(){let t,e=null;try{t=URL.createObjectURL(new Blob([tu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ce.get(n.data.id);r&&(ce.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=ea}catch{e=null}return t&&URL.revokeObjectURL(t),e}function iu(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=nu++%eu;if(!Ft[t]){let e=ou();if(!e)return ea(),!1;Ft[t]=e}return Ft[t]}var su=5e3;function au(t,e,n,r,i){let o=iu();return o?new Promise(s=>{let a=++ru,c=setTimeout(()=>{ce.delete(a),s(void 0)},su);ce.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:ta,quality:Zs,mime:r})}catch{clearTimeout(c),ce.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function go(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=P.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Yn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Yf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=Zf(t);if(p&&p.w>0&&p.h>0&&!Ys(p.w,p.h,e,n))return null;if(t.length>=Kf){let S=await au(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Xf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=Ys(d,h,e,n);if(!g)return null;let y=g*ta,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),k=document.createElement("canvas");k.width=b,k.height=w;let x=k.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=k.toDataURL(u,Zs);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Yn.set(i,f);try{let l=await c;return Qf(o,i,t,l),l}finally{Yn.get(i)===f&&Yn.delete(i)}}async function cu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||(r.value=mo(t,e)),h=d.density*d.stretch(n.get(l)||l),g=await go(u,p*h,m*h,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Kn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var lu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function fu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function uu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!lu.test(v.trim())))return;let{w:d,h}=fu(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||(r.value=mo(t,e)),b=y.density*y.stretch(l)*g,w=d*b,k=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let C=await go(M,w,k);C&&(A=A.split(M).join(C),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Kn(f,"style","background-image",x,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function du(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),m=p?W(p):c.style,d=(k,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[k]||""))return parseFloat(m[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||(r.value=mo(t,e)),b=y.density*y.stretch(p||c),w=await go(f,h*b,g*b);w&&(c.setAttribute("href",w),Kn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Ks,"xlink:href",w),Kn(c,"attribute","xlink:href",f,w,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function Zn(t,e,n){if(!e.compress)return;let r={};await cu(t,e,n,r),await uu(t,e,n,r),await du(t,e,n,r)}pt();ut();bt();function pu(t,e){if(Y())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=hu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function hu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function tr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;$s(t,s),await It("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(m=Math.max(m,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(m=Math.max(m,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Qt=nt.attachShadow({mode:"open"}),Jt=d.createElement("style");Jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Qt.appendChild(Jt),Qt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let Be=nt.scrollHeight,Bt=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:Be,csw:Bt}),Be>0&&(m=Math.max(m,I(Be))),Bt>0&&(p=Math.max(p,I(Bt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=fo(t.element,t.options),tt=1,Q=fo(t.element,{}),et=Math.max(2,m*.15);Number.isFinite(Q)&&Q>=m-et&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ts(t.element,t.clone,K,t.nodeMap,p,m)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),w=n?I(n.width):p,k=n?I(n.height):m,x=w,S=k,A=Number.isFinite(y),v=Number.isFinite(b),M=k>0?w/k:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let C=0,R=0,_=p,T=m;if(n){let K=0,tt=0;if(yo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=ae(t.element),nt=lo(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=rn(l,p,m),Qt=Fe(p,m,Q,et,nt);K=Qt.minX,tt=Qt.minY}}C=I(n.x+K),R=I(n.y+tt),_=I(C+n.width),T=I(R+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Fe(p,m,K,0,0);C=I(tt.minX),R=I(tt.minY),_=I(tt.maxX),T=I(tt.maxY)}else if(r&&yo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=ae(t.element),et=Yt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:m}),{ox:nt,oy:Qt}=rn(l,p,m),Jt=et.is2D?et:new DOMMatrix(et.toString()),Be={a:Jt.a,b:Jt.b,c:Jt.c,d:Jt.d,e:0,f:0},Bt=Fe(p,m,Be,nt,Qt);C=I(Bt.minX),R=I(Bt.minY),_=I(Bt.maxX),T=I(Bt.maxY)}let N=no(l),O=ro(l),H=oo(l),E=io(l),L=so(l),$=u.width>0?(_-C)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?ws(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};C=I(C-z.left),R=I(R-z.top),_=I(_+z.right),T=I(T+z.bottom);let q=Math.max(1,I(_-C)),B=Math.max(1,I(T-R)),Z="http://www.w3.org/2000/svg",_t=yo(t.element)?2:0,mt=I(_t+(r?0:1)),st=Math.ceil(q+mt*2),at=Math.ceil(B+mt*2),$t=I(-(I(C)-mt)),U=I(-(I(R)-mt)),G=Math.max(0,$t),j=Math.max(0,U),ft=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,$t))),gt.setAttribute("y",String(Math.min(0,U))),gt.setAttribute("width",String(ft)),gt.setAttribute("height",String(Et)),gt.style.overflow="visible";let ue=document.createElement("style"),dn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ue.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+dn+t.classCSS,gt.appendChild(ue);let Oe=document.createElement("div");Oe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Oe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ft}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),Oe.appendChild(t.clone),gt.appendChild(Oe);let fr=new XMLSerializer().serializeToString(gt),Ot=A||v,ur=Object.freeze({w0:w,h0:k,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?C:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(C),y:I(R),width:w,height:k}):null});Object.defineProperty(a,"meta",{value:ur,enumerable:!0,writable:!1,configurable:!0});let dr=!Ot||Y()?st:A?x:I(st*(S/at)),pn=!Ot||Y()?at:v?S:I(at*(x/st)),Dt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${dr}" height="${pn}" viewBox="0 0 ${st} ${at}" font-size="${Dt}px">`+pu(fr,gt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await It("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let pr=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);return pr&&pr.style.position==="absolute"&&pr.remove(),t.dataURL}function yo(t){return xs(t)}function mu(t){let e=Array.isArray(t.plugins)?t.plugins:qs(),n=[];for(let r of e){let i=sn(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function na(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=ho(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=mu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||vt,m=n.format,d=n.type;await It("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let _=String(h?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await It("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?Wn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=yi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=si(e.fast);for(;;){e.__slicer=k;let _=Vn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ps(n.element,n.options)),c>0&&!e.reconcile&&(St(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),P.warnedReconcile||(P.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=Ss(n.element,r)),!b&&r&&_s(n.element,r,n.options),r&&(Rs(n.element,r,a),Es(n.element,r))}finally{_()}if(!k?.yielded||!e.__tornSinceStart?.())break;k=null,e.__session=ho(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await It("afterClone",n),!$e(p,"render"))return null;if(k?.due()&&await k.pause(),On(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Fs(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){St(e.__session,"shrink-failed","shrink pass failed",_),console.warn("[snapdom] shrink pass failed:",_)}try{await En(n.clone,n.element,n.nodeMap)}catch{}let x=_=>Promise.resolve().then(_),S=(async()=>{await Promise.all([x(()=>Bn(n.clone,n.options)),x(()=>Hn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Is(n.element,n.clone,n.nodeMap)}catch(_){St(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),console.warn("[snapdom] backdrop-filter emulation failed:",_)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>Zn(n.clone,n.options,n.nodeMap))),e.captureSelection)try{zi(n.nodeMap)}catch(_){St(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let _=n.element.ownerDocument||document,T=w?H=>{try{let E=H.getBoundingClientRect();return E.right>=w.left-200&&E.left<=w.right+200&&E.bottom>=w.top-200&&E.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||$n(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of _.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(E=>String(E).split("__")[0]).filter(Boolean));await Pn(H,1,_)}l=await rs({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let C=n.clone;Jn(C,e.__compressedAssets);let R=await tr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Qn(C,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return R}ut();yt();var gu=new Set(["png","jpeg","jpg","webp","svg"]);function ra(t={}){let e=typeof t.type=="string"&&gu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=Uo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Gi(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}wt();te();pt();var oa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function yu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var bu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function wu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(bu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function Su(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var ia=new WeakMap;function xu(t){let e=Lt(),n=ia.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],f=c.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return ia.set(t,{epoch:e,leaky:r}),r}var vu=1/16;function ku(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=vu}var er=new Map,Cu=["width","height","min-width","min-height"];function Au(t){let e=er.get(t);if(e===void 0){e=null;for(let n of Cu){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}er.size>5e3&&er.clear(),er.set(t,e)}return e}function Mu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function _u(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var bo={attempts:0,served:0,reconciled:0};async function sa(t,e,n){bo.attempts++;try{let r=await Eu(t,e,n);return r&&bo.served++,r}catch{return null}}async function Eu(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||yu(t)||wu(r)||r.fontsCSS||Xn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=Je(t);if(!o||xu(i))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(oa)||u.querySelector?.(oa)||Su(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=Vn(u,null),g=In(u),y;try{y=await se(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,d,n),d.__pseudoCSS))return null;await kn(y,d),On(y);try{await En(y,u,m)}catch{}if(await Promise.all([Bn(y,n),Hn(u,y,r.styleCache,n,m)]),n.compress)try{await Zn(y,n,m)}catch{}for(let[b,w]of m.entries())po(b,w);p.replaceWith(y),_u(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let m=r.styleMap.get(u);if(!m)continue;let d=Au(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||(h=getComputedStyle(p)),!ku(h.getPropertyValue(y),d[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;bo.reconciled++,await lt(p,u,a,n)}}let c=Ve(r.styleMap);for(let[u,p]of r.styleMap.entries())Mu(u),uo(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");Jn(r.clone,n.__compressedAssets);let l=await tr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Qn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}yt();var So=new WeakMap,rr=new WeakMap,ya=new WeakSet,wo=new WeakMap,Ru=64,an=new Map,ba=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Fu=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Tu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Fu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function aa(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function ca(t,e){if(e.disposed||(an.delete(t),an.set(t,e),an.size<=Ru))return;let[n,r]=an.entries().next().value;wa(n,r)}function wa(t,e){e.disposed=!0,an.delete(t),So.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of ba)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of vo)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Sa(t){if(ya.has(t))return!1;rr.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=wo.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Le(f)||Le(l)},wo.set(a,u)),u.animated)return!1}else u&&wo.delete(a)}}return rr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function xo(t,e){if(!t.querySelectorAll)return!1;let n=rr.get(t);rr.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of vo)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of vo)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var vo=["scroll","change","beforetoggle","toggle"];function or(t,e){return[t,...e.trackedShadowRoots.keys()]}function ko(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of or(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function la(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(re(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var $u=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?nr(t):"-";function Pu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Nu(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Pu(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function fa(t){let e=String(t||"").trim();return e?$u.test(e)?!0:/^data:/i.test(e)?Nu(e):!1:!1}function Le(t){let e=String(t||"");if(fa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(fa(n[1]??n[2]??n[3]))return!0;return!1}function ua(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of xa(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function xa(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Co(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of or(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Ao(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of or(t,e))for(let s of xa(o))i(s);e.scrollNodes=n}function da(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Tu(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ne))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ne))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ne(o)),(s?.contains(t)||t.contains(s))&&i.push(Ne(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,ze(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Pe(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function pa(t,e){let n=new Set;for(let r of or(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ha(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Lu(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Iu(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:Se(),styleEpoch:Lt(),styleStamp:Qe(t),outsideMutations:Ke(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)re(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of ba)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return xo(t,e)||Co(t,e),Ao(t,e),ko(t,e),e}var Wu=0,ma=new WeakMap;function nr(t){let e=ma.get(t);return e||(e="@"+ ++Wu,ma.set(t,e)),e}function Mo(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(nr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(nr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Mo(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(nr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Mo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function ga(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Mo(i,new Set);return o===null?null:`${(e||[]).map(Ne).join(",")}:${o}`}catch{return null}}function va(t,e,n,r,i=null){let o=So.get(t);o||(o=Iu(t),o.baselineSignature=ga(e,n.plugins),So.set(t,o));let s=ga(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,xo(t,o),ko(t,o);for(let A of o.observers)A.__flush(A.takeRecords());At();let l=Ke(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),Sn(t.ownerDocument||document,p);let m=Qe(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=da(t,o),h=pa(t,o);d.animation=ha(h),o.renderState&&(!Pe(o.renderState,d,"style")&&(xe(),o.dirtyAll()),Pe(o.renderState,d,"scroll")||o.dirtyAll(),Pe(o.renderState,d,"controls")||(oe(t),o.dirtyAll()),!Pe(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Lt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=aa(t);o.geometry!==null&&A!==o.geometry&&(oe(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Pe(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let C=v.effect?.target;if(Lu(t,o,C)===t)A.add(C);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),oe(v)}else w&&!A&&o.dirtyAll()}catch{}let k=d.frameDriven,x=b||k;if(x&&(o.last=null),k&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return ca(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let C=await sa(t,o,n);C&&(A=await i(C),v=!0)}if(A||(f||(n.__retain=C=>{let R=new Map;for(let[_,T]of C.nodeMap.entries())R.set(T,_);S={...C,srcToClone:R}}),n.__tornSinceStart=()=>{for(let C of o.observers)for(let R of C.takeRecords())o.pending.push(R);return At(),o.torn||la(o.pending)||Ke(t)!==l},A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=ua(S),Co(t,o),Ao(t,o)):v&&(o.retainedFrameDriven||(o.retainedFrameDriven=ua(o.retained,M)),Co(t,o),Ao(t,o));let C=da(t,o);C.animation=ha(pa(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let _=R.every(T=>Pe(d,C,T));o.renderState=C,o.styleEpoch=Lt(),o.styleStamp=Qe(t),o.geometry=aa(t),o.renderState.frameDriven?(ya.add(t),wa(t,o)):_?!x&&!o.renderState.frameDriven&&(o.last=A,ca(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);At();let A=Ke(t);(o.torn||la(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Lt(),o.styleStamp=Qe(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(xo(t,o),ko(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ir=null;function Aa(t){ir=t}var Ou='button, a[href], [role="button"], input, select, summary, label, [tabindex]',_o=!1,cn=null,Eo=new WeakMap,ka=!1;function Ma(t,e){!_o||!cn||e&&e.burst===!1||Eo.set(cn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function _a(t){let e={control:t};cn=e,setTimeout(()=>{cn===e&&(cn=null)},0)}function Fo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Ou):null}function Ca(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Fo(t);e&&(_a(e),Ro(t,!1))}function Du(t){let e=Fo(t);e&&_a(e)}function Ro(t,e=!0){if(!ir||document.visibilityState==="hidden")return;let n=Fo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Eo.get(n);if(r){if(!r.element.isConnected){Eo.delete(n);return}ir(r.element,r.options).catch(()=>{});return}e&&!ka&&(ka=!0,ir(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ea(){if(_o||typeof document>"u"||typeof document.addEventListener!="function")return;_o=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ca,t),document.addEventListener("keydown",Ca,t),document.addEventListener("click",Du,t),document.addEventListener("pointerenter",Ro,t),document.addEventListener("focusin",Ro,t)}bt();function id(...t){return zs(...t),X}async function sd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await dt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Bo(i,{...e||{},burst:!1})}finally{n.remove()}}var ad="3.0.1-dev.0",X=Object.assign(Bo,{plugins:id,fromString:sd,version:ad,preCapture:Ea});Aa(Bo);var Do=Symbol("snapdom.internal"),cd=Symbol("snapdom.internal.silent"),Ba=new Set(["png","jpeg","jpg","webp","svg"]);async function Bo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=ra(e);n.element=t,n.invalidate&&xe(),Vs(n,e&&e.plugins);let{stage:r,loweredBy:i}=Us(n);n.needs=r,n.__needsLoweredBy=i;let o=$e(r,"render"),s=n.burst===!0||!Xn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Sa(t);return f&&Ma(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?va(t,e,n,()=>X.capture(t,n,Do),l=>Ua(l,n)):X.capture(t,n,Do)}X.capture=async(t,e,n)=>{if(n!==Do)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if($e(e.needs||vt,"render")&&Y()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=$n(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await Pn(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(en(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await na(t,e);return Ua(r,e)};async function Ua(t,e){let n=e.needs||vt,r=$e(n,"render"),i=E=>Hs(n,e.__needsLoweredBy||[],E),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=E=>{if(o||!f?.size)return c;let L=p.vbW,$=p.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(E.width),z=Number.isFinite(E.height);return(V&&z?Math.max(E.width/L,E.height/$):V?E.width/L*(F?Math.max(1,g/h):1):z?E.height/$*(F?Math.max(1,h/g):1):(E.scale||1)*Math.max(h,g))*(E.dpr||1)<=l?c:u??(u=Js(a(),f))},b=async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un));return $(c,{...E,...L||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let E=t.indexOf(",");return E>=0?decodeURIComponent(t.slice(E+1)):""},k=E=>Object.defineProperty({...E||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(E,L)=>{if(o)return b(E,L);let{toImg:$}=await Promise.resolve().then(()=>(Io(),Lo)),F={...E,...L||{}};return $(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:$}=await Promise.resolve().then(()=>(Io(),Lo)),F={...E,...L||{}};return $(y(F),F)},canvas:async(E,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(Ie(),La)),F={...E,...L||{}};return $(y(F),F)},blob:async(E,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Oo(),Ia)),F={...E,...L||{}};return $(y(F),F)},png:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"png"};return $(y(F),F)},jpeg:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"webp"};return $(y(F),F)},download:async(E,L)=>{let{download:$}=await Promise.resolve().then(()=>(Da(),Oa)),F={...E,...L||{}};return $(y(F),F)}};if(!r)for(let E of Object.keys(x)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;x[E]=async()=>{throw i(L)}}let S={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])S[E]=async L=>x[E](e,{..._(E,L||{}),[cd]:!0});S.jpg=S.jpeg;let A=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:k(),exports:S}),M=await Gn("defineExports",v),C=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),R={...x,...C};R.jpeg&&!R.jpg&&(R.jpg=(E,L)=>R.jpeg(E,L));function _(E,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.format.toLowerCase():Ba.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,E==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[E,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,N=Promise.resolve();async function O(E,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=_(E,$),B=A({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:$})}),Z=q.format,_t=q.type;await Gn("beforeExport",B,{format:E,options:q});let Wt=q.format!==Z?q.format:q.type!==_t?q.type:"",mt=typeof Wt=="string"?Wt.toLowerCase():"";Ba.has(mt)&&(q.format=mt==="jpg"?"jpeg":mt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await Gn("afterExport",B,{format:E,options:q,result:st}),T||(T=!0,await It("afterSnap",e)),st},V=N.then(F);return N=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(E,L)=>O(E,L),toImg:E=>O("img",E),toSvg:E=>O("svg",E),toCanvas:E=>O("canvas",E),toBlob:E=>O("blob",E),toPng:E=>O("png",E),toJpg:E=>O("jpg",E),toWebp:E=>O("webp",E),download:E=>O("download",E)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let E of Object.keys(R)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=$=>O(E,$))}return H}X.toRaw=(t,e)=>X(t,e).then(n=>n.toRaw());X.toImg=(t,e)=>X(t,e).then(n=>n.toImg());X.toSvg=(t,e)=>X(t,e).then(n=>n.toSvg());X.toCanvas=(t,e)=>X(t,e).then(n=>n.toCanvas());X.toBlob=(t,e)=>X(t,e).then(n=>n.toBlob());X.toPng=(t,e)=>X(t,{...e,format:"png"}).then(n=>n.toPng());X.toJpg=(t,e)=>X(t,{...e,format:"jpeg"}).then(n=>n.toJpg());X.toWebp=(t,e)=>X(t,{...e,format:"webp"}).then(n=>n.toWebp());X.download=(t,e)=>X(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=X);})();
|