1 line
146 KiB
JavaScript
1 line
146 KiB
JavaScript
System.register([],function(t,e){var r,n,i,o,l,a,s,c,u,d,f,h,m,p,g,y,b,w,x,S,v,C,M,$,k,A,E,F,N,R,L,P,T,W,I,_,O,D,H,j,U,B,V,q,z,X,Y,G,Q,J,K,Z,tt,et,rt,nt,it,ot,lt,at,st,ct,ut,dt,ft,ht,mt,pt,gt,yt,bt,wt,xt,St,vt,Ct,Mt,$t,kt,At,Et,Ft,Nt,Rt,Lt,Pt,Tt,Wt,It,_t,Ot,Dt,Ht,jt,Ut,Bt,Vt;function qt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let r=e[2].trim();return r.startsWith("#")?null:r}function zt(t,e=1){let r=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!r)return null;let n=[];for(let i of r[1].split(",")){let t=i.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let e=i.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(e&&!s.test(e[1].trim()))continue;let r=i.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),o=1;if(r){let t=parseFloat(r[1]);o=/dpi/i.test(r[2])?t/96:t}n.push({url:t[2].trim(),dppx:o})}return n.length?(n.sort((t,e)=>t.dppx-e.dppx),(n.find(t=>t.dppx>=e)||n[n.length-1]).url):null}function Xt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Yt(t,e){if(!e||function(t){return/^data:|^blob:|^about:blank$/i.test(t)}(t)||function(t,e){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=e.includes("{url}")?e.split("{url}")[0]:e,i=new URL(n||".",r),o=new URL(t,r);if(o.origin===i.origin)return!0;let l=o.searchParams;if(l&&(l.has("url")||l.has("target")))return!0}catch{}return!1}(t,e))return!1;try{let e=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,e);return!(typeof location<"u")||r.origin!==location.origin}catch{return!!e}}function Gt(t){return new Promise((e,r)=>{let n=new FileReader;n.onload=()=>e(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(t)})}async function Qt(t,e={}){let r=e.as??"blob",n=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,l=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if("text"===r)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if("dataURL"===r)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,e="",n=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(n):decodeURIComponent(n),o=new Uint8Array([...i].map(t=>t.charCodeAt(0))),l=new Blob([o],{type:(e||"").split(";")[0]||""});return{ok:!0,data:l,status:200,url:t,fromCache:!1,mime:l.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let e=await fetch(t);if(!e.ok)return{ok:!1,data:null,status:e.status,url:t,fromCache:!1,reason:"http_error"};let n=await e.blob(),i=n.type||e.headers.get("content-type")||"";return"dataURL"===r?{ok:!0,data:await Gt(n),status:e.status,url:t,fromCache:!1,mime:i}:"text"===r?{ok:!0,data:await n.text(),status:e.status,url:t,fromCache:!1,mime:i}:{ok:!0,data:n,status:e.status,url:t,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return"dataURL"===r?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:"text"===r?"":new Blob([]),status:200,url:t,fromCache:!1};let s=function(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}(t,{as:r,timeout:n,useProxy:i,errorTTL:o}),c=f.get(s);if(c&&c.until>Date.now())return{...c.result,fromCache:!0};c&&f.delete(s);let h=d.get(s);if(h)return h;let m=Yt(t,i)?function(t,e){return e?e.includes("{url}")?e.replace("{urlRaw}",Xt(t)).replace("{url}",encodeURIComponent(t)):/[?&]url=?$/.test(e)?`${e}${encodeURIComponent(t)}`:e.endsWith("?")?`${e}url=${encodeURIComponent(t)}`:e.endsWith("/")?`${e}${Xt(t)}`:`${e}${e.includes("?")?"&":"?"}url=${encodeURIComponent(t)}`:t}(t,i):t,p=e.credentials;if(!p)try{let e=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,e);p=typeof location<"u"&&r.origin===location.origin?"include":"omit"}catch{p="omit"}let g=new AbortController,y=setTimeout(()=>g.abort("timeout"),n),b=(async()=>{try{let n=await fetch(m,{signal:g.signal,credentials:p,headers:l});if(!n.ok){let i={ok:!1,data:null,status:n.status,url:m,fromCache:!1,reason:"http_error"};if(o>0&&f.set(s,{until:Date.now()+o,result:i}),!a){let e=`${n.status} ${n.statusText||""}`.trim();u.warnOnce(`http:${n.status}:${r}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${e} while fetching ${r} ${t}`)}return e.onError&&e.onError(i),i}if("text"===r)return{ok:!0,data:await n.text(),status:n.status,url:m,fromCache:!1};let i=await n.blob(),c=i.type||n.headers.get("content-type")||"";return"dataURL"===r?{ok:!0,data:await Gt(i),status:n.status,url:m,fromCache:!1,mime:c}:{ok:!0,data:i,status:n.status,url:m,fromCache:!1,mime:c}}catch(i){let l=i&&"object"==typeof i&&"name"in i&&"AbortError"===i.name?String(i.message||"").includes("timeout")?"timeout":"abort":"network",c={ok:!1,data:null,status:0,url:m,fromCache:!1,reason:l};if(!/^blob:/i.test(t)&&o>0&&f.set(s,{until:Date.now()+o,result:c}),!a){let e=`${l}:${r}:${new URL(t,location?.href??"http://localhost/").origin}`,i="timeout"===l?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${t}`:"abort"===l?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;u.errorOnce(e,i)}return e.onError&&e.onError(c),c}finally{clearTimeout(y),d.delete(s)}})();return d.set(s,b),b}async function Jt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||"none"===t.trim())return t;let r=zt(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??qt(t);if(!r)return t;let n=Xt(function(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let r=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,r).href}catch{return t}}(r)),i=(e.useProxy||"")+"|"+n;if(l.background.has(i)){let t=l.background.get(i);return t?`url("${t}")`:"none"}try{let t=await Qt(n,{as:"dataURL",useProxy:e.useProxy});return t.ok?(l.background.set(i,t.data),`url("${t.data}")`):(l.background.set(i,null),"none")}catch{return l.background.set(i,null),"none"}}function Kt(t){if(t=String(t).toLowerCase(),g.has(t)){let e={};return l.defaultStyle.set(t,e),e}if(l.defaultStyle.has(t))return l.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),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 r=document.createElement(t);r.style.all="initial",e.appendChild(r);let n=getComputedStyle(r),i={};for(let o of n)Zt(o)||(i[o]=n.getPropertyValue(o));return e.removeChild(r),l.defaultStyle.set(t,i),i}function Zt(t){let e=x.get(t);if(void 0===e){let r=String(t).toLowerCase();e=w.has(r)||b.test(r)||y.test(r),x.set(t,e)}return e}function te(t,e){return!C.has(t)&&("inline"===e||S.has(t)||v.has(t))}function ee(t,e,r=!0,n=!1){if(e=String(e||"").toLowerCase(),g.has(e))return"";let i=[],o=Kt(e),l=(t.display||"").toLowerCase(),a="inline"===l,s=te(e,l),c=t["text-wrap-mode"]||t["white-space"]||"",u=s&&r&&!a&&("nowrap"===c||"pre"===c),d=s&&r&&!u,f=!1;for(let h in t){if(Zt(h))continue;let e=t[h];if(d){if(M.has(h))continue;if($.has(h)){e&&e!==o[h]&&(i.push(`${h}:${e}`),"auto"!==e&&(f=!0));continue}}if(e&&e!==o[h]){if(!u&&("width"===h||"inline-size"===h)&&e.endsWith("px")&&e.includes(".")){let t=parseFloat(e);if(Number.isFinite(t)){i.push(`${h}:${Math.ceil(16*t)/16}px`);continue}}i.push(`${h}:${e}`)}}if(d&&!a&&!n&&!f){let e=t.width;e&&"auto"!==e&&e!==o.width&&i.push(`min-width:${e}`)}return i.sort(),i.join(";")}function re(t,e=null){let r=()=>{let t={length:0,getPropertyValue:()=>"",item:()=>""};return t[Symbol.iterator]=function*(){},t};if(1!==t?.nodeType){let n=typeof window<"u"?window:null;if(n&&"function"==typeof n.getComputedStyle)try{return n.getComputedStyle(t,e)||r()}catch{return r()}return r()}let n=l.computedStyle.get(t);n||(n=new Map,l.computedStyle.set(t,n));let i=n.get(e);if(!i){let o=function(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let r=e.defaultView;if(r&&"function"==typeof r.getComputedStyle)return r;if(typeof window<"u"&&window.frames)for(let t=0;t<window.frames.length;t++)try{if(window.frames[t]?.document===e)return window.frames[t]}catch{}}catch{}return typeof window<"u"?window:null}(t),l=null;try{l=o&&"function"==typeof o.getComputedStyle?o.getComputedStyle(t,e):null}catch{}if(!l&&typeof window<"u"&&"function"==typeof window.getComputedStyle)try{t.ownerDocument===document&&(l=window.getComputedStyle(t,e))}catch{}i=l||r(),n.set(e,i)}return i}function ne(t){let e={};for(let r of t)e[r]=t.getPropertyValue(r);for(let r of k){let t=e[`border-${r}-style`];("none"===t||"hidden"===t||"0px"===e[`border-${r}-width`])&&(delete e[`border-${r}-style`],delete e[`border-${r}-width`],delete e[`border-${r}-color`])}return e}function ie(t){let e=[],r=0,n=0;for(let i=0;i<t.length;i++){let o=t[i];"("===o&&r++,")"===o&&r--,","===o&&0===r&&(e.push(t.slice(n,i).trim()),n=i+1)}return e.push(t.slice(n).trim()),e}function oe(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function le(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),r=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),n=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),l=n&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),s=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),c=/ipad|iphone|ipod/.test(e)&&n;return r||l||a||s||c}function ae(t,e,r){let n=t&&"object"==typeof t&&(t.options||t);n&&n.debug&&(void 0!==r?console.warn("[snapdom]",e,r):console.warn("[snapdom]",e))}function se(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function ce(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function ue(t){let e=[],r="",n=0;for(let i=0;i<t.length;i++){let o=t[i];"("===o&&n++,")"===o&&(n=Math.max(0,n-1)),";"===o&&0===n?(e.push(r),r=""):r+=o}return r.trim()&&e.push(r),e.map(t=>t.trim()).filter(Boolean)}function de(t){let e=ue(t),r=null,n=null,i=null,o=[];for(let a of e){let t=a.indexOf(":");if(t<0)continue;let e=a.slice(0,t).trim().toLowerCase(),l=a.slice(t+1).trim();"box-shadow"===e?i=l:"filter"===e?r=l:"-webkit-filter"===e?n=l:o.push([e,l])}if(i){let t=function(t){let e=[],r="",n=0;for(let o=0;o<t.length;o++){let i=t[o];"("===i&&n++,")"===i&&(n=Math.max(0,n-1)),","===i&&0===n?(e.push(r.trim()),r=""):r+=i}r.trim()&&e.push(r.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let[t="0px",e="0px",r="0px"]=o.match(/-?\d+(?:\.\d+)?px/gi)||[];r=parseFloat(r)/2+"px";let n=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," "),l=!!n&&","!==n;i.push(`drop-shadow(${t} ${e} ${r}${l?` ${n}`:""})`)}return i.join(" ")}(i);t&&(r=r?`${r} ${t}`:t,n=n?`${n} ${t}`:t)}let l=[...o];return r&&l.push(["filter",r]),n&&l.push(["-webkit-filter",n]),l.map(([t,e])=>`${t}:${e}`).join(";")}function fe(t){return t=(t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,e)=>t.replace(e,function(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(t,e,r)=>`${e}{${de(r)}}`)}(e)))).replace(/style=(['"])([\s\S]*?)\1/gi,(t,e,r)=>`style=${e}${de(r)}${e}`)}function he(t,e){let r=t=>ue(t).map(t=>{let r=t.indexOf(":");if(r<0)return t;let n=t.slice(0,r).trim().toLowerCase();return"text-shadow"===n||e&&"box-shadow"===n?`${n}:${function(t){let e=[],r=0,n=0;for(let i=0;i<t.length;i++){let o=t[i];"("===o?r++:")"===o?r=Math.max(0,r-1):","===o&&0===r&&(e.push(t.slice(n,i)),n=i+1)}return e.push(t.slice(n)),e.map(t=>{let e=0,r=0,n="",i=0;for(;i<t.length;){let o=t[i];if("("===o?e++:")"===o&&(e=Math.max(0,e-1)),0===e&&(0===i||" "===t[i-1])){let e=/^-?\d*\.?\d+px/.exec(t.slice(i));if(e){r++,n+=2===r?-parseFloat(e[0])+"px":e[0],i+=e[0].length;continue}}n+=o,i++}return n}).join(",")}(t.slice(r+1))}`:t}).join(";");return t=(t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,e)=>t.replace(e,e.replace(/([^{}]+)\{([^}]*)\}/g,(t,e,n)=>`${e}{${r(n)}}`)))).replace(/style=(['"])([\s\S]*?)\1/gi,(t,e,n)=>`style=${e}${r(n)}${e}`)}async function me(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:e,flippedY:r}=await(T||(T=(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 r=document.createElement("canvas");r.width=8,r.height=20;let n=r.getContext("2d",{willReadFrequently:!0});n.drawImage(e,0,0);let i=n.getImageData(2,18,1,1).data[3]>128,o=n.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})()));try{let n=t;return e||(n=fe(n)),r&&(n=he(n,e)),{svg:n,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}async function pe(t,e){let{width:r,height:n,scale:i=1,dpr:o=1,meta:l={},backgroundColor:a}=e,s=t,c=!1,u=!1;if(function(t){return"string"==typeof t&&/^data:image\/svg\+xml/i.test(t)}(t)){let e=(function(t){let e=t.indexOf(",");if(e<0)return"";let r=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(r)}catch{return""}}(t).match(/<svg\b[^>]*>/i)||[])[0]||"",r=parseFloat((e.match(/\bwidth="([\d.]+)/i)||[])[1]),n=parseFloat((e.match(/\bheight="([\d.]+)/i)||[])[1]),i=Number.isFinite(r)&&Number.isFinite(n)&&r>0&&n>0&&Math.min(1,L/r,L/n,Math.sqrt(P/(r*n)))<1;if(i||le())try{let e=se(t);if(le()){let t=await me(e);e=t.svg,c=t.naturalOnly,u=/@font-face|data:image\//i.test(e)}i&&(e=function(t){try{let e=t.match(/<svg\b[^>]*>/i);if(!e)return t;let r=e[0],n=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(n)||!Number.isFinite(i)||n<=0||i<=0)return t;let o=Math.min(1,L/n,L/i,Math.sqrt(P/(n*i)));if(o>=1)return t;let l=Math.max(1,Math.floor(n*o)),a=Math.max(1,Math.floor(i*o));return console.warn(`[snapDOM] Capture ${Math.round(n)}×${Math.round(i)}px exceeds the browser image-decode limit (${L}px/side); downscaling to ${l}×${a}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${l}`).replace(/(\bheight=")[\d.]+/i,`$1${a}`))}catch{return t}}(e)),s=ce(e)}catch{s=t}}let d=new Image;d.loading="eager",d.decoding="sync",d.crossOrigin="anonymous",d.src=s,await d.decode(),le()&&await async function(t,e){t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{let r=document.createElement("canvas");r.width=16,r.height=16;let n=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)}),i=r.getContext("2d",{willReadFrequently:!0});if(!i)return await n(),void(await n());let o=performance.now()+(e?600:150);for(;;){i.clearRect(0,0,16,16);try{i.drawImage(t,0,0,16,16)}catch{return}let e=i.getImageData(0,0,16,16).data,r=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0){r=!0;break}if(r||performance.now()>o)return;await n()}}finally{try{t.remove()}catch{}}}(d,u);let f,h,m=d.naturalWidth,p=d.naturalHeight,g=Number.isFinite(l.vbW)?l.vbW:Number.isFinite(l.w0)?l.w0:m,y=Number.isFinite(l.vbH)?l.vbH:Number.isFinite(l.h0)?l.h0:p,b=Number.isFinite(r),w=Number.isFinite(n);b&&w?(f=Math.max(1,r),h=Math.max(1,n)):b?(f=r,h=y*(r/Math.max(1,g))):w?(h=n,f=g*(n/Math.max(1,y))):(f=m,h=p),f*=i,h*=i;let x=f*o,S=h*o,v=Math.max(x/L,S/L,Math.sqrt(x*S/P));v>1&&(console.warn(`[snapDOM] Output ${Math.round(x)}×${Math.round(S)}px exceeds the browser canvas limit (${L}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),f/=v,h/=v);let C=document.createElement("canvas");C.width=f*o,C.height=h*o,C.style.width=`${f}px`,C.style.height=`${h}px`;let M=C.getContext("2d");if(1!==o&&M.scale(o,o),a&&(M.save(),M.fillStyle=a,M.fillRect(0,0,f,h),M.restore()),!c||Math.round(f*o)===m&&Math.round(h*o)===p)M.drawImage(d,0,0,f,h);else{let t=document.createElement("canvas");t.width=m,t.height=p,t.getContext("2d").drawImage(d,0,0),M.drawImage(t,0,0,f,h)}return C}async function ge(t,e){let r=await pe(t,e),n=await new Promise(t=>{let n=()=>t(r.toDataURL(`image/${e.format}`,e.quality));try{r.toBlob(e=>{if(!e)return n();let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=n,r.readAsDataURL(e)},`image/${e.format}`,e.quality)}catch{n()}}),i=new Image;return i.src=n,await i.decode(),i.style.width=r.width/e.dpr+"px",i.style.height=r.height/e.dpr+"px",i}async function ye(t,e){let{scale:r=1,width:n,height:i,meta:o={}}=e,l=Number.isFinite(n),a=Number.isFinite(i),s=Number.isFinite(r)&&1!==r||l||a;if(le()&&s)try{let{svg:e}=await me(se(t)),s=(e.match(/<svg\b[^>]*>/i)||[])[0]||"",c=parseFloat((s.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((s.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(c)||!Number.isFinite(u))throw new Error("svg without dimensions");let d,f,h=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c,m=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u;l&&a?(d=n,f=i):l?(d=n,f=Math.round(m*(n/Math.max(1,h)))):a?(f=i,d=Math.round(h*(i/Math.max(1,m)))):(d=Math.round(c*r),f=Math.round(u*r));let p=e.replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${f}"`),g=new Image;return g.decoding="sync",g.loading="eager",g.src=ce(p),await g.decode(),g.style.width=`${d}px`,g.style.height=`${f}px`,g}catch(u){return ae(e,"safari vector toImg failed, falling back to PNG",u),ge(t,{...e,format:"png",quality:1,meta:o})}let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,await c.decode(),l&&a)c.style.width=`${n}px`,c.style.height=`${i}px`;else if(l){let t=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,e=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,r=n/Math.max(1,t);c.style.width=`${n}px`,c.style.height=`${Math.round(e*r)}px`}else if(a){let t=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,e=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,r=i/Math.max(1,e);c.style.height=`${i}px`,c.style.width=`${Math.round(t*r)}px`}else{let n=Math.round(c.naturalWidth*r),i=Math.round(c.naturalHeight*r);if(c.style.width=`${n}px`,c.style.height=`${i}px`,"string"==typeof t&&t.startsWith("data:image/svg+xml"))try{let e=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${n}"`).replace(/height="[^"]*"/,`height="${i}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,c.src=t}catch(d){ae(e,"SVG width/height patch in toImg failed",d)}}return c}async function be(t,e){let r=e.type;if("svg"===r){let e=decodeURIComponent(t.split(",")[1]);return new Blob([e],{type:"image/svg+xml"})}let n=await pe(t,e);return new Promise(t=>n.toBlob(e=>t(e),`image/${r}`,e.quality))}async function we(t,e){let r=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:e})}catch(n){if("AbortError"!==n.name)return!1}return!0}async function xe(t,e){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(e?.type||"").toLowerCase(),i=r.has(n)?n:"",o=(e?.format||i||"").toLowerCase(),l="jpg"===o?"jpeg":o||"png",a=e?.filename||`snapdom.${l}`,s={...e||{},format:l,type:l};s.dpr=1;let c=function(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return"iOS"===navigator.userAgentData.platform;let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),r=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||r}();if("svg"===l){let e=await be(t,{...s,type:"svg"});if(c&&await we(e,a))return;let r=URL.createObjectURL(e),n=document.createElement("a");return n.href=r,n.download=a,document.body.appendChild(n),n.click(),URL.revokeObjectURL(r),void n.remove()}let u=await pe(t,s);if(c){let t=`image/${l}`,r=await new Promise(r=>u.toBlob(r,t,e?.quality));if(r&&await we(r,a))return}let d=document.createElement("a");d.href=u.toDataURL(`image/${l}`,e?.quality),d.download=a,document.body.appendChild(d),d.click(),d.remove()}function Se(){X++,q.size>z&&q.clear()}function ve(t){let e=t&&(1===t.nodeType?t:t.parentElement);return!!(e&&e.closest&&e.closest(Y))}function Ce(t){for(let e of t)if(!ve(e.target)){if("childList"===e.type){let t=!0;for(let r of e.addedNodes)if(!ve(r)){t=!1;break}if(t)for(let r of e.removedNodes)if(!ve(r)){t=!1;break}if(t)continue}return!0}return!1}function Me(t){let e=V.get(t);if(e&&e.epoch===X){let t=e.snapshot&&e.snapshot.__needsBgInline;if(void 0!==t)return t}return!0}function $e(t,e=null,r={}){let n=V.get(t),i=!(!r||!r.embedFonts),o=r&&r.excludeStyleProps||null;if(n&&n.epoch===X&&n.embedFonts===i&&n.excludeStyleProps===o)return n.snapshot;let l=e||getComputedStyle(t),a=function(t,e={}){let r={},n=t.getPropertyValue("visibility"),i=e.excludeStyleProps;for(let u=0;u<t.length;u++){let e=t[u];if(Zt(e)||i&&(i instanceof RegExp&&i.test(e)||"function"==typeof i&&i(e)))continue;let n=t.getPropertyValue(e);("background-image"===e||"content"===e)&&n.includes("url(")&&!n.includes("data:")&&(n="none"),r[e]=n}for(let u of["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"])if(!r[u])try{let e=t.getPropertyValue(u);e&&(r[u]=e)}catch{}for(let u of["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"])if(!r[u])try{let e=t.getPropertyValue(u);e&&(r[u]=e)}catch{}if(e.embedFonts)for(let u of["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"])if(!r[u])try{let e=t.getPropertyValue(u);e&&(r[u]=e)}catch{}"hidden"===n&&(r.opacity="0");try{"hidden"===(r["content-visibility"]||t.getPropertyValue("content-visibility"))&&(r.visibility="hidden")}catch{}let o=!1;{let e=t.getPropertyValue("background-image");if(e&&"none"!==e&&(o=!0),!o){let e=t.getPropertyValue("background-color");e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e&&(o=!0)}if(!o)for(let r of Q){let e=t.getPropertyValue(r);if(e&&"none"!==e){o=!0;break}}if(!o){let e=t.getPropertyValue("background");e&&/url\s*\(/i.test(e)&&(o=!0)}}Object.defineProperty(r,"__needsBgInline",{value:o,enumerable:!1});let l=parseFloat(t.getPropertyValue("border-top-width")||0)||0,a=parseFloat(t.getPropertyValue("border-right-width")||0)||0,s=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(0===l&&0===a&&0===s&&0===c){let e=(t.getPropertyValue("border-image-source")||"").trim(),n=e&&"none"!==e;for(let t of["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"])delete r[t];n||(r.border="none")}return r}(l,r);return function(t,e,r){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let n=t.tagName&&t.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n))return;let i=parseFloat(e.height);if(Number.isFinite(i)&&t.scrollHeight>0&&Math.abs(i-t.scrollHeight)>2||e.aspectRatio&&"none"!==e.aspectRatio&&"auto"!==e.aspectRatio)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}(t))return;let l=e.position;if("absolute"===l||"fixed"===l||"sticky"===l||"none"!==e.transform||function(t){return!!(t.backgroundImage&&"none"!==t.backgroundImage||t.backgroundColor&&"rgba(0, 0, 0, 0)"!==t.backgroundColor&&"transparent"!==t.backgroundColor||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0)||"visible"!==(t.overflowBlock||t.overflowY||"visible")}(e)||Ae(t))return;let a=e.overflowX||e.overflow||"visible",s=e.overflowY||e.overflow||"visible";if("visible"!==a||"visible"!==s)return;let c=e.clip;c&&"auto"!==c&&"rect(auto, auto, auto, auto)"!==c||"hidden"===e.visibility||"0"===e.opacity||function(t){for(let n=t.firstChild;n;n=n.nextSibling)if(3===n.nodeType&&/\S/.test(n.nodeValue))return!0;let e=t.firstElementChild,r=t.lastElementChild;if(e&&"BR"===e.tagName||r&&"BR"===r.tagName)return!0;for(let n=t.firstElementChild;n;n=n.nextElementSibling){let t=re(n);if("none"===t.display)continue;let e=t.position;if("absolute"!==e&&"fixed"!==e)return!0}return!1}(t)&&(delete r.height,delete r["block-size"])}(t,l,a),V.set(t,{epoch:X,snapshot:a,embedFonts:i,excludeStyleProps:o}),a}async function ke(t,e,r,n){if("STYLE"===t.tagName)return;let i=function(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:q,defaultStyle:l.defaultStyle,baseStyle:l.baseStyle,image:l.image,resource:l.resource,background:l.background,font:l.font},options:e||{}}:{session:l.session,persist:{snapshotKeyCache:q,defaultStyle:l.defaultStyle,baseStyle:l.baseStyle,image:l.image,resource:l.resource,background:l.background,font:l.font},options:t||e||{}}}(r,n),o=i.options&&i.options.cache||"auto";"disabled"!==o&&function(t=document.documentElement){if(G)return;G=!0;let e=t=>{Ce(t)&&Se()};try{new MutationObserver(e).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(e).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Se),t.ready?.then(()=>Se()).catch(()=>{}))}catch{}}(document.documentElement),"disabled"===o&&!i.session.__bumpedForDisabled&&(Se(),q.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:s}=i;if(!a.styleCache.has(t)){let e=null;try{e=getComputedStyle(t)}catch{}a.styleCache.set(t,e||getComputedStyle(document.documentElement))}let c=a.styleCache.get(t);t.getAttribute?.("style")&&function(t,e,r){if(t.style&&0!==t.style.length)for(let n=0;n<t.style.length;n++){let i=t.style[n],o=r.getPropertyValue(i);o&&e.style.setProperty(i,o)}}(t,e,c);let u=c.getPropertyValue("animation-name");e&&e.style&&u&&"none"!==u&&e.style.setProperty("animation","none","important");let d=$e(t,c,i.options),f=Ae(t);if(f){let t=c.getPropertyValue("min-width");(!t||"auto"===t||"0px"===t)&&(d["min-width"]="0px")}let h=t.tagName?.toLowerCase()||"div",m=function(t){let e=J.get(t);return e||(e=Object.entries(t).sort((t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0).map(([t,e])=>`${t}:${e}`).join(";"),J.set(t,e),e)}(d),p=!0;if(te(h,(d.display||"").toLowerCase())){p=function(t){for(let e=t.firstChild;e;e=e.nextSibling){if(3===e.nodeType&&/\S/.test(e.nodeValue||""))return!0;if(1===e.nodeType){let t=re(e).position;if("absolute"!==t&&"fixed"!==t)return!0}}return!1}(t),m=`${m}|${h}${p?"|c":""}${f?"|f":""}`;let e=d["text-wrap-mode"]||d["white-space"]||"";p&&"nowrap"!==e&&"pre"!==e&&(a.reconcileRisk=(a.reconcileRisk||0)+1)}let g=s.snapshotKeyCache.get(m);void 0===g&&(g=ee(d,h,p,f),s.snapshotKeyCache.set(m,g)),a.styleMap.set(e,g)}function Ae(t){let e=t.parentElement;if(!e)return!1;let r=re(e).display||"";return r.includes("flex")||r.includes("grid")}function Ee(t){let e=t;for(;e&&1===e.nodeType;){if("http://www.w3.org/2000/svg"===e.namespaceURI){if("mask"===e.localName||"clipPath"===e.localName)return!1;if(Z.has(e.localName))return!0}e=e.parentNode}return!1}function Fe(t,e){if(1!==t?.nodeType||1!==e?.nodeType||Ee(t))return;let r=t.getAttribute?.("style"),n=!(!r||!r.includes("var("));if(!n&&t.attributes?.length){let e=t.attributes;for(let t=0;t<e.length;t++){let r=e[t];if(r&&"string"==typeof r.value&&r.value.includes("var(")){n=!0;break}}}let i=null;if(n)try{i=getComputedStyle(t)}catch{}if(n){let r=t.style;if(r&&r.length){let t=new Set;for(let n=0;n<r.length;n++){let o=r[n];if(t.has(o))continue;t.add(o);let l=r.getPropertyValue(o);if(!l||!l.includes("var("))continue;let a=i&&i.getPropertyValue(o);if(a)try{e.style.setProperty(o,a.trim(),r.getPropertyPriority(o))}catch{}}}}if(n&&t.attributes?.length){let r=t.attributes;for(let t=0;t<r.length;t++){let n=r[t];if(!n||"string"!=typeof n.value||!n.value.includes("var("))continue;let o=n.name,l=i&&i.getPropertyValue(o);if(l)try{e.style.setProperty(o,l.trim())}catch{}}}if(!n){if(!i)try{i=getComputedStyle(t)}catch{i=null}if(!i)return;let r=t.namespaceURI||"html",n=function(t,e){let r=e+"::"+t.toLowerCase(),n=tt.get(r);if(n)return n;let i=document,o="http://www.w3.org/2000/svg"===e?i.createElementNS(e,t):i.createElement(t),l=i.createElement("div");l.setAttribute("data-snapdom-internal",""),l.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",l.appendChild(o),i.documentElement.appendChild(l);let a=getComputedStyle(o),s={};for(let c of K)s[c]=a.getPropertyValue(c)||"";return l.remove(),tt.set(r,s),s}(t.tagName,r);for(let t of K){let r=i.getPropertyValue(t)||"",o=n[t]||"";if(r&&r!==o)try{e.style.setProperty(t,r.trim())}catch{}}}}function Ne(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}function Re(t,e){if(!t)return null;let r=0;try{r=e?e.getBoundingClientRect().width||e.width:0}catch{}r||(r=window.innerWidth||1e3);let n=[];for(let o of t.split(",")){let t=o.trim().split(/\s+/);if(!t[0])continue;let e=t[1]||"",i=1;/^\d*\.?\d+x$/i.test(e)?i=parseFloat(e):/^\d+w$/i.test(e)&&(i=parseInt(e,10)/r),n.push({url:t[0],d:i})}if(!n.length)return null;n.sort((t,e)=>t.d-e.d);let i=window.devicePixelRatio||1;return(n.find(t=>t.d>=i)||n[n.length-1]).url}function Le(t,e){let r=t.currentSrc||"";if(r&&!Ne(r))return r;let n=e.querySelectorAll("source[srcset]"),i=null;for(let o of n){let e=o.getAttribute("srcset");if(!e||Ne(e))continue;let r=o.getAttribute("type");if(r&&!rt.test(r.trim()))continue;let n=o.getAttribute("media");if(n)try{if(window.matchMedia(n).matches)return Re(e,t)}catch{}i||(i=Re(e,t))}return i}function Pe(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let n of e)if(n&&!Ne(n))return n;let r=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(r){let t=r.split(",")[0].trim().split(/\s+/)[0];if(t&&!Ne(t))return t}return null}async function Te(t,e={}){if(!t||1!==t?.nodeType||!1===e.resolvePicturePlaceholders)return null;let{timeout:r,concurrency:n,resolveLazySrc:i,silent:o,useProxy:l}=function(t={}){let e=t.pictureResolver&&"object"==typeof t.pictureResolver?t.pictureResolver:{};return{timeout:e.timeout??5e3,concurrency:e.concurrency??4,resolveLazySrc:!1!==e.resolveLazySrc,silent:e.silent??!1,useProxy:"string"==typeof t.useProxy?t.useProxy:""}}(e);if(!function(t,e){return!(!t||1!==t?.nodeType||!(t.matches?.("picture")||t.querySelector("picture")||e&&(t.matches?.(et)||t.querySelector(et))))}(t,i))return null;let a=[],s=[];async function c(t){let e=await Qt(t,{as:"dataURL",timeout:r,useProxy:l,silent:!0});return e.ok?e.data:null}let u=Array.from(t.querySelectorAll("picture"));t.matches?.("picture")&&u.unshift(t);for(let d of u){let t=d.querySelector("img");if(!t)continue;if(!Ne(t.getAttribute("src")||""))continue;let e=Le(t,d);e&&s.push(async()=>{let r=await c(e);if(!r)return void(o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${e.slice(0,60)}`));let n=t.getAttribute("src"),i=t.getAttribute("srcset"),l=t.getAttribute("sizes"),s=[];t.src=r,t.setAttribute("src",r),t.removeAttribute("srcset"),t.removeAttribute("sizes");let u=d.querySelectorAll("source");for(let t of u)s.push({el:t,parent:t.parentElement,next:t.nextSibling}),t.remove();a.push(()=>{null!==n?t.setAttribute("src",n):t.removeAttribute("src"),null!==i&&t.setAttribute("srcset",i),null!==l&&t.setAttribute("sizes",l);for(let{el:t,parent:e,next:r}of s)e&&e.insertBefore(t,r)})})}if(i){let e=Array.from(t.querySelectorAll("img"));"img"===t.localName&&e.unshift(t);for(let t of e){if(t.closest("picture")&&Ne(t.getAttribute("src")||""))continue;let e=t.getAttribute("src")||"",r=Pe(t);r&&Ne(e)&&s.push(async()=>{let e=await c(r);if(!e)return;let n=t.getAttribute("src");t.src=e,t.setAttribute("src",e),t.removeAttribute("srcset"),t.removeAttribute("sizes"),a.push(()=>{null!==n?t.setAttribute("src",n):t.removeAttribute("src")})})}}return 0===s.length?null:(await async function(t){for(let e=0;e<t.length;e+=n){let r=t.slice(e,e+n);await Promise.allSettled(r.map(t=>t()))}}(s),async function(){for(let t of a)try{t()}catch{}})}function We(t,e,r){return r?Promise.all(t.map(t=>new Promise(r=>e(t,r)))):Promise.all(t.map(t=>new Promise(n=>{!function i(){oe(r=>{!r||"function"!=typeof r.timeRemaining||r.timeRemaining()>0?e(t,n):i()},{fast:r})}()})))}function Ie(t,e){return t?t=(t=(t=(t=(t=t.replace(/:host\(([^)]+)\)/g,(t,r)=>`:where(${e}:is(${r.trim()}))`)).replace(/:host\b/g,`:where(${e})`)).replace(/:host-context\(([^)]+)\)/g,(t,r)=>`:where(:where(${r.trim()}) ${e})`)).replace(/::slotted\(([^)]+)\)/g,(t,r)=>`:where(${e} ${r.trim()})`)).replace(/(^|})(\s*)([^@}{]+){/g,(t,r,n,i)=>`${r}${n}${function(t,e,r=!0){return t.split(",").map(t=>t.trim()).filter(Boolean).map(t=>t.startsWith(":where(")||t.startsWith("@")?t:`:where(${e} ${r?function(t){return!(t=t.trim())||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}(t):t})`).join(", ")}(i,e,!0)}{`):""}function _e(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(t)return t}catch{}return""}function Oe(t){let e=0,r=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(r=t.offsetHeight),0===e||0===r)try{let n=getComputedStyle(t);if(0===e){let t=parseFloat(n.width);!isNaN(t)&&t>0&&(e=t)}if(0===r){let t=parseFloat(n.height);!isNaN(t)&&t>0&&(r=t)}}catch{}if(0===e||0===r)try{if(0===e){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(0===r){let e=parseFloat(t.getAttribute("height"));!isNaN(e)&&e>0&&(r=e)}}catch{}if((0===e||0===r)&&(t.naturalWidth||t.naturalHeight))try{0===e&&t.naturalWidth>0&&(e=t.naturalWidth),0===r&&t.naturalHeight>0&&(r=t.naturalHeight)}catch{}return{width:e,height:r}}async function De(t,e,r){let n=await async function(t,e=3){let r=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},n=r(),i=0;for(;i<e&&(!n||!n.body&&!n.documentElement);)await new Promise(t=>setTimeout(t,0)),n=r(),i++;return n&&(n.body||n.documentElement)?n:null}(t,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=function(t){let e=t.getBoundingClientRect(),r=0,n=0,i=0,o=0;try{let e=getComputedStyle(t);r=parseFloat(e.borderLeftWidth)||0,n=parseFloat(e.borderRightWidth)||0,i=parseFloat(e.borderTopWidth)||0,o=parseFloat(e.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(e.width-(r+n))),contentHeight:Math.max(0,Math.round(e.height-(i+o))),rect:e}}(t),s=r?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||"function"!=typeof s.toPng)throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c,u={...r,scale:1,clip:null},d=function(t,e,r){let n=t.defaultView,i=n?n.scrollX:0,o=n?n.scrollY:0,l=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,s=t.documentElement?t.documentElement.scrollLeft:0,c=t.documentElement?t.documentElement.scrollTop:0,u=0,d=0,f=0,h=0;try{let e=n&&t.body?n.getComputedStyle(t.body):null;e&&(u=(parseFloat(e.marginTop)||0)+(parseFloat(e.paddingTop)||0),d=(parseFloat(e.marginRight)||0)+(parseFloat(e.paddingRight)||0),f=(parseFloat(e.marginBottom)||0)+(parseFloat(e.paddingBottom)||0),h=(parseFloat(e.marginLeft)||0)+(parseFloat(e.paddingLeft)||0))}catch{}try{t.documentElement.setAttribute("data-sd-pinned","")}catch{}let m=t.createElement("style");return m.setAttribute("data-sd-iframe-pin",""),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${r}px !important;min-width: ${e}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${d}px ${f}px ${h}px !important;width: ${e}px !important;height: ${r}px !important;min-width: ${e}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(m),()=>{try{m.remove()}catch{}try{t.documentElement.removeAttribute("data-sd-pinned")}catch{}try{n&&"function"==typeof n.scrollTo&&n.scrollTo(i,o),t.body&&(t.body.scrollLeft=l,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=s,t.documentElement.scrollTop=c)}catch{}}}(n,i,o),f=l.session.nodeMap,h=l.session.styleMap,m=l.session.styleCache;try{c=await s.toPng(n.documentElement,u)}finally{d(),l.session.nodeMap=f,l.session.styleMap=h,l.session.styleCache=m}c.style.display="block",c.style.width=`${i}px`,c.style.height=`${o}px`;let p=document.createElement("div");return e.nodeMap.set(p,t),ke(t,p,e,r),p.style.overflow="hidden",p.style.display="block",p.style.width||(p.style.width=`${Math.round(a.width)}px`),p.style.height||(p.style.height=`${Math.round(a.height)}px`),p.appendChild(c),p}async function He(t){if(l.resource?.has(t))return l.resource.get(t);if(nt.has(t))return nt.get(t);let e=(async()=>{let e=await Qt(t,{as:"dataURL",silent:!0});if(!e.ok||"string"!=typeof e.data)throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return l.resource?.set(t,e.data),e.data})();nt.set(t,e);try{let r=await e;return nt.set(t,r),r}catch(r){throw nt.delete(t),r}}async function je(t){if(!t||-1===t.indexOf("blob:"))return t;let e=Array.from(new Set(t.match(it)||[]));if(0===e.length)return t;let r=t;for(let n of e)try{let t=await He(n);r=r.split(n).join(t)}catch{}return r}function Ue(t){return"string"==typeof t&&t.startsWith("blob:")}function Be(t){return(t||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let e=t.match(/^(\S+)(\s+.+)?$/);return e?{url:e[1],desc:e[2]||""}:null}).filter(Boolean)}function Ve(t){return t.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function qe(t,e){let r=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&r.unshift(t),r}function ze(t,e){ot.set(String(t).toUpperCase(),e)}function Xe(t){let{width:e,height:r}=Oe(t),n=e,i=r;if(!n||!i){let e=t.getBoundingClientRect();n=n||e.width||0,i=i||e.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${n}px;height:${i}px;visibility:hidden;`,o}function Ye(t,e){return t.right>=e.left-at&&t.left<=e.right+at&&t.bottom>=e.top-at&&t.top<=e.bottom+at}async function Ge(t,e,r){if(!t)throw new Error("Invalid node");let n,i=new Set,o=null,l=null;if(t.nodeType===Node.ELEMENT_NODE){let r=(t.localName||t.tagName||"").toLowerCase();if("snapdom-sandbox"===t.id||t.hasAttribute("data-snapdom-sandbox")||p.has(r))return null;if("foreignobject"===r&&t.parentElement?.closest?.("foreignObject"))return ae(e,"Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)"),null;if("source"===r&&"picture"===t.parentElement?.localName)return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if("exclude"===t.getAttribute("data-capture")){if("hide"===r.excludeMode)return Xe(t);if("remove"===r.excludeMode)return null}if(r.exclude&&Array.isArray(r.exclude))for(let h of r.exclude)try{if(t.matches?.(h)){if("hide"===r.excludeMode)return Xe(t);if("remove"===r.excludeMode)return null}}catch(u){console.warn(`Invalid selector in exclude option: ${h}`,u)}if("function"==typeof r.filter)try{if(!r.filter(t)){if("hide"===r.filterMode)return Xe(t);if("remove"===r.filterMode)return null}}catch(d){console.warn("Error in filter function:",d)}if(e.clip&&function(t,e){if(t===e.root)return!1;let r;try{r=t.getBoundingClientRect()}catch{return!1}if(0===r.width&&0===r.height)return!1;let n=re(t);if("inline"===n.display&&!st.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,l=t.scrollHeight||0,a={left:"rtl"===n.direction?Math.min(r.left,r.right-o):r.left,top:r.top,right:Math.max(r.right,r.left+o),bottom:Math.max(r.bottom,r.top+l)},s=n.writingMode||"";if((s.startsWith("vertical")||s.startsWith("sideways"))&&(a.top=Math.min(r.top,r.bottom-l),a.left=Math.min(a.left,r.right-o)),Ye(a,i))return!1;let c=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;c.nextNode();){let t=c.currentNode.getBoundingClientRect();if((t.width>0||t.height>0)&&Ye(t,i))return!1}return!0}(t,e.clip))return function(t,e,r){let n=t.cloneNode(!1);"IMG"===t.tagName&&(n.removeAttribute("src"),n.removeAttribute("srcset"),n.removeAttribute("sizes")),ke(t,n,e,r);let{width:i,height:o}=Oe(t);return i>0&&(n.style.width=`${i}px`,n.style.minWidth=`${i}px`,n.style.maxWidth=`${i}px`),o>0&&(n.style.height=`${o}px`,n.style.minHeight=`${o}px`,n.style.maxHeight=`${o}px`),n.style.visibility="hidden",n.style.overflow="hidden",n.style.boxSizing="border-box",n}(t,e,r);if(r.__resolveNodeHooks)for(let h of r.__resolveNodeHooks){let n;try{n=await h(t,r)}catch(f){ae(e,"resolveNode plugin hook failed",f)}if(null===n)return null;if(n instanceof Node)return n.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(n,t),ke(t,n,e,r)),n}{let n=lt.has(t.tagName)&&ot.get(t.tagName);if(n){let i=await n(t,e,r);if(void 0!==i)return i}}if("placeholder"===t.getAttribute("data-capture")){let n=t.cloneNode(!1);e.nodeMap.set(n,t),ke(t,n,e,r);let i=document.createElement("div");return i.textContent=t.getAttribute("data-placeholder-text")||"",i.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",n.appendChild(i),n}{let n=!lt.has(t.tagName)&&ot.get(t.tagName);if(n){let i=await n(t,e,r);if(void 0!==i)return i}}try{if(n=t.cloneNode(!1),n.attributes?.length)try{for(let t of n.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(t.value)&&n.setAttribute(t.name,t.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Fe(t,n),e.nodeMap.set(n,t),"IMG"===t.tagName){!function(t,e){try{let r=null,n=re(t).content;if(n&&n.includes("url(")){let t=n.match(/url\(["']?([^"')]+)["']?\)/);t&&(r=t[1])}let i=t.closest?.("picture"),o=r||(i?Le(t,i):t.currentSrc)||t.src||Re(t.getAttribute("srcset"),t)||"";if(!o)return;e.setAttribute("src",o),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}(t,n);try{let{width:e,height:r}=Oe(t),i=Math.round(e||0),o=Math.round(r||0);i&&(n.dataset.snapdomWidth=String(i)),o&&(n.dataset.snapdomHeight=String(o))}catch(d){ae(e,"getUnscaledDimensions for IMG failed",d)}try{let e=t.getAttribute("style")||"",r=window.getComputedStyle(t),i=t=>{let n=e.match(new RegExp(`${t}\\s*:\\s*([^;]+)`,"i")),i=n?n[1].trim():r.getPropertyValue(t);return/%|auto/i.test(String(i||""))},o=parseInt(n.dataset.snapdomWidth||"0",10),l=parseInt(n.dataset.snapdomHeight||"0",10),a=i("width")||!o,s=i("height")||!l;a&&o&&(n.style.width=`${o}px`),s&&l&&(n.style.height=`${l}px`);let c=r.getPropertyValue("object-fit"),u=r.getPropertyValue("object-position");c&&"fill"!==c?(n.style.objectFit=c,u&&(n.style.objectPosition=u)):(o&&(n.style.minWidth=`${o}px`),l&&(n.style.minHeight=`${l}px`))}catch(d){ae(e,"IMG dimension freeze failed",d)}}}catch(d){throw console.error("[Snapdom] Failed to clone node:",t,d),d}let a=null;if(t instanceof HTMLTextAreaElement){let{width:e,height:r}=Oe(t),i=e||t.getBoundingClientRect().width||0,o=r||t.getBoundingClientRect().height||0;i&&(n.style.width=`${i}px`),o&&(n.style.height=`${o}px`)}if(t instanceof HTMLInputElement){let r=(t.type||"text").toLowerCase();if("checkbox"!==r&&"radio"!==r||!function(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}())n.value=t.value,n.setAttribute("value",t.value),void 0!==t.checked&&(n.checked=t.checked,t.checked&&n.setAttribute("checked",""),t.indeterminate&&(n.indeterminate=t.indeterminate));else{let{el:r,applyVisual:i}=function(t){let e,{width:r,height:n}=Oe(t),i=t.getBoundingClientRect();try{e=window.getComputedStyle(t)}catch{}let o=e?parseFloat(e.width):NaN,l=e?parseFloat(e.height):NaN,a=Math.round(r||i.width||0),s=Math.round(n||i.height||0),c=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),u=Number.isFinite(l)&&l>0?Math.round(l):Math.max(12,s||16),d="checkbox"===(t.type||"text").toLowerCase(),f=!!t.checked,h=!!t.indeterminate,m=Math.max(Math.min(c,u),12),p="middle";try{e&&e.verticalAlign&&(p=e.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),g.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${p};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");function b(){let t="#0a6ed1";try{e&&(t=e.accentColor||e.color||t)}catch{}let r=m-2;if(y.innerHTML="",d){let e=document.createElementNS("http://www.w3.org/2000/svg","rect");if(e.setAttribute("x",String(1)),e.setAttribute("y",String(1)),e.setAttribute("width",String(r)),e.setAttribute("height",String(r)),e.setAttribute("rx","2"),e.setAttribute("ry","2"),e.setAttribute("fill",f?t:"none"),e.setAttribute("stroke",t),e.setAttribute("stroke-width",String(2)),y.appendChild(e),f){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",`M 3 ${m/2} L ${m/2-1} ${m-1-2} L ${m-1-2} 3`),t.setAttribute("stroke","white"),t.setAttribute("stroke-width",String(Math.max(1.5,2))),t.setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),y.appendChild(t)}else if(h){let e=document.createElementNS("http://www.w3.org/2000/svg","rect"),n=Math.max(6,r-4);e.setAttribute("x",String((m-n)/2)),e.setAttribute("y",String((m-2)/2)),e.setAttribute("width",String(n)),e.setAttribute("height",String(2)),e.setAttribute("fill",t),e.setAttribute("rx","1"),y.appendChild(e)}}else{let e=document.createElementNS("http://www.w3.org/2000/svg","circle");if(e.setAttribute("cx",String(m/2)),e.setAttribute("cy",String(m/2)),e.setAttribute("r",String((m-2)/2)),e.setAttribute("fill",f?t:"none"),e.setAttribute("stroke",t),e.setAttribute("stroke-width",String(2)),y.appendChild(e),f){let t=document.createElementNS("http://www.w3.org/2000/svg","circle"),e=Math.max(2,.35*(m-4));t.setAttribute("cx",String(m/2)),t.setAttribute("cy",String(m/2)),t.setAttribute("r",String(e)),t.setAttribute("fill","white"),y.appendChild(t)}}g.style.setProperty("width",`${m}px`,"important"),g.style.setProperty("height",`${m}px`,"important"),g.style.setProperty("min-width",`${m}px`,"important"),g.style.setProperty("min-height",`${m}px`,"important")}return y.setAttribute("width",String(m)),y.setAttribute("height",String(m)),y.setAttribute("viewBox",`0 0 ${m} ${m}`),g.appendChild(y),b(),{el:g,applyVisual:b}}(t);e.nodeMap.set(r,t),a=i,n=r}}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let e=window.getComputedStyle(t,"::placeholder"),r=e&&e.color;if(r&&"rgba(0, 0, 0, 0)"!==r){let t="snapdom-ph-"+(1e6*Math.random()|0);n.classList.add(t);let i=document.createElement("style");i.textContent=`.${t}::placeholder{color:${r}!important;opacity:${e.opacity||"1"}!important;-webkit-text-fill-color:${r}!important;}`,n.prepend(i)}}catch{}if(t instanceof HTMLSelectElement&&(o=t.value),t instanceof HTMLTextAreaElement&&(l=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&n.setAttribute("disabled",""),t.required&&n.setAttribute("required",""),t.readOnly&&n.setAttribute("readonly","");let e=t;void 0!==e.min&&""!==e.min&&n.setAttribute("min",e.min),void 0!==e.max&&""!==e.max&&n.setAttribute("max",e.max),void 0!==e.pattern&&""!==e.pattern&&n.setAttribute("pattern",e.pattern);let r=t.getAttribute("aria-invalid");null!==r&&n.setAttribute("aria-invalid",r)}if(Ee(t)||ke(t,n,e,r),a&&a(),t instanceof SVGElement&&!Ee(t)){let e=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let r=window.getComputedStyle(t);for(let t of e){let e=r.getPropertyValue(t);e&&n.style.setProperty(t,e)}}catch{}}if(t.shadowRoot){let o=function(t,n){if(t.nodeType===Node.ELEMENT_NODE&&"STYLE"===t.tagName)return n(null);Ge(t,e,r).then(t=>{n(t||null)}).catch(()=>{n(null)})};var s=o;try{let e=t.shadowRoot.querySelectorAll("slot");for(let t of e){let e=[];try{e=t.assignedNodes?.({flatten:!0})||t.assignedNodes?.()||[]}catch{e=t.assignedNodes?.()||[]}for(let t of e)i.add(t)}}catch{}let l=function(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}(e),a=`[data-sd="${l}"]`;try{n.setAttribute("data-sd",l)}catch{}let c=function(t){let e="";try{t.querySelectorAll("style").forEach(t=>{e+=(t.textContent||"")+"\n"});let r=t.adoptedStyleSheets||[];for(let t of r)try{if(t&&t.cssRules)for(let r of t.cssRules)e+=r.cssText+"\n"}catch{}}catch{}return e}(t.shadowRoot),u=Ie(c,a),d=function(t,e,r){let n=[];for(let i of e){let e=_e(t,i);e&&n.push(`${i}: ${e};`)}return n.length?`${r}{${n.join("")}}\n`:""}(t,function(t){let e=new Set;if(!t)return e;let r,n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;for(;r=n.exec(t);)e.add(r[1]);return e}(c),a);!function(t,e,r){if(!e)return;let n=document.createElement("style");n.setAttribute("data-sd",r),n.textContent=e,t.insertBefore(n,t.firstChild||null)}(n,d+u,l);let f=document.createDocumentFragment(),h=await We(Array.from(t.shadowRoot.childNodes),o,r.fast);f.append(...h.filter(t=>!!t)),n.appendChild(f)}if("SLOT"===t.tagName){let n=function(t,n){Ge(t,e,r).then(t=>{t&&function(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}(t),n(t||null)}).catch(()=>{n(null)})};s=n;let i=t.assignedNodes?.({flatten:!0})||[],o=i.length>0?i:Array.from(t.childNodes),l=document.createDocumentFragment(),a=await We(Array.from(o),n,r.fast);return l.append(...a.filter(t=>!!t)),l}function s(t,n){if(i.has(t))return n(null);Ge(t,e,r).then(t=>{n(t||null)}).catch(()=>{n(null)})}let c=await We(Array.from(t.childNodes),s,r.fast);if(n.append(...c.filter(t=>!!t)),null!==o&&n instanceof HTMLSelectElement){n.value=o;for(let t of n.options)t.value===o?t.setAttribute("selected",""):t.removeAttribute("selected")}return null!==l&&n instanceof HTMLTextAreaElement&&(n.textContent=l),n}async function Qe(t,e,r){let n=!1;try{n=!(!t.contentDocument&&!t.contentWindow?.document)}catch(i){ae(e,"iframe same-origin probe failed",i)}if(n)try{return await De(t,e,r)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(n||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),r.placeholders){let{width:n,height:i}=Oe(t),o=document.createElement("div");return o.style.cssText=`width:${n}px;height:${i}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;`,ke(t,o,e,r),o}{let{width:n,height:i}=Oe(t),o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${n}px;height:${i}px;visibility:hidden;`,ke(t,o,e,r),o}}async function Je(t,e,r){let n="";try{let e=t.getContext("2d",{willReadFrequently:!0});try{e&&e.getImageData(0,0,1,1)}catch{}if(le()&&await new Promise(t=>requestAnimationFrame(t)),n=t.toDataURL("image/png"),!n||"data:,"===n){try{e&&e.getImageData(0,0,1,1)}catch{}if(await new Promise(t=>requestAnimationFrame(t)),n=t.toDataURL("image/png"),!n||"data:,"===n){let e=document.createElement("canvas");e.width=t.width,e.height=t.height;let r=e.getContext("2d");r&&(r.drawImage(t,0,0),n=e.toDataURL("image/png"))}}}catch(a){ae(e,"Canvas toDataURL failed, using empty/fallback",a)}let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){ae(e,"img decoding/loading hints failed",a)}n&&(i.src=n),i.width=t.width,i.height=t.height;let{width:o,height:l}=Oe(t);return o>0&&(i.style.width=`${o}px`),l>0&&(i.style.height=`${l}px`),e.nodeMap.set(i,t),ke(t,i,e,r),i}async function Ke(t,e,r){let n="";try{let e=document.createElement("canvas");e.width=t.videoWidth||t.offsetWidth||320,e.height=t.videoHeight||t.offsetHeight||240;let r=e.getContext("2d");r&&(r.drawImage(t,0,0,e.width,e.height),n=e.toDataURL("image/png"),(!n||"data:,"===n)&&(n=""))}catch(a){ae(e,"Video frame capture failed, using poster fallback",a)}let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch{}n?i.src=n:t.poster&&(i.src=t.poster),i.width=t.videoWidth||t.offsetWidth||0,i.height=t.videoHeight||t.offsetHeight||0;let{width:o,height:l}=Oe(t);return o>0&&(i.style.width=`${o}px`),l>0&&(i.style.height=`${l}px`),i.style.objectFit="contain",e.nodeMap.set(i,t),ke(t,i,e,r),i}async function Ze(t,e,r){if(!t.controls)return;let{width:n,height:i}=Oe(t),o=Math.round(n||t.offsetWidth||300),l=Math.round(i||t.offsetHeight||54),a=l/2,s=Math.max(4,.16*l),c=.34*l,u=o-.34*l,d=c+s+.55*l,f=Math.max(0,u-.7*l-d),h=Math.max(9,Math.round(.24*l)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${l}" viewBox="0 0 ${o} ${l}"><rect width="${o}" height="${l}" rx="${Math.min(l/2,10)}" fill="#f1f3f4"/><path d="M ${c} ${a-s} L ${c+s} ${a} L ${c} ${a+s} Z" fill="#5f6368"/><rect x="${d}" y="${a-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${a}" r="${Math.max(3,.09*l)}" fill="#5f6368"/><text x="${u}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,p=document.createElement("img");try{p.decoding="sync",p.loading="eager"}catch{}return p.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,p.width=o,p.height=l,p.style.width=`${o}px`,p.style.height=`${l}px`,e.nodeMap.set(p,t),ke(t,p,e,r),p}function tr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function er(t){let e="string"==typeof t?t:"",r=[...ct,...dt];for(let n of r)if(n instanceof RegExp&&n.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function rr(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}function nr(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!r&&"currentcolor"!==e.toLowerCase())return e;let n=t.color?.trim();return n&&"inherit"!==n?n:"#000"}async function ir(t,{family:e="Material Icons",weight:r="normal",fontSize:n=32,color:i="#000",variation:o="",className:l=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),s=window.devicePixelRatio||1,{familyForMeasure:c,familyForCanvas:u}=await async function(t,e,r){let n=String(t||""),i=n.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};let l=r&&(r.FILL??r.fill),a="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?a="rounded":/\bsharp\b/.test(o)?a="sharp":/\boutlined\b/.test(o)&&(a="outlined");let s=null;if(1===l&&("outlined"===a&&ut.materialIconsFilled?s={url:ut.materialIconsFilled,alias:"snapdom-mi-filled"}:"rounded"===a&&ut.materialIconsRound?s={url:ut.materialIconsRound,alias:"snapdom-mi-round"}:"sharp"===a&&ut.materialIconsSharp&&(s={url:ut.materialIconsSharp,alias:"snapdom-mi-sharp"})),!s)return{familyForMeasure:n,familyForCanvas:n};if(!ht.has(s.alias))try{let t=new FontFace(s.alias,`url(${s.url})`,{style:"normal",weight:"400"});document.fonts.add(t),await t.load(),ht.set(s.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let c=`"${s.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}(a,l,function(t=""){let e,r=Object.create(null),n=String(t||""),i=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g;for(;e=i.exec(n);)r[e[1].toUpperCase()]=Number(e[2]);return r}(o));await async function(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}(u.replace(/^["']+|["']+$/g,""),n);let d=document.createElement("span");d.setAttribute("data-snapdom-internal",""),d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=c,d.style.fontWeight=String(r||"normal"),d.style.fontSize=`${n}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let f=d.getBoundingClientRect(),h=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(d);let p=document.createElement("canvas");p.width=h*s,p.height=m*s;let g=p.getContext("2d");g.scale(s,s),g.font=`${r?`${r} `:""}${n}px ${u}`,g.textAlign="left",g.textBaseline="top",g.fillStyle=i;try{g.fontKerning="normal"}catch{}return g.fillText(t,0,0),{dataUrl:p.toDataURL(),width:h,height:m}}async function or(t,e,r,n=32,i="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let l=document.createElement("span");l.setAttribute("data-snapdom-internal",""),l.textContent=t,l.style.position="absolute",l.style.visibility="hidden",l.style.fontFamily=`"${e}"`,l.style.fontWeight=r||"normal",l.style.fontSize=`${n}px`,l.style.lineHeight="1",l.style.whiteSpace="nowrap",l.style.padding="0",l.style.margin="0",document.body.appendChild(l);let a=l.getBoundingClientRect(),s=Math.ceil(a.width),c=Math.ceil(a.height);document.body.removeChild(l);let u=document.createElement("canvas");u.width=Math.max(1,s*o),u.height=Math.max(1,c*o);let d=u.getContext("2d");return d.scale(o,o),d.font=r?`${r} ${n}px "${e}"`:`${n}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:u.toDataURL(),width:s,height:c}}function lr(t){if(!t)return"";for(let e of t.split(",")){let t=e.trim().replace(/^['"]+|['"]+$/g,"");if(t&&!mt.has(t.toLowerCase()))return t}return""}function ar(t){let e=String(t??"400").trim().toLowerCase();if("normal"===e)return 400;if("bold"===e)return 700;let r=parseInt(e,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function sr(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function cr(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function ur(t){return t&&"string"==typeof t?t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-"):""}function dr(t,e,r=[]){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let i=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(t=>i.endsWith(t))||r.some(t=>i===t.toLowerCase()||i.endsWith("."+t.toLowerCase())))return!0;let o=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||pt.some(t=>o.includes(t)))return!0;for(let t of e){let e=t.toLowerCase().replace(/\s+/g,"+"),r=t.toLowerCase().replace(/\s+/g,"-"),n=ur(t);if(o.includes(e)||o.includes(r)||n&&o.includes(n))return!0}return!1}catch{return!1}}function fr(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(t,r,n)=>{let i=(n||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return t;let o=i;try{o=new URL(i,e||location.href).href}catch{}return`url("${o}")`})}async function hr(t,e,r){if(!t)return t;let n=new Set;function i(t,e){try{return new URL(t,e||location.href).href}catch{return t}}let o=fr(t,e||location.href);return o=await async function t(e,o,l=0){if(l>yt)return console.warn(`[snapDOM] @import depth exceeded (${yt}) at ${o}`),e;let a,s="",c=0;for(;a=gt.exec(e);){s+=e.slice(c,a.index),c=gt.lastIndex;let u=i((a[2]||a[4]||"").trim(),o);if(n.has(u)){console.warn(`[snapDOM] Skipping circular @import: ${u}`);continue}n.add(u);let d="";try{let t=await Qt(u,{as:"text",useProxy:r,silent:!0});t.ok&&"string"==typeof t.data&&(d=t.data)}catch{}d?(d=fr(d,u),d=await t(d,u,l+1),s+=`\n/* inlined: ${u} */\n${d}\n`):s+=a[0]}return s+=e.slice(c),s}(o,e||location.href,0),o}function mr(t,e,r=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||r).trim()}function pr(t){if(!t)return[];let e=[],r=t.split(",").map(t=>t.trim()).filter(Boolean);for(let n of r){let t=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!t)continue;let r=t[1],i=t[2],o=t=>t.includes("?")?[parseInt(t.replace(/\?/g,"0"),16),parseInt(t.replace(/\?/g,"F"),16)]:parseInt(t,16);if(i){let t=o(r),n=o(i),l=Array.isArray(t)?t[0]:t,a=Array.isArray(n)?n[1]:n;e.push([Math.min(l,a),Math.max(l,a)])}else{let t=o(r);Array.isArray(t)?e.push([t[0],t[1]]):e.push([t,t])}}return e}function gr(t,e){if(!e.length||!t||0===t.size)return!0;for(let r of t)for(let[t,n]of e)if(r>=t&&r<=n)return!0;return!1}function yr(t,e){let r=[];if(!t)return r;for(let n of t.matchAll(bt)){let t=(n[2]||"").trim();if(t&&!t.startsWith("data:")){if(!/^https?:/i.test(t))try{t=new URL(t,e||location.href).href}catch{}r.push(t)}}return r}async function br(t,e,r=""){let n=t;for(let i of t.matchAll(bt)){let t=qt(i[0]);if(!t)continue;let o=t;if(!o.startsWith("http")&&!o.startsWith("data:"))try{o=new URL(o,e||location.href).href}catch{}if(!er(o)){if(l.resource?.has(o)){l.font?.add(o),n=n.replace(i[0],`url(${l.resource.get(o)})`);continue}try{let t=await Qt(o,{as:"dataURL",useProxy:r,silent:!0});if(t.ok&&"string"==typeof t.data){let e=t.data;l.resource?.set(o,e),l.font?.add(o),n=n.replace(i[0],`url(${e})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",o)}}}return n}function wr(t={}){let e=new Set((t.families||[]).map(t=>String(t).toLowerCase())),r=new Set((t.domains||[]).map(t=>String(t).toLowerCase())),n=new Set((t.subsets||[]).map(t=>String(t).toLowerCase()));return(t,i)=>{if(e.size&&e.has(t.family.toLowerCase()))return!0;if(r.size)for(let e of t.srcUrls)try{if(r.has(new URL(e).host.toLowerCase()))return!0}catch{}if(n.size){let t=function(t){if(!t.length)return null;let e=(e,r)=>t.some(([t,n])=>!(n<e||t>r)),r=e(0,255)||e(305,305),n=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":n?"latin-ext":r?"latin":null}(i);if(t&&n.has(t))return!0}return!1}}function xr(t,e,r,n,i,o){return`fonts-embed-css::req=${Array.from(t||[]).sort().join("|")}::ex=${e?JSON.stringify({families:(e.families||[]).map(t=>String(t).toLowerCase()).sort(),domains:(e.domains||[]).map(t=>String(t).toLowerCase()).sort(),subsets:(e.subsets||[]).map(t=>String(t).toLowerCase()).sort()}):""}::lf=${(r||[]).map(t=>`${(t.family||"").toLowerCase()}::${t.weight||"normal"}::${t.style||"normal"}::${t.src||""}`).sort().join("|")}::px=${n||""}::fd=${(i||[]).map(t=>String(t).toLowerCase()).sort().join("|")}::doc=${function(t){let e=xt.get(t);return void 0===e&&(e=St++,xt.set(t,e)),e}(o||document)}`}async function Sr(t,e,r,n){let i;try{i=t.cssRules||[]}catch{return}let o=(t,e)=>{try{return new URL(t,e||location.href).href}catch{return t}};for(let l of i){if(l.type===CSSRule.IMPORT_RULE&&l.styleSheet){let t=l.href?o(l.href,e):e;if(n.depth>=yt){console.warn(`[snapDOM] CSSOM import depth exceeded (${yt}) at ${t}`);continue}if(t&&n.visitedSheets.has(t)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${t}`);continue}t&&n.visitedSheets.add(t);let i={...n,depth:(n.depth||0)+1};await Sr(l.styleSheet,t,r,i);continue}if(l.type===CSSRule.FONT_FACE_RULE){let t=lr((l.style.getPropertyValue("font-family")||"").trim());if(!t||er(t))continue;let i=(l.style.getPropertyValue("font-weight")||"400").trim(),o=(l.style.getPropertyValue("font-style")||"normal").trim(),a=(l.style.getPropertyValue("font-stretch")||"100%").trim(),s=(l.style.getPropertyValue("src")||"").trim(),c=(l.style.getPropertyValue("unicode-range")||"").trim();if(!n.faceMatchesRequired(t,o,i,a))continue;let u=pr(c);if(!gr(n.usedCodepoints,u))continue;let d={family:t,weightSpec:i,styleSpec:o,stretchSpec:a,unicodeRange:c,srcRaw:s,srcUrls:yr(s,e||location.href),href:e||location.href};if(n.simpleExcluder&&n.simpleExcluder(d,u))continue;/url\(/i.test(s)?await r(`@font-face{font-family:${t};src:${await br(s,e||location.href,n.useProxy)};font-style:${o};font-weight:${i};font-stretch:${a};${c?`unicode-range:${c};`:""}}`):await r(`@font-face{font-family:${t};src:${s};font-style:${o};font-weight:${i};font-stretch:${a};${c?`unicode-range:${c};`:""}}`)}}}async function vr({required:t,usedCodepoints:e,exclude:r,localFonts:n=[],useProxy:i="",fontStylesheetDomains:o=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let s=new Map;for(let l of t){let[t,e,r,n]=String(l).split("__");if(!t)continue;let i=t.toLowerCase(),o=s.get(i)||[];o.push({w:parseInt(e,10),s:r,st:parseInt(n,10)}),s.set(i,o)}function c(t,e,r,n){let i=String(t).toLowerCase();if(!s.has(i))return!1;let o=s.get(i),l=function(t){let e=String(t||"400").trim(),r=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let t=ar(r[1]),e=ar(r[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}let n=ar(e);return{min:n,max:n}}(r),a=function(t){let e=String(t||"normal").trim().toLowerCase();return"italic"===e?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}(e),c=function(t){let e=String(t||"100%").trim(),r=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let t=parseFloat(r[1]),e=parseFloat(r[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}let n=e.match(/(\d+(?:\.\d+)?)\s*%/),i=n?parseFloat(n[1]):100;return{min:i,max:i}}(n),u=l.min!==l.max,d=l.min,f=t=>"normal"===a.kind&&"normal"===t||"normal"!==a.kind&&("italic"===t||"oblique"===t),h=!1;for(let s of o){let t=u?s.w>=l.min&&s.w<=l.max:s.w===d,e=f(sr(s.s)),r=s.st>=c.min&&s.st<=c.max;if(t&&e&&r){h=!0;break}}if(h)return!0;if(!u)for(let s of o){let t=f(sr(s.s)),e=s.st>=c.min&&s.st<=c.max;if(Math.abs(d-s.w)<=300&&t&&e)return!0}if(!u&&"normal"===a.kind&&o.some(t=>"normal"!==sr(t.s)))for(let s of o){let t=Math.abs(d-s.w)<=300,e=s.st>=c.min&&s.st<=c.max;if(t&&e)return!0}return!1}let u=wr(r),d=xr(t,r,n,i,o,a);if(l.resource?.has(d))return l.resource.get(d);let f=function(t){let e=new Set;for(let r of t||[]){let t=String(r).split("__")[0]?.trim();t&&e.add(t)}return e}(t),h=[],m=gt;for(let l of a.querySelectorAll("style")){let t=l.textContent||"";for(let e of t.matchAll(m)){let t=(e[2]||e[4]||"").trim();t&&!er(t)&&(a.querySelector(`link[rel="stylesheet"][href="${t}"]`)||h.push(t))}}let p=[];h.length&&await Promise.all(h.map(t=>new Promise(e=>{if(a.querySelector(`link[rel="stylesheet"][href="${t}"]`))return e(null);let r=a.createElement("link");r.rel="stylesheet",r.href=t,r.setAttribute("data-snapdom","injected-import"),r.onload=()=>e(r),r.onerror=()=>e(null),a.head.appendChild(r),p.push(r)})));let g="",y=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(t=>!!t.href);for(let l of p)try{l.remove()}catch{}for(let l of y)try{if(er(l.href))continue;let t="",n=!1;try{n=new URL(l.href,location.href).origin===location.origin}catch{}if(!n){let t=Array.isArray(o)?o:[];if(!dr(l.href,f,t))continue}if(n){let e=Array.from(a.styleSheets).find(t=>t.href===l.href);if(e)try{let r=e.cssRules||[];t=Array.from(r).map(t=>t.cssText).join("")}catch{}}if(!t){let e=await Qt(l.href,{as:"text",useProxy:i});if(e?.ok&&"string"==typeof e.data&&(t=e.data),er(l.href))continue}t=await hr(t,l.href,i);let s="";for(let o of t.match(wt)||[]){let t=lr(mr(o,"font-family"));if(!t||er(t))continue;let n=mr(o,"font-weight","400"),a=mr(o,"font-style","normal"),d=mr(o,"font-stretch","100%"),f=mr(o,"unicode-range"),h=mr(o,"src"),m=yr(h,l.href);if(!c(t,a,n,d))continue;let p=pr(f);if(!gr(e,p))continue;let g={family:t,weightSpec:n,styleSpec:a,stretchSpec:d,unicodeRange:f,srcRaw:h,srcUrls:m,href:l.href};r&&u(g,p)||(s+=/url\(/i.test(h)?await br(o,l.href,i):o)}s.trim()&&(g+=s)}catch{console.warn("[snapDOM] Failed to process stylesheet:",l.href)}let b={requiredIndex:s,usedCodepoints:e,faceMatchesRequired:c,simpleExcluder:r?wr(r):null,useProxy:i,visitedSheets:new Set,depth:0};for(let l of a.styleSheets)if(!l.href||!y.some(t=>t.href===l.href))try{let t=l.href||location.origin+"/";t&&b.visitedSheets.add(t),await Sr(l,t,async t=>{g+=t},b)}catch{}try{for(let t of a.fonts||[]){if(!t||!t.family||"loaded"!==t.status||!t._snapdomSrc)continue;let e=String(t.family).replace(/^['"]+|['"]+$/g,"");if(er(e)||!s.has(e.toLowerCase())||r?.families&&r.families.some(t=>String(t).toLowerCase()===e.toLowerCase()))continue;let n=t._snapdomSrc;if(!String(n).startsWith("data:"))if(l.resource?.has(t._snapdomSrc))n=l.resource.get(t._snapdomSrc),l.font?.add(t._snapdomSrc);else if(!l.font?.has(t._snapdomSrc))try{let e=await Qt(t._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(!e.ok||"string"!=typeof e.data)continue;n=e.data,l.resource?.set(t._snapdomSrc,n),l.font?.add(t._snapdomSrc)}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",t._snapdomSrc);continue}g+=`@font-face{font-family:'${e}';src:url(${n});font-style:${t.style||"normal"};font-weight:${t.weight||"normal"};}`}}catch{}for(let w of n){if(!w||"object"!=typeof w)continue;let t=String(w.family||"").replace(/^['"]+|['"]+$/g,"");if(!t||er(t)||!s.has(t.toLowerCase())||r?.families&&r.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let e=null!=w.weight?String(w.weight):"normal",n=null!=w.style?String(w.style):"normal",o=null!=w.stretchPct?`${w.stretchPct}%`:"100%",a=String(w.src||""),c=a;if(!c.startsWith("data:"))if(l.resource?.has(a))c=l.resource.get(a),l.font?.add(a);else if(!l.font?.has(a))try{let t=await Qt(a,{as:"dataURL",useProxy:i,silent:!0});if(!t.ok||"string"!=typeof t.data)continue;c=t.data,l.resource?.set(a,c),l.font?.add(a)}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",a);continue}g+=`@font-face{font-family:'${t}';src:url(${c});font-style:${n};font-weight:${e};font-stretch:${o};}`}return g&&(g=function(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let o of t.match(e)||[]){let t=lr(mr(o,"font-family")),e=mr(o,"font-weight","400"),i=mr(o,"font-style","normal"),l=mr(o,"font-stretch","100%"),a=mr(o,"unicode-range"),s=mr(o,"src"),c=yr(s,location.href),u=c.length?c.map(t=>String(t).toLowerCase()).sort().join("|"):s.toLowerCase(),d=[String(t||"").toLowerCase(),e,i,l,a.toLowerCase(),u].join("|");r.has(d)||(r.add(d),n.push(o))}if(0===n.length)return t;let i=0;return t.replace(e,()=>n[i++]||"")}(g),l.resource?.set(d,g)),g}function Cr(t,e){let r=new Set,n=new Set;if(!t)return{required:r,usedCodepoints:n};let i=t=>{if(t)for(let e of t)n.add(e.codePointAt(0))},o=t=>{let e=function(t){if(!t)return[];let e=[];for(let r of t.split(",")){let t=r.trim().replace(/^['"]+|['"]+$/g,"");t&&(mt.has(t.toLowerCase())||e.push(t))}return e}(t.fontFamily);if(e.length)for(let n of e)r.add(`${n}__${ar(t.fontWeight)}__${sr(t.fontStyle)}__${cr(t.fontStretch)}`)},l=t=>{o(re(t));for(let e of["::before","::after"]){let r=re(t,e),l=r&&r.content;if(l&&"none"!==l&&"normal"!==l)if(o(r),/^["']/.test(l))i(l.slice(1,-1));else{let t=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(t)for(let e of t)try{n.add(parseInt(e.slice(1),16))}catch{}}}};l(t);let a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;a.nextNode();){let t=a.currentNode;if(t.nodeType===Node.TEXT_NODE){if(e&&t.parentElement&&!e(t.parentElement))continue;i(t.nodeValue||"")}else{if(e&&!e(t))continue;l(t)}}return{required:r,usedCodepoints:n}}async function Mr(t,e=2,r=document){try{await r.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(0===n.length)return;let i=()=>{let t=r.createElement("div");t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let e of n){let n=r.createElement("span");n.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",n.style.fontFamily=`"${e}"`,n.style.fontWeight="700",n.style.fontStyle="italic",n.style.fontSize="32px",n.style.lineHeight="1",n.style.whiteSpace="nowrap",n.style.margin="0",n.style.padding="0",t.appendChild(n)}r.body.appendChild(t),t.offsetWidth,r.body.removeChild(t)};for(let o=0;o<Math.max(1,e);o++)i(),await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t)))}function $r(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function kr(t,e=!1){let r="",n=Math.max(1,t);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return e?r.toUpperCase():r}function Ar(t,e=!0){let r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n=Math.max(1,Math.min(3999,t)),i="";for(let[o,l]of r)for(;n>=o;)i+=l,n-=o;return e?i:i.toLowerCase()}function Er(t,e){switch((e||"decimal").toLowerCase()){case"decimal":default:return String(t);case"decimal-leading-zero":{let e=Math.abs(t);return(t<0?"-":"")+(e<10?"0":"")+String(e)}case"lower-alpha":return kr(t,!1);case"upper-alpha":return kr(t,!0);case"lower-roman":return Ar(t,!1);case"upper-roman":return Ar(t,!0)}}function Fr(t){let e=new WeakMap,r=t instanceof Document?t.documentElement:t,n=t=>{let e=0,r=t?.parentElement;if(!r)return 0;for(let n of r.children){if(n===t)break;"LI"===n.tagName&&e++}return e},i=(t,e,r)=>{let i,o,l,a=(t=>{let e=new Map;for(let[r,n]of t)e.set(r,n.slice());return e})(t);try{i=r.style?.counterReset||getComputedStyle(r).counterReset}catch{}if(i&&"none"!==i)for(let n of i.split(",")){let t=n.trim().split(/\s+/),r=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!r)continue;let o=e.get(r);if(o&&o.length){let t=o.slice();t.push(i),a.set(r,t)}else a.set(r,[i])}try{o=r.style?.counterSet||getComputedStyle(r).counterSet}catch{}if(o&&"none"!==o)for(let n of o.split(",")){let t=n.trim().split(/\s+/),e=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!e)continue;let i=a.get(e)||[];0===i.length&&i.push(0),i[i.length-1]=r,a.set(e,i)}try{l=r.style?.counterIncrement||getComputedStyle(r).counterIncrement}catch{}if(l&&"none"!==l)for(let n of l.split(",")){let t=n.trim().split(/\s+/),e=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):1;if(!e)continue;let i=a.get(e)||[];0===i.length&&i.push(0),i[i.length-1]+=r,a.set(e,i)}try{if("list-item"===getComputedStyle(r).display&&(t=>t&&"LI"===t.tagName)(r)){let t=r.parentElement,e=1;if(t&&"OL"===t.tagName){let i=t.getAttribute("start"),o=Number.isFinite(Number(i))?Number(i):1,l=n(r),a=r.getAttribute("value");e=Number.isFinite(Number(a))?Number(a):o+l}else e=1+n(r);let i=a.get("list-item")||[];0===i.length&&i.push(0),i[i.length-1]=e,a.set("list-item",i)}}catch{}return a},o=(t,r,n)=>{let l=i(n,r,t);e.set(t,l);let a=l;for(let e of t.children)a=o(e,l,a);let s=new Map;for(let[e,i]of n){let t=i.length,r=a.get(e);s.set(e,r&&r.length?r.slice(0,t):i.slice())}for(let[e,i]of a)!s.has(e)&&i.length&&!r.has(e)&&s.set(e,i.slice(0,1));return s},l=new Map;return o(r,l,l),{get(t,r){let n=e.get(t)?.get(r);return n&&n.length?n[n.length-1]:0},getStack(t,r){let n=e.get(t)?.get(r);return n?n.slice():[]}}}function Nr(t,e,r){if(!t||"none"===t)return t;try{return t.replace(/\b(counter|counters)\s*\(([^)]+)\)/g,(t,n,i)=>{let o=String(i).split(",").map(t=>t.trim());if("counter"===n){let t=o[0]?.replace(/^["']|["']$/g,""),n=(o[1]||"decimal").toLowerCase();return Er(r.get(e,t),n)}{let t=o[0]?.replace(/^["']|["']$/g,""),n=o[1]?.replace(/^["']|["']$/g,"")??"",i=(o[2]||"decimal").toLowerCase(),l=r.getStack(e,t);return l.length?l.map(t=>Er(t,i)).join(n):""}})}catch{return"- "}}function Rr(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Lr(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${e.length}|`,n=0;for(let o=0;o<e.length;o++){let t=e[o];if("STYLE"===t.tagName){r+=`S${t.textContent?t.textContent.length:0}|`;let e=t.sheet,i=e?Rr(e):null;i&&(n+=i.length)}else{r+=`L${t.getAttribute("href")||""}|m:${t.getAttribute("media")||"all"}|`;let e=t.sheet,i=e?Rr(e):null;i&&(n+=i.length)}}let i=t.adoptedStyleSheets;return r+=`ass:${Array.isArray(i)?i.length:0}|tr:${n}`,r}function Pr(t,e,r){let n=Rr(t);if(!n)return!1;for(let i=0;i<n.length;i++){if(r.budget<=0)return!1;let t=n[i],o=t&&t.cssText?t.cssText:"";r.budget--;for(let r of e)if(o.includes(r))return!0;if(t&&t.cssRules&&t.cssRules.length)for(let n=0;n<t.cssRules.length&&r.budget>0;n++){let i=t.cssRules[n],o=i&&i.cssText?i.cssText:"";r.budget--;for(let t of e)if(o.includes(t))return!0}if(r.budget<=0)return!1}return!1}function Tr(t=document,e=Lr(t)){let r=vt.get(t);if(r&&r.fingerprint===e)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=t.querySelectorAll("style");for(let l=0;l<i.length;l++){let r=i[l].textContent||"";for(let i of n)if(r.includes(i))return vt.set(t,{fingerprint:e,result:!0}),!0}let o=t.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let r={budget:Ct};try{for(let i of o)if(Pr(i,n,r))return vt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let r=t.querySelectorAll('style,link[rel~="stylesheet"]'),i={budget:Ct};for(let o=0;o<r.length&&i.budget>0;o++){let l=r[o],a=null;if(l.tagName,a=l.sheet||null,a&&Pr(a,n,i))return vt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(vt.set(t,{fingerprint:e,result:!0}),!0):(vt.set(t,{fingerprint:e,result:!1}),!1)}function Wr(t){for(let e of["Top","Right","Bottom","Left"]){let r=parseFloat(t[`border${e}Width`])||0,n=t[`border${e}Style`];if(r>0&&n&&"none"!==n&&"hidden"!==n)return!0}return!1}function Ir(t){if(!t)return"";let e,r=[],n=/"([^"]*)"/g,i=0;for(;e=n.exec(t);){let o=t.slice(i,e.index).trim();o&&r.push(o),r.push(e[1]),i=n.lastIndex}let o=t.slice(i).trim();return o&&r.push(o),r.join("")}function _r(t,e,r){let n=t.parentElement,i=n&&r?r.get(n):null;return i?{get(t,r){let n=e.get(t,r),o=i.get(r);return"number"==typeof o?Math.max(n,o):n},getStack(t,r){let n=e.getStack(t,r);if(!n.length)return n;let o=i.get(r);if("number"==typeof o){let t=n.slice();return t[t.length-1]=Math.max(t[t.length-1],o),t}return n}}:e}function Or(t,e,r){let n=new Map;function i(t){let e=[];if(!t||"none"===t)return e;for(let r of String(t).split(",")){let t=r.trim().split(/\s+/),n=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):void 0;n&&e.push({name:n,num:i})}return e}let o=i(e?.counterReset),l=i(e?.counterSet),a=i(e?.counterIncrement);function s(e){if(n.has(e))return n.get(e).slice();let i=r.getStack(t,e);i=i.length?i.slice():[];let s=o.find(t=>t.name===e);if(s){let t=Number.isFinite(s.num)?s.num:0;i=i.length?[...i,t]:[t]}let c=l.find(t=>t.name===e);if(c){let t=Number.isFinite(c.num)?c.num:0;0===i.length&&(i=[0]),i[i.length-1]=t}let u=a.find(t=>t.name===e);if(u){let t=Number.isFinite(u.num)?u.num:1;0===i.length&&(i=[0]),i[i.length-1]+=t}return n.set(e,i.slice()),i}return{get(t,e){let r=s(e);return r.length?r[r.length-1]:0},getStack:(t,e)=>s(e),__incs:a}}function Dr(t,e,r,n){let i;try{i=re(t,e)}catch{}let o=i?.content;if(!o||"none"===o||"normal"===o)return{text:"",incs:[]};o=function(t){let e=!1;for(let r=0;r<t.length;r++){let n=t[r];if('"'===n)e=!e;else if("/"===n&&!e)return t.slice(0,r).trim()}return t}(o);let l=Or(t,i,_r(t,r,n));return{text:Ir($r(o)?Nr(o,t,l):o),incs:l.__incs||[]}}async function Hr(t,e,r,n){if(1!==t?.nodeType||1!==e?.nodeType||"TEXTAREA"===t.tagName)return;if(!function(t,e){let r=Lr(t);return e?(e.__pseudoPreflightFp!==r&&(e.__pseudoPreflight=Tr(t,r),e.__pseudoPreflightFp=r),!!e.__pseudoPreflight):Tr(t,r)}(t.ownerDocument||document,r))return;r.__siblingCounters||(r.__siblingCounters=new WeakMap),r.__counterCtx||(r.__counterCtx=function(t,e){let r=null,n=()=>{if(!r)try{r=Fr(t)}catch(n){ae(e,"buildCounterContext failed",n),r={get:()=>0,getStack:()=>[]}}return r};return{get:(t,e)=>n().get(t,e),getStack:(t,e)=>n().getStack(t,e)}}(t.ownerDocument||document,r));let i=r.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let o=re(t,c);if(!o||"none"===o.content&&"none"===o.backgroundImage&&"transparent"===o.backgroundColor&&!Wr(o)&&(!o.transform||"none"===o.transform)&&"inline"===o.display)continue;if("::first-letter"===c){let n=re(t),i=(n?.display||"").toLowerCase();if(i.includes("flex")||i.includes("grid"))continue;let l=t=>o[t]!==n[t]&&0!==(parseFloat(o[t])||0);if(!(o.color!==n.color||o.fontSize!==n.fontSize||o.fontWeight!==n.fontWeight||o.fontFamily!==n.fontFamily||o.fontStyle!==n.fontStyle||o.textTransform!==n.textTransform||o.float!==n.float&&"none"!==o.float||l("paddingTop")||l("paddingRight")||l("paddingBottom")||l("paddingLeft")||l("marginTop")||l("marginRight")||l("marginBottom")||l("marginLeft")))continue;let a=Array.from(e.childNodes).find(t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim().length>0);if(!a)continue;let s=a.textContent,c=s.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],u=s.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;let d=document.createElement("span");d.textContent=c,d.dataset.snapdomPseudo="::first-letter";let f=ee(ne(o),"span");r.styleMap.set(d,f);let h=document.createTextNode(u);e.replaceChild(h,a),e.insertBefore(d,h);continue}let s=o.content??"",u=""===s||"none"===s||"normal"===s,{text:d,incs:f}=Dr(t,c,i,r.__siblingCounters),h=o.backgroundImage,m=o.backgroundColor,p=o.fontFamily,g=parseInt(o.fontSize)||32,y=parseInt(o.fontWeight)||!1,b=o.color||"#000",w=o.transform,x=er(p),S=!u&&""!==d,v=h&&"none"!==h,C=m&&"transparent"!==m&&"rgba(0, 0, 0, 0)"!==m,M=Wr(o),$=w&&"none"!==w,k="none"!==s&&"normal"!==s,A=k&&((parseFloat(o.width)||0)>0||(parseFloat(o.height)||0)>0),E=k&&o.boxShadow&&"none"!==o.boxShadow,F=k&&o.outlineStyle&&"none"!==o.outlineStyle&&(parseFloat(o.outlineWidth)||0)>0;if(!(S||v||C||M||$||A||E||F)){if(f&&f.length&&t.parentElement){let e=r.__siblingCounters.get(t.parentElement)||new Map;for(let{name:n}of f){if(!n)continue;let o=_r(t,i,r.__siblingCounters),l=Or(t,re(t,c),o).get(t,n);e.set(n,l)}r.__siblingCounters.set(t.parentElement,e)}continue}let N=d.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(d),R=!1;if(S&&!x&&d.length>1&&!N){let r=re(t),n=parseFloat(r.fontSize)||16,i=parseFloat(r.lineHeight);Number.isFinite(i)||(i=1.5*n),t.getBoundingClientRect().height<1.6*i&&(e.style.whiteSpace="nowrap",R=!0)}let L=document.createElement("span");L.dataset.snapdomPseudo=c,L.style.pointerEvents="none",R&&(L.style.whiteSpace="nowrap");let P=ne(o),T=(re(t).display||"").toLowerCase(),W=T.includes("flex")||T.includes("grid");if(W){let t=P["min-width"];(!t||"auto"===t||"0px"===t)&&(P["min-width"]="0px")}let I=ee(P,"span",S,W);if(r.styleMap.set(L,I),x&&d&&1===d.length){let{dataUrl:t,width:r,height:n}=await or(d,p,y,g,b),i=document.createElement("img");i.src=t,i.style=`height:${g}px;width:${r/n*g}px;object-fit:contain;`,L.appendChild(i),e.dataset.snapdomHasIcon="true"}else if(d&&N){let e=zt(d,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??qt(d);if(e?.trim())try{let t=await Qt(Xt(e),{as:"dataURL",useProxy:n.useProxy});if(t?.ok&&"string"==typeof t.data){let e=document.createElement("img");e.src=t.data,e.style=`width:${g}px;height:auto;object-fit:contain;`,L.appendChild(e)}}catch(l){console.error(`[snapdom] Error in pseudo ${c} for`,t,l)}}else!x&&S&&(L.textContent=d);L.style.backgroundImage="none","maskImage"in L.style&&(L.style.maskImage="none"),"webkitMaskImage"in L.style&&(L.style.webkitMaskImage="none");try{L.style.backgroundRepeat=o.backgroundRepeat,L.style.backgroundSize=o.backgroundSize,o.backgroundPositionX&&o.backgroundPositionY?(L.style.backgroundPositionX=o.backgroundPositionX,L.style.backgroundPositionY=o.backgroundPositionY):L.style.backgroundPosition=o.backgroundPosition,L.style.backgroundOrigin=o.backgroundOrigin,L.style.backgroundClip=o.backgroundClip,L.style.backgroundAttachment=o.backgroundAttachment,L.style.backgroundBlendMode=o.backgroundBlendMode}catch{}if(v)try{let t=ie(h),e=await Promise.all(t.map(Jt));L.style.backgroundImage=e.join(", ")}catch(a){console.warn(`[snapdom] Failed to inline background-image for ${c}`,a)}C&&(L.style.backgroundColor=m);let _=L.childNodes.length>0||""!==L.textContent?.trim()||v||C||M||$||A||E||F;if(f&&f.length&&t.parentElement){let e=r.__siblingCounters.get(t.parentElement)||new Map,n=_r(t,i,r.__siblingCounters),o=Or(t,re(t,c),n);for(let{name:r}of f){if(!r)continue;let n=o.get(t,r);e.set(r,n)}r.__siblingCounters.set(t.parentElement,e)}if(!_)continue;"::before"===c?(e.dataset.snapdomHasBefore="1",e.insertBefore(L,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(L))}catch(s){console.warn(`[snapdom] Failed to capture ${c} for`,t,s)}let o=Array.from(e.children).filter(t=>!t.dataset.snapdomPseudo);if(r.nodeMap)for(let c of o){let t=r.nodeMap.get(c);1===t?.nodeType&&await Hr(t,c,r,n)}else{let e=Array.from(t.children);for(let t=0;t<Math.min(e.length,o.length);t++)await Hr(e[t],o[t],r,n)}}function jr(t,e){if(!t||1!==t?.nodeType)return;let r=t.ownerDocument||document,n=e||r,i=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(0===i.length)return;let o=/url\(\s*#([^)]+)\)/g,l=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],a=t=>{if(!t||!t.getAttribute)return null;let e=t.getAttribute("href")||t.getAttribute("xlink:href")||("function"==typeof t.getAttributeNS?t.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(e)return e;let r=t.attributes;if(!r)return null;for(let n=0;n<r.length;n++){let t=r[n];if(!t||!t.name)continue;if("href"===t.name)return t.value;let e=t.name.indexOf(":");if(-1!==e&&"href"===t.name.slice(e+1))return t.value}return null},s=new Set(Array.from(t.querySelectorAll("[id]")).map(t=>t.id)),c=new Set,u=!1,d=(t,e=null)=>{if(!t)return;let r;for(o.lastIndex=0;r=o.exec(t);){u=!0;let t=(r[1]||"").trim();t&&(s.has(t)||(c.add(t),e&&!e.has(t)&&e.add(t)))}},f=t=>{let e=t.querySelectorAll("use");for(let n of e){let t=a(n);if(!t||!t.startsWith("#"))continue;u=!0;let e=t.slice(1).trim();e&&!s.has(e)&&c.add(e)}d(t.getAttribute("style")||"");for(let n of l)d(t.getAttribute(n));let r=t.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let n of r){d(n.getAttribute("style")||"");for(let t of l)d(n.getAttribute(t))}};for(let b of i)f(b);if(!u)return;let h=t.querySelector("svg.inline-defs-container");h||(h=r.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(h,t.firstChild||null));let m=h.querySelector("defs")||null,p=e=>{if(!e||s.has(e))return null;let r=(t=>window.CSS&&CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&"))(e),i=e=>{let r=n.querySelector(e);return r&&!t.contains(r)?r:null};return i(`svg defs > *#${r}`)||i(`svg > symbol#${r}`)||i(`*#${r}`)};if(!c.size)return;let g=new Set(c),y=new Set;for(;g.size;){let t=g.values().next().value;if(g.delete(t),!t||s.has(t)||y.has(t))continue;let e=p(t);if(!e){y.add(t);continue}m||(m=r.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(m));let n=e.cloneNode(!0);n.id||n.setAttribute("id",t),m.appendChild(n),y.add(t),s.add(t);let i=[n,...n.querySelectorAll("*")];for(let r of i){let t=a(r);if(t&&t.startsWith("#")){let e=t.slice(1).trim();e&&!s.has(e)&&!y.has(e)&&g.add(e)}let e=r.getAttribute?.("style")||"";e&&d(e,g);for(let n of l){let t=r.getAttribute?.(n);t&&d(t,g)}}}}function Ur(t){if(!t||"none"===t)return{top:0,right:0,bottom:0,left:0};let e=[],r="",n=0;for(let s=0;s<t.length;s++){let i=t[s];"("===i?n++:")"===i&&(n=Math.max(0,n-1)),","===i&&0===n?(e.push(r),r=""):r+=i}r.trim()&&e.push(r);let i=0,o=0,l=0,a=0;for(let s of e){if(/\binset\b/i.test(s))continue;let t=s.match(/-?\d+(\.\d+)?px/g)?.map(t=>parseFloat(t))||[];if(t.length<2)continue;let[e,r,n=0,c=0]=t,u=Math.abs(e)+n+c,d=Math.abs(r)+n+c;o=Math.max(o,u+Math.max(e,0)),a=Math.max(a,u+Math.max(-e,0)),l=Math.max(l,d+Math.max(r,0)),i=Math.max(i,d+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(l),left:Math.ceil(a)}}function Br(t,e,r,n,i){let o=r.a,l=r.b,a=r.c,s=r.d,c=r.e||0,u=r.f||0;function d(t,e){let r=t-n,d=e-i,f=o*r+a*d,h=l*r+s*d;return f+=n+c,h+=i+u,[f,h]}let f=[d(0,0),d(t,0),d(0,e),d(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of f)y<h&&(h=y),b<m&&(m=b),y>p&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function Vr(t,e,r){let n=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[n[0]||"0",n[1]||"0"],l=(t,e)=>{let r=t.toLowerCase();return"left"===r||"top"===r?0:"center"===r?e/2:"right"===r||"bottom"===r?e:r.endsWith("px")?parseFloat(r)||0:r.endsWith("%")?(parseFloat(r)||0)*e/100:/^-?\d+(\.\d+)?$/.test(r)&&parseFloat(r)||0};return{ox:l(i,e),oy:l(o,r)}}function qr(t){let e={rotate:"0deg",scale:null,translate:null},r="function"==typeof t.computedStyleMap?t.computedStyleMap():null;if(r){let n=t=>{try{return"function"==typeof r.has&&!r.has(t)||"function"!=typeof r.get?null:r.get(t)}catch{return null}},i=n("rotate");if(i)if(i.angle){let t=i.angle;e.rotate="rad"===t.unit?180*t.value/Math.PI+"deg":t.value+t.unit}else i.unit?e.rotate="rad"===i.unit?180*i.value/Math.PI+"deg":i.value+i.unit:e.rotate=String(i);else{let r=getComputedStyle(t);e.rotate=r.rotate&&"none"!==r.rotate?r.rotate:"0deg"}let o=n("scale");if(o){let t="x"in o&&null!=o.x?.value?o.x.value:Array.isArray(o)?o[0]?.value:Number(o)||1;e.scale=`${t} ${"y"in o&&null!=o.y?.value?o.y.value:Array.isArray(o)?o[1]?.value:t}`}else{let r=getComputedStyle(t);e.scale=r.scale&&"none"!==r.scale?r.scale:null}let l=n("translate");if(l){let t="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,r="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0;e.translate=`${t}${"x"in l&&l.x?.unit?l.x.unit:"px"} ${r}${"y"in l&&l.y?.unit?l.y.unit:"px"}`}else{let r=getComputedStyle(t);e.translate=r.translate&&"none"!==r.translate?r.translate:null}return e}let n=getComputedStyle(t);return e.rotate=n.rotate&&"none"!==n.rotate?n.rotate:"0deg",e.scale=n.scale&&"none"!==n.scale?n.scale:null,e.translate=n.translate&&"none"!==n.translate?n.translate:null,e}function zr(t){let e=function(){if(Mt)return Mt;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),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),Mt=t,t}(),r=document.createElement("div");r.style.transformOrigin="0 0",t.baseTransform&&(r.style.transform=t.baseTransform),t.rotate&&(r.style.rotate=t.rotate),t.scale&&(r.style.scale=t.scale),t.translate&&(r.style.translate=t.translate),e.appendChild(r);let n=function(t){let e=getComputedStyle(t).transform;if(!e||"none"===e)return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}(r);return e.removeChild(r),n}function Xr(t,e){if(!e)return null;let r,n,i,o,l=t.ownerDocument||document,a=l.defaultView||window;if("viewport"===e)r=0,n=0,i=l.documentElement?.clientWidth||a.innerWidth,o=l.documentElement?.clientHeight||a.innerHeight;else{if("object"!=typeof e)return null;r=(Number(e.x)||0)-(a.scrollX||0),n=(Number(e.y)||0)-(a.scrollY||0),i=Number(e.width),o=Number(e.height)}return i>0&&o>0?{left:r,top:n,width:i,height:o,right:r+i,bottom:n+o}:null}function Yr(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return e instanceof ShadowRoot?e.host:null}function Gr(t,e){for(let r=e;r;r=Yr(r))if(r===t)return!0;return!1}function Qr(t,e){for(let r=Yr(t);r&&r!==e&&1===r?.nodeType;r=Yr(r)){let t=re(r);if("static"!==t.position||t.transform&&"none"!==t.transform||t.filter&&"none"!==t.filter||t.backdropFilter&&"none"!==t.backdropFilter||t.perspective&&"none"!==t.perspective||/transform|perspective|filter/.test(t.willChange||"")||/layout|paint|strict|content/.test(t.contain||""))return r}return null}function Jr(t,e){try{let r=new DOMMatrix;if(e&&e.rotate&&"0deg"!==e.rotate&&(r=r.multiply(new DOMMatrix(`rotate(${e.rotate})`))),e&&e.scale){let t=String(e.scale).trim().split(/\s+/).filter(Boolean);t.length&&t.every(t=>Number.isFinite(Number(t)))&&(r=r.multiply(new DOMMatrix(`scale(${t.join(",")})`)))}return t&&(r=r.multiply(new DOMMatrix(t))),r}catch{return null}}function Kr(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||"inline-block"===e||"flow-root"===e||"absolute"===t.position||"fixed"===t.position||t.float&&"none"!==t.float)return!0;let r=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible";return!!("visible"!==r||"visible"!==n||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Zr(t,e){let r=Array.from(t.childNodes),n="top"===e?r:r.reverse();for(let i of n){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(i),e=String(t.display||"");if("none"!==e&&"contents"!==e&&"absolute"!==t.position&&"fixed"!==t.position)return t.float&&"none"!==t.float||e.startsWith("inline")?null:i}return null}function tn(t,e={}){t&&(function(t,e={}){let{stripFrameworkDirectives:r=!0}=e,n=new Set(["xml","xlink"]),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let t=i.currentNode;for(let e of Array.from(t.attributes)){let i=e.name;if(i.startsWith("*"))t.removeAttribute(i);else if(i.includes("@"))t.removeAttribute(i);else{if(i.includes(":")){let e=i.split(":",1)[0];if(!n.has(e)){t.removeAttribute(i);continue}}r&&(i.startsWith("x-")||i.startsWith("v-")||i.startsWith(":")||i.startsWith("on:")||i.startsWith("bind:")||i.startsWith("let:")||i.startsWith("class:"))&&t.removeAttribute(i)}}}}(t,e),function(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),r=[];for(;e.nextNode();)r.push(e.currentNode);for(let n of r)n.remove()}(t),function(t){if(!t)return;let e=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(t.attributes)for(let e of Array.from(t.attributes)){let r=e.value.replace($t,"");if(r!==e.value)try{t.setAttribute(e.name,r)}catch{}}}else if(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.CDATA_SECTION_NODE){let e=t.data.replace($t,"");e!==t.data&&(t.data=e)}};e(t);let r,n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;r=n.nextNode();)e(r)}(t))}function en(t,e){if(1!==t?.nodeType||function(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}(t)||function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}(t))return!1;let r=e.position;if("absolute"===r||"fixed"===r||"sticky"===r)return!1;let n=e.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||e.transform&&"none"!==e.transform)}function rn(t){let e=getComputedStyle(t);return!("none"===e.display||"absolute"===e.position||"fixed"===e.position)}function nn(t,e){if(1!==t?.nodeType)return!1;if("exclude"===t.getAttribute("data-capture")&&"remove"===e?.excludeMode)return!0;if(Array.isArray(e?.exclude))for(let i of e.exclude)try{if(t.matches(i))return"remove"===e.excludeMode}catch(r){ae(e,"exclude selector match failed",r)}if("function"==typeof e?.filter&&"remove"===e.filterMode)try{if(!e.filter(t))return!0}catch(n){ae(e,"filter function failed",n)}return!1}function on(t,e=new Set){let r="";if(!t)return r;for(let n=0;n<t.length;n++){let i=t[n];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){r+=on(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let t=on(i.cssRules,e);t&&(r+=`@media ${i.conditionText}{${t}}`);continue}if(i.type===CSSRule.STYLE_RULE){let t=i.selectorText||"";if(Et.test(t)){let t=i.cssText;t&&!e.has(t)&&(e.add(t),r+=t)}}}catch{}}return r}async function ln(t,e={}){let r=e.__session||l.session,n={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:e},i=null;if(e.clip){let r=Xr(t,e.clip);if(r){n.clip={rect:r,root:t};let e=t.getBoundingClientRect();i={x:r.left-e.left,y:r.top-e.top,width:r.width,height:r.height}}}let o,a="",s="",c=function(t){let e=getComputedStyle(t),r=e.outlineStyle,n=e.outlineWidth,i=e.borderStyle,o=e.borderWidth;if("none"!==r&&parseFloat(n)>0&&("none"===i||0===parseFloat(o))){let e=t.style.border;return t.style.border=`${n} solid transparent`,()=>{t.style.border=e}}return()=>{}}(t),u=n.clip?()=>{}:function(t){let e=[];try{let r=t.querySelectorAll("*");for(let t of r){if(!(t instanceof HTMLElement))continue;let r=t.style.contentVisibility||"",n=getComputedStyle(t),i=n.contentVisibility||n.getPropertyValue("content-visibility")||"";("auto"===i||"hidden"===i)&&(e.push({el:t,original:r}),t.style.contentVisibility="visible")}if(t instanceof HTMLElement){let r=getComputedStyle(t),n=r.contentVisibility||r.getPropertyValue("content-visibility")||"";("auto"===n||"hidden"===n)&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:t,original:r}of e)try{t.style.contentVisibility=r}catch{}}}(t);try{o=await Ge(t,n,e)}catch(f){throw console.warn("deepClone failed:",f),f}finally{u(),c()}try{jr(o)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{await Hr(t,o,n,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}await async function(t,e=null){if(!t)return;let r=e,n=qe(t,"img");for(let c of n)try{let t=c.getAttribute("src")||c.currentSrc||"";if(Ue(t)){let e=await He(t);c.setAttribute("src",e)}let e=c.getAttribute("srcset");if(e&&e.includes("blob:")){let t=Be(e),n=!1;for(let e of t)if(Ue(e.url))try{e.url=await He(e.url),n=!0}catch(a){ae(r,"blobUrlToDataUrl for srcset item failed",a)}n&&c.setAttribute("srcset",Ve(t))}}catch(u){ae(r,"resolveBlobUrls for img failed",u)}let i=qe(t,"image");for(let c of i)try{let t="http://www.w3.org/1999/xlink",e=c.getAttribute("href")||c.getAttributeNS?.(t,"href");if(Ue(e)){let r=await He(e);c.setAttribute("href",r),c.removeAttributeNS?.(t,"href")}}catch(u){ae(r,"resolveBlobUrls for SVG image href failed",u)}let o=qe(t,"[style*='blob:']");for(let c of o)try{let t=c.getAttribute("style");if(t&&t.includes("blob:")){let e=await je(t);c.setAttribute("style",e)}}catch(u){ae(r,"replaceBlobUrls in inline style failed",u)}let l=t.querySelectorAll?t.querySelectorAll("style"):[];for(let c of l)try{let t=c.textContent||"";t.includes("blob:")&&(c.textContent=await je(t))}catch(u){ae(r,"replaceBlobUrls in style tag failed",u)}for(let c of["poster"]){let e=qe(t,`[${c}^='blob:']`);for(let t of e)try{let e=t.getAttribute(c);Ue(e)&&t.setAttribute(c,await He(e))}catch(s){ae(r,`resolveBlobUrls for ${c} failed`,s)}}}(o,n);try{let t=o.querySelectorAll("style[data-sd]");for(let e of t)s+=e.textContent||"",e.remove()}catch(f){ae(n,"Failed to extract shadow CSS from style[data-sd]",f)}let d=function(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),r=new Map,n=1;for(let i of e)r.set(i,"c"+n++);return r}(n.styleMap);a=Array.from(d.entries()).map(([t,e])=>`.${e}{${t}}`).join(""),a=s+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+a;for(let[l,h]of n.styleMap.entries()){if("STYLE"===l.tagName)continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",h.replace(/;/g,"; "));continue}let t=d.get(h);t&&l.classList.add(t);let e=l.style?.backgroundImage,r=l.dataset?.snapdomHasIcon;e&&"none"!==e&&(l.style.backgroundImage=e),r&&(l.style.verticalAlign="middle",l.style.display="inline")}if((n.clip||t.scrollTop||t.scrollLeft)&&1===o?.nodeType)try{let e=n.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};!function(t,e,r,n,i){let o=t.getBoundingClientRect();e instanceof HTMLElement&&"static"===re(t).position&&(e.style.position="relative");let l=[];for(let[a,s]of r){if(!(a instanceof HTMLElement&&1===s?.nodeType&&s!==t&&Gr(t,s)))continue;let e=n.get(s)||re(s),r=e.position;if("fixed"!==r&&"sticky"!==r&&"-webkit-sticky"!==r||"absolute"===a.style.position)continue;let c=s.getBoundingClientRect();if(!(c.width>0&&c.height>0))continue;let u=e.transform&&"none"!==e.transform?e.transform:"",d=qr(s),f=!!(u||"0deg"!==d.rotate||d.scale||d.translate),h=f?Jr(u,d):null,m=!h||!h.is2D||1===h.a&&0===h.b&&0===h.c&&1===h.d,p=c.width,g=c.height;m||(p=s.offsetWidth||c.width,g=s.offsetHeight||c.height);let y=s.getRootNode&&s.getRootNode()instanceof ShadowRoot,b=o,w=t.clientLeft||0,x=t.clientTop||0;if(y){let e=Qr(s,t);e&&(b=e.getBoundingClientRect(),w=e.clientLeft||0,x=e.clientTop||0)}let S=c.left-b.left-w,v=c.top-b.top-x;if(f)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",m)a.style.transform="none";else{a.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:t,oy:r}=Vr(e,p,g),n=Br(p,g,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},t,r);S-=n.minX,v-=n.minY}if("fixed"!==r){let t=a.cloneNode(!1);t.setAttribute("data-snap-ph","1"),t.style.position="static",t.style.visibility="hidden",t.style.width=`${p}px`,t.style.height=`${g}px`,t.style.boxSizing="border-box",a.parentElement?.insertBefore(t,a)}let C=p+2,M=g;i&&(Math.abs(v-i.y)<.5&&(v-=1,M+=1),Math.abs(S-i.x)<.5&&(S-=1,C+=1)),a.style.position="absolute",a.style.left=`${S}px`,a.style.top=`${v}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${C}px`,a.style.height=`${M}px`,a.style.boxSizing="border-box",y||l.push(a)}for(let a of l)e.appendChild(a)}(t,o,n.nodeMap,n.styleCache,e)}catch(f){ae(n,"freezeViewportPositioned failed",f)}for(let[l,h]of n.nodeMap.entries()){if(n.clip&&h===t)continue;let e=h.scrollLeft,r=h.scrollTop;if((e||r)&&1===l?.nodeType&&"http://www.w3.org/1999/xhtml"===l.namespaceURI){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";try{let t=l.querySelectorAll("*");for(let n of t){if(1!==n.nodeType||"http://www.w3.org/1999/xhtml"!==n.namespaceURI)continue;let t=n.style.position;if("fixed"===t||"absolute"===t){let i=parseFloat(n.style.top)||0,o=parseFloat(n.style.left)||0;n.style.top=`${i+r}px`,n.style.left=`${o+e}px`,"fixed"===t&&(n.style.position="absolute")}}}catch{}let t=document.createElement("div");for(t.style.all="unset",t.style.transform=`translate(${-e}px, ${-r}px)`,t.style.willChange="transform",t.style.display="inline-block",t.style.width="100%";l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t)}}if(t===n.nodeMap.get(o)){let e=n.styleCache.get(t)||re(t);n.styleCache.set(t,e);let r=function(t){if(!t||"none"===t)return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(t,e)=>{let r=e.split(",").map(t=>t.trim());return 6!==r.length?`matrix(${e})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(t,e)=>{let r=e.split(",").map(t=>t.trim());return 16!==r.length?`matrix3d(${e})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}(e.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=r||""}for(let[l,h]of n.nodeMap.entries())"PRE"===h.tagName&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:o,classCSS:a,styleCache:n.styleCache,nodeMap:n.nodeMap,reconcileRisk:n.reconcileRisk||0,clipWindow:i}}async function an(t,e={}){let r=Array.from(t.querySelectorAll("img"));"IMG"===t.tagName&&r.unshift(t);let n=async t=>{if(!t.getAttribute("src")){let e=t.currentSrc||t.src||Re(t.getAttribute("srcset"),t)||"";e&&t.setAttribute("src",e)}t.removeAttribute("srcset"),t.removeAttribute("sizes");let r=t.src||"";if(!r)return;let n=l.image?.get(r);if(n)return t.src=n,t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100));let i=await Qt(r,{as:"dataURL",useProxy:e.useProxy});if(i.ok&&"string"==typeof i.data&&i.data.startsWith("data:"))return l.image?.set(r,i.data),t.src=i.data,t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100));let{width:o,height:a}=function(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,r=parseInt(t.dataset?.snapdomHeight||"",10)||0,n=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,l=parseFloat(t.style?.height||"")||0;return{width:e||o||n||t.width||t.naturalWidth||100,height:r||l||i||t.height||t.naturalHeight||100}}(t),{fallbackURL:s}=e||{};if(s)try{let n="function"==typeof s?await s({width:o,height:a,src:r,element:t}):s;if(n){let r=await Qt(n,{as:"dataURL",useProxy:e.useProxy});if(r?.ok&&"string"==typeof r.data)return t.src=r.data,t.width||(t.width=o),void(t.height||(t.height=a))}}catch{}if(!1!==e.placeholders){let e=document.createElement("div");e.style.cssText=[`width:${o}px`,`height:${a}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${a}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),e.textContent="img",t.replaceWith(e)}else{let e=document.createElement("div");e.style.cssText=`display:inline-block;width:${o}px;height:${a}px;visibility:hidden;`,t.replaceWith(e)}};for(let l=0;l<r.length;l+=6){let t=r.slice(l,l+6).map(n);await Promise.allSettled(t)}let i=Array.from(t.querySelectorAll("image"));"image"===t.localName&&i.unshift(t);let o=async t=>{let r=function(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||("function"==typeof t.getAttributeNS?t.getAttributeNS(Nt,"href"):null)}(t);if(!r||r.startsWith("data:")||r.startsWith("blob:"))return;let n=await Qt(r,{as:"dataURL",useProxy:e.useProxy});n.ok&&"string"==typeof n.data&&n.data.startsWith("data:")&&(t.setAttribute("href",n.data),t.removeAttribute("xlink:href"),"function"==typeof t.removeAttributeNS&&t.removeAttributeNS(Nt,"href"))};for(let l=0;l<i.length;l+=6){let t=i.slice(l,l+6).map(o);await Promise.allSettled(t)}}async function sn(t,e,r,n){let i=r.get(t)||re(t);r.has(t)||r.set(t,i);let o=i.getPropertyValue("border-image"),l=i.getPropertyValue("border-image-source"),a=o&&"none"!==o||l&&"none"!==l,s=i.getPropertyValue("background-image"),c=i.getPropertyValue("background-color");if(s&&"none"!==s||c&&"rgba(0, 0, 0, 0)"!==c&&"transparent"!==c||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""))for(let u of Pt){let t=i.getPropertyValue(u);t&&e.style.setProperty(u,t)}for(let u of Rt){let t=i.getPropertyValue(u);if("background-image"===u&&(!t||"none"===t)){let e=i.getPropertyValue("background");e&&/url\s*\(/.test(e)&&(t=ie(e).filter(t=>/url\s*\(/.test(t)).join(", ")||t)}if(!t||"none"===t)continue;let r=ie(t),o=await Promise.all(r.map(t=>Jt(t,n)));o.some(t=>t&&"none"!==t&&!/^url\(undefined/.test(t))&&e.style.setProperty(u,o.join(", "))}for(let u of Lt){let t=i.getPropertyValue(u);!t||"initial"===t||e.style.setProperty(u,t)}if(a)for(let u of Tt){let t=i.getPropertyValue(u);!t||"initial"===t||e.style.setProperty(u,t)}}function cn(t,e,r=l.session.nodeMap){let n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let l=i.currentNode;l;l=i.nextNode()){let t=r.get(l);if(1!==t?.nodeType)continue;let i=re(t),o=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");o&&"none"!==o&&l!==e&&n.push({cloneEl:l,orig:t,bf:o,path:dn(e,l)})}if(!n.length)return;let o=t.getBoundingClientRect(),a=n.map((t,i)=>{let o=e.cloneNode(!0);(function(t,e,r,n){let i=[[t,e]];for(;i.length;){let[t,e]=i.pop(),o=n.get(e);if(1===o?.nodeType){let e=o.getBoundingClientRect();(e.left>r.right+Wt||e.right<r.left-Wt||e.top>r.bottom+Wt||e.bottom<r.top-Wt)&&("IMG"===t.tagName&&t.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),t.style&&(t.style.backgroundImage="none"))}let l=t.children,a=e.children;for(let r=0;r<l.length;r++)i.push([l[r],a[r]])}})(o,e,t.orig.getBoundingClientRect(),r),function(t){if(t)for(let e=t;e&&e.parentNode;){let r=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=r}}(fn(o,t.path));for(let e=0;e<i;e++){let t=fn(o,n[e].path);t&&(t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...t,copy:o}});for(let{cloneEl:l,orig:s,bf:c,copy:u}of a)un(l,s,c,u,o)}function un(t,e,r,n,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let l=re(e),a=e.offsetWidth?o.width/e.offsetWidth:1,s=Math.abs(a-1)>.001?1/a:1;n.style.position="absolute",n.style.left=(i.left-o.left)*s+"px",n.style.top=(i.top-o.top)*s+"px",n.style.width=`${i.width}px`,n.style.height=`${i.height}px`,n.style.margin="0",n.style.filter=r,1!==s&&(n.style.transform=`scale(${s})`,n.style.transformOrigin="top left");let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",c.appendChild(n);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",u.style.backgroundColor=l.backgroundColor,u.style.backgroundImage=t.style.backgroundImage||l.backgroundImage;for(let d of["background-size","background-position","background-repeat","background-origin","background-clip"])u.style.setProperty(d,l.getPropertyValue(d));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"),"static"===l.position&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(u),t.prepend(c)}function dn(t,e){let r=[];for(let n=e;n!==t;n=n.parentElement){if(!n?.parentElement)return null;r.push([...n.parentElement.children].indexOf(n))}return r.reverse()}function fn(t,e){if(!e)return null;let r=t;for(let n of e)if(r=r.children[n],!r)return null;return r}function hn(t,e){if(!t)return()=>{};let r=[],n=200;return function t(i){if(e){let t=i.getBoundingClientRect();if(t.width>0||t.height>0){let r=Math.max(t.right,t.left+(i.scrollWidth||0)),o=Math.max(t.bottom,t.top+(i.scrollHeight||0));if(r<e.left-n||t.left>e.right+n||o<e.top-n||t.top>e.bottom+n)return}}let o=getComputedStyle(i),l=function(t,e){if(!t)return()=>{};let r=function(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let r=parseInt(e,10);return Number.isFinite(r)&&r>0?r:0}(e=e||getComputedStyle(t));if(r<=0)return()=>{};if(!mn(t))return()=>{};let n=t.textContent??"",i=n,o=function(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}(e);t.textContent="X";let l=t.scrollHeight-o;t.textContent=n;let a=l>0?l:function(t){let e=(t.lineHeight||"").trim(),r=parseFloat(t.fontSize)||16;return e&&"normal"!==e?e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*r):e.endsWith("%")?Math.round(parseFloat(e)/100*r):Math.round(1.2*r):Math.round(1.2*r)}(e),s=Math.round(a*r+o);if(t.scrollHeight<=s+.5)return()=>{};let c=0,u=n.length,d=-1;for(;c<=u;){let e=c+u>>1;t.textContent=n.slice(0,e)+"…",t.scrollHeight<=s+.5?(d=e,c=e+1):u=e-1}return t.textContent=(d>=0?n.slice(0,d):"")+"…",()=>{t.textContent=i}}(i,o);l&&r.push(l);let a=function(t,e){if(!t)return()=>{};if("ellipsis"!==(e=e||getComputedStyle(t)).textOverflow)return()=>{};if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)return()=>{};if("hidden"!==e.overflowX&&"clip"!==e.overflowX)return()=>{};if(!mn(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let r=t.textContent??"",n=r,i=0,o=r.length,l=-1;for(;i<=o;){let e=i+o>>1;t.textContent=r.slice(0,e)+"…",t.scrollWidth<=t.clientWidth+.5?(l=e,i=e+1):o=e-1}return t.textContent=(l>=0?r.slice(0,l):"")+"…",()=>{t.textContent=n}}(i,o);a&&r.push(a);for(let e of i.children||[])t(e)}(t),()=>r.forEach(t=>t())}function mn(t){return!(t.childElementCount>0)&&Array.from(t.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}function pn(t){if(!t)return null;if(Array.isArray(t)){let[e,r]=t;return"function"==typeof e?e(r):e}if("object"==typeof t&&"plugin"in t){let{plugin:e,options:r}=t;return"function"==typeof e?e(r):e}return"function"==typeof t?t():t}function gn(t){return t&&Array.isArray(t.plugins)?t.plugins:It}async function yn(t,e,r){let n=r,i=gn(e);for(let o of i){let r=o&&"function"==typeof o[t]?o[t]:null;if(!r)continue;let i=await r(e,n);typeof i<"u"&&(n=i)}return n}function bn(t,e,r=!1){return!t||t.plugins&&!r||(t.plugins=function(t){let e=[];if(Array.isArray(t))for(let r of t){let t=pn(r);if(!t||!t.name)continue;let n=e.findIndex(e=>e&&e.name===t.name);n>=0&&e.splice(n,1),e.push(t)}for(let r of It)r&&r.name&&!e.some(t=>t.name===r.name)&&e.push(r);return Object.freeze(e)}(e)),t}function wn(){return It.slice()}async function xn(t,e,r){if("string"!=typeof t||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;let n=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+Math.round(e)+"x"+Math.round(r);if(l.compress.has(n))return l.compress.get(n);let i=await(async()=>{let n;try{n=await async function(t){let e=new Image;if(e.decoding="sync",e.src=t,"function"==typeof e.decode)try{return await e.decode(),e}catch{}return await new Promise((t,r)=>{e.onload=()=>t(),e.onerror=r}),e}(t)}catch{return null}let i=n.naturalWidth||n.width,o=n.naturalHeight||n.height;if(!i||!o)return null;let l=Math.min(1,Math.max(e/i,r/o));if(!(l>0)||l>=.95)return null;let a=l*Ot,s=Math.max(1,Math.round(i*a)),c=Math.max(1,Math.round(o*a)),u=document.createElement("canvas");u.width=s,u.height=c;let d=u.getContext("2d");if(!d)return null;d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(n,0,0,s,c);let f=function(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}(t),h="image/jpeg"===f?"image/jpeg":"image/webp"===f?"image/webp":"image/png";try{let e=u.toDataURL(h,_t);if("string"==typeof e&&e.startsWith("data:image")&&e.length<t.length)return e}catch{}return null})();return l.compress.set(n,i),i}async function Sn(t,e,r){e.compress&&(await async function(t,e){if(!e.compress)return{count:0,before:0,after:0};let r=(e.scale||1)*(e.dpr||1),n=Array.from(t.querySelectorAll("img"));"IMG"===t.tagName&&n.unshift(t);let i=0,o=0,l=0,a=async t=>{let e=t.getAttribute("src")||"";if(!e.startsWith("data:image")||e.startsWith("data:image/svg"))return;let n=parseFloat(t.dataset.snapdomWidth)||parseFloat(t.style.width)||t.width||0,a=parseFloat(t.dataset.snapdomHeight)||parseFloat(t.style.height)||t.height||0;if(!n||!a)return;let s=await xn(e,n*r,a*r);s&&(i++,o+=e.length,l+=s.length,t.setAttribute("src",s))};for(let s=0;s<n.length;s+=6)await Promise.allSettled(n.slice(s,s+6).map(a));return{count:i,before:o,after:l}}(t,e),await async function(t,e,r=l.session.nodeMap){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),i=[],o=[t,...t.querySelectorAll("*")];for(let l of o){let t=l.style&&l.style.backgroundImage;t&&t.includes("data:image")&&i.push(l)}let a=0,s=async t=>{let e,i=r.get(t);if(!i||!i.isConnected)return;try{e=getComputedStyle(i)}catch{return}if((e.backgroundRepeat||"repeat").toLowerCase().split(",").some(t=>"no-repeat"!==t.trim()))return;let{w:o,h:l}=function(t){return{w:t.offsetWidth||t.getBoundingClientRect().width||0,h:t.offsetHeight||t.getBoundingClientRect().height||0}}(i);if(!o||!l)return;let s=o*n,c=l*n,u=t.style.backgroundImage,d=[...u.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],f=u;for(let r of d){let t=r[2];if(t.startsWith("data:image/svg"))continue;let e=await xn(t,s,c);e&&(f=f.split(t).join(e),a++)}f!==u&&(t.style.backgroundImage=f)};for(let l=0;l<i.length;l+=6)await Promise.allSettled(i.slice(l,l+6).map(s));return{count:a}}(t,e,r),await async function(t,e){if(!e.compress)return{count:0};let r=(e.scale||1)*(e.dpr||1),n=Array.from(t.querySelectorAll("image"));"image"===t.localName&&n.unshift(t);let i=0,o=async t=>{let e=t.getAttribute("href")||("function"==typeof t.getAttributeNS?t.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!e||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return;let n=parseFloat(t.getAttribute("width"))||0,o=parseFloat(t.getAttribute("height"))||0;if(!n||!o)return;let l=await xn(e,n*r,o*r);l&&(t.setAttribute("href",l),t.hasAttribute("xlink:href")&&t.setAttribute("xlink:href",l),i++)};for(let l=0;l<n.length;l+=6)await Promise.allSettled(n.slice(l,l+6).map(o));return{count:i}}(t,e))}async function vn(t,e){if(!t)throw new Error("Element cannot be null or undefined");(function(t="soft"){switch(t){case"auto":return l.session.styleMap=new Map,void(l.session.nodeMap=new Map);case"soft":default:return l.session.styleMap=new Map,l.session.nodeMap=new Map,void(l.session.styleCache=new WeakMap);case"full":return;case"disabled":l.session.styleMap=new Map,l.session.nodeMap=new Map,l.session.styleCache=new WeakMap,l.computedStyle=new WeakMap,l.measureHints=new WeakMap,l.baseStyle=new o(50),l.defaultStyle=new o(30),l.image=new o(100),l.background=new o(100),l.resource=new o(150),l.compress=new o(50),l.font=new Set}})(e.cache),e.__session={styleMap:l.session.styleMap,styleCache:l.session.styleCache,nodeMap:l.session.nodeMap},e.burst||function(t){let e=Date.now(),r=l.burstAdvice.get(t);!r||e-r.firstTs>Dt?l.burstAdvice.set(t,{count:1,firstTs:e,warned:!1}):(r.count++,r.count>=Ht&&!r.warned&&(r.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed.")))}(t),e.__resolveNodeHooks=function(t){let e=Array.isArray(t.plugins)?t.plugins:wn(),r=[];for(let n of e){let t=pn(n);t&&"function"==typeof t.resolveNode&&r.push(t.resolveNode.bind(t))}return r.length?r:null}(e);let r,n,i,a,s,c,u,d,f=e.fast,h=!1!==e.outerTransforms,m=!!e.outerShadows,p=e.clip?Xr(t,e.clip):null,g={element:t,options:e,plugins:e.plugins},y="",b="",w=null;await yn("beforeSnap",g);let x=null;!1!==e.resolvePicturePlaceholders&&!function(t){if(Array.isArray(t.plugins))for(let e of t.plugins)if("picture-resolver"===pn(e)?.name)return!0;return wn().some(t=>"picture-resolver"===t?.name)}(e)&&(x=await Te(g.element,g.options)),await yn("beforeClone",g);let S=hn(g.element,p);try{({clone:r,classCSS:n,styleCache:i,nodeMap:a,reconcileRisk:s,clipWindow:c}=await ln(g.element,g.options)),s>0&&!e.reconcile&&!l.warnedReconcile&&(l.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).")),!h&&r&&(w=function(t,e){if(!t||!e||!e.style)return null;let r=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 n=r.transform||"none";if(!n||"none"===n){let r=null;try{r=qr(t).scale}catch{}try{e.style.transform="none"}catch{}if(!r)return{a:1,b:0,c:0,d:1};let n=r.trim().split(/\s+/).map(parseFloat),i=Number.isFinite(n[0])?n[0]:1;return{a:i,b:0,c:0,d:Number.isFinite(n[1])?n[1]:i}}function i(t,e,r,n){let i=Math.sqrt(t*t+e*e)||0,o=0,l=0;if(i>0){let a=t/i,s=e/i;o=a*r+s*n;let c=r-a*o,u=n-s*o;l=Math.sqrt(c*c+u*u)||0,l>0?o/=l:o=0}return{a:i,b:0,c:o*l,d:l}}let o=n.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let t=o[1].split(",").map(t=>parseFloat(t.trim()));if(6===t.length&&t.every(Number.isFinite)){let[r,n,o,l]=t,a=i(r,n,o,l);try{e.style.transform=`matrix(${a.a}, ${a.b}, ${a.c}, ${a.d}, 0, 0)`}catch{}return a}}let l=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(l){let t=l[1].split(",").map(t=>parseFloat(t.trim()));if(16===t.length&&t.every(Number.isFinite)){let r=i(t[0],t[1],t[4],t[5]);try{e.style.transform=`matrix(${r.a}, ${r.b}, ${r.c}, ${r.d}, 0, 0)`}catch{}return r}}try{let t=new DOMMatrix(n),r=i(t.a,t.b,t.c,t.d);try{e.style.transform=`matrix(${r.a}, ${r.b}, ${r.c}, ${r.d}, 0, 0)`}catch{}return r}catch{return null}}(g.element,r)),!m&&r&&function(t,e,r={}){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch(g){ae(r,"stripRootShadows boxShadow",g)}try{e.style.textShadow="none"}catch(g){ae(r,"stripRootShadows textShadow",g)}try{e.style.outline="none"}catch(g){ae(r,"stripRootShadows outline",g)}let i=(n.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=i.length?i:"none"}catch(g){ae(r,"stripRootShadows filter",g)}}(g.element,r,g.options),r&&function(t,e,r){if(!t||!e||!e.style)return;let n=getComputedStyle(t);if(!Kr(n))for(let i of["top","bottom"]){let o="top"===i?"Top":"Bottom";if((parseFloat(n[`border${o}Width`])||0)>0||(parseFloat(n[`padding${o}`])||0)>0)continue;let l=t,a=e;for(;l&&a;){let t=Zr(l,i);if(!t)break;let e=r?Array.from(a.children).find(e=>r.get(e)===t)||null:a.children[Array.from(l.children).indexOf(t)]||null,n=getComputedStyle(t),s=parseFloat(n[`margin${o}`])||0;if(e&&e.style&&s>0&&(e.style[`margin${o}`]="0px"),Kr(n)||(parseFloat(n[`border${o}Width`])||0)>0||(parseFloat(n[`padding${o}`])||0)>0)break;l=t,a=e}}}(g.element,r,a)}finally{S()}if(g={clone:r,classCSS:n,styleCache:i,nodeMap:a,...g},await yn("afterClone",g),x&&await x(),tn(g.clone),"remove"===g.options?.excludeMode||"remove"===g.options?.filterMode)try{!function(t,e,r=new Map){!function t(e,n){if(1!==e?.nodeType||1!==n?.nodeType)return;let i=e.childElementCount>n.childElementCount,o=r.get(e)||getComputedStyle(e);if(r.has(e)||r.set(e,o),i&&en(e,o)){n.style.height||(n.style.height="auto"),n.style.width||(n.style.width="auto"),n.style.removeProperty("block-size"),n.style.removeProperty("inline-size"),n.style.minHeight||(n.style.minHeight="0"),n.style.minWidth||(n.style.minWidth="0"),n.style.maxHeight||(n.style.maxHeight="none"),n.style.maxWidth||(n.style.maxWidth="none");let t=o.overflowY||o.overflowBlock||"visible",e=o.overflowX||o.overflowInline||"visible";("visible"!==t||"visible"!==e)&&(n.style.overflow="visible")}let l=Array.from(e.children),a=Array.from(n.children);for(let r=0;r<Math.min(l.length,a.length);r++)t(l[r],a[r])}(t,e)}(g.element,g.clone,g.styleCache)}catch(F){console.warn("[snapdom] shrink pass failed:",F)}try{await async function(t,e,r=l.session.nodeMap){if(1!==t?.nodeType)return 0;let n='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(n)).filter(t=>t&&t.textContent&&t.textContent.trim());if(t.matches?.(n)&&t.textContent&&t.textContent.trim()&&i.unshift(t),0===i.length)return 0;let o=1===e?.nodeType?Array.from(e.querySelectorAll(n)).filter(t=>t&&t.textContent&&t.textContent.trim()):[];1===e?.nodeType&&e.matches?.(n)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let a=0;for(let l=0;l<i.length;l++){let t=i[l],e=r&&r.get(t)||o[l]||null;try{let r=getComputedStyle(e||t),n=r.fontFamily||"Material Icons";if(!rr(n))continue;let i=(e||t).textContent.trim();if(!i)continue;let o=parseInt(r.fontSize,10)||24,{dataUrl:l,width:s,height:c}=await ir(i,{family:n,weight:r.fontWeight&&"normal"!==r.fontWeight?r.fontWeight:"normal",fontSize:o,color:nr(r),variation:r.fontVariationSettings&&"normal"!==r.fontVariationSettings?r.fontVariationSettings:"",className:(e||t).className||""});t.textContent="";let u=t.ownerDocument.createElement("img");u.src=l,u.alt=i,u.style.height=`${o}px`,u.style.width=`${Math.max(1,Math.round(s/c*o))}px`,u.style.objectFit="contain",u.style.verticalAlign=getComputedStyle(t).verticalAlign||"baseline",t.appendChild(u),a++}catch{}}return a}(g.clone,g.element,g.nodeMap)}catch{}let v=t=>new Promise((e,r)=>{oe(()=>{Promise.resolve().then(t).then(e,r)},{fast:f})}),C=(async()=>{await Promise.all([v(()=>an(g.clone,g.options)),v(()=>async function(t,e,r,n={},i=l.session.nodeMap){if(!e)return;let o=[];t&&Me(t)&&o.push([t,e]);let a=[e];for(;a.length;){let t=a.pop();if(t.children)for(let e of t.children){if("STYLE"===e.tagName)continue;let t=i.get(e);t&&Me(t)&&o.push([t,e]),a.push(e)}}for(let l=0;l<o.length;l+=6)await Promise.allSettled(o.slice(l,l+6).map(([t,e])=>sn(t,e,r,n)))}(g.element,g.clone,g.styleCache,g.options,g.nodeMap))]);try{cn(g.element,g.clone,g.nodeMap)}catch(F){console.warn("[snapdom] backdrop-filter emulation failed:",F)}e.compress&&await v(()=>Sn(g.clone,g.options,g.nodeMap))})(),M=Promise.resolve();e.embedFonts&&(M=v(async()=>{let t=g.element.ownerDocument||document,e=p?t=>{try{let e=t.getBoundingClientRect();return e.right>=p.left-200&&e.left<=p.right+200&&e.bottom>=p.top-200&&e.top<=p.bottom+200}catch{return!0}}:null,{required:r,usedCodepoints:n}=Cr(g.element,e);le()&&await Mr(new Set(Array.from(r).map(t=>String(t).split("__")[0]).filter(Boolean)),1,t),y=await vr({required:r,usedCodepoints:n,preCached:!1,exclude:g.options.excludeFonts,localFonts:g.options.localFonts,useProxy:g.options.useProxy,fontStylesheetDomains:g.options.fontStylesheetDomains,doc:t})})),await Promise.all([C,M]);let $=function(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),"function"==typeof t.querySelectorAll&&t.querySelectorAll("*").forEach(t=>e.add(t.tagName.toLowerCase())),Array.from(e))}(g.clone).sort(),k=$.join(",");l.baseStyle.has(k)?b=l.baseStyle.get(k):await new Promise(t=>{oe(()=>{b=function(t){let e=new Map;for(let n of t){let t=Kt(n);if(!t)continue;let r=Object.entries(t).map(([t,e])=>`${t}:${e};`).sort().join("");r&&(e.has(r)||e.set(r,[]),e.get(r).push(n))}let r="";for(let[n,i]of e.entries())r+=`${i.join(",")} { ${n} }\n`;return r}($),l.baseStyle.set(k,b),t()},{fast:f})});let A=function(t){if(!t||!t.styleSheets)return"";let e=function(t){let e="";for(let r of t.styleSheets){let t=-1;try{t=r.cssRules?r.cssRules.length:-1}catch{}e+=(r.href||"inline")+":"+t+"|"}return e}(t),r=Ft.get(t);if(r&&r.fp===e)return r.css;let n=new Set,i="";for(let o of Array.from(t.styleSheets))try{let t=o.cssRules;t&&(i+=on(t,n))}catch{}return Ft.set(t,{fp:e,css:i}),i}(g.element?.ownerDocument||document);g={fontsCSS:y,baseCSS:b,scrollbarCSS:A,...g},await yn("beforeRender",g),await new Promise(t=>{oe(()=>{let r=re(g.element),n=g.element.getBoundingClientRect(),i=Math.max(1,kt(g.element.offsetWidth||parseFloat(r.width)||n.width||1)),o=Math.max(1,kt(g.element.offsetHeight||parseFloat(r.height)||n.height||1)),a=g.element.ownerDocument||document;if(!(c||g.element!==a.body&&g.element!==a.documentElement||a.documentElement.hasAttribute("data-sd-pinned"))){let t=Math.max(g.element.scrollHeight||0,a.documentElement?.scrollHeight||0,a.body?.scrollHeight||0),e=Math.max(g.element.scrollWidth||0,a.documentElement?.scrollWidth||0,a.body?.scrollWidth||0);t>0&&(o=Math.max(o,kt(t))),e>0&&(i=Math.max(i,kt(e)));try{let t=(g.scrollbarCSS||"").length+(g.baseCSS||"").length+(g.fontsCSS||"").length+(g.classCSS||"").length,e=l.measureHints.get(g.element);if(e&&e.cssLen===t&&e.w0===i)e.csh>0&&(o=Math.max(o,kt(e.csh))),e.csw>0&&(i=Math.max(i,kt(e.csw)));else{let e=a.createElement("div");e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let r=e.attachShadow({mode:"open"}),n=a.createElement("style");n.textContent=(g.scrollbarCSS||"")+g.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+g.classCSS,r.appendChild(n),r.appendChild(g.clone.cloneNode(!0)),a.body.appendChild(e);let s=e.scrollHeight,c=e.scrollWidth;a.body.removeChild(e),l.measureHints.set(g.element,{cssLen:t,w0:i,csh:s,csw:c}),s>0&&(o=Math.max(o,kt(s))),c>0&&(i=Math.max(i,kt(c)))}}catch{}}if("remove"===g.options?.excludeMode||"remove"===g.options?.filterMode){let t=function(t,e){let r=getComputedStyle(t),n=t.getBoundingClientRect(),i=1/0,o=-1/0,l=!1,a=Array.from(t.children);for(let c of a){if(nn(c,e)||!rn(c))continue;let t=c.getBoundingClientRect(),r=t.top-n.top,a=t.bottom-n.top;a<=r||(r<i&&(i=r),a>o&&(o=a),l=!0)}let s=l?Math.max(0,o-i):0;return(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0)+(parseFloat(r.paddingTop)||0)+(parseFloat(r.paddingBottom)||0)+s}(g.element,g.options);Number.isFinite(t)&&t>0&&(o=Math.max(1,Math.min(o,kt(t+1))))}if(g.options?.reconcile)try{let t=(g.scrollbarCSS||"")+g.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+g.classCSS;!function(t,e,r,n,i,o){let l=t.ownerDocument||document,a=t.getBoundingClientRect(),s=i>0&&a.width>0?a.width/i:1,c=o>0&&a.height>0?a.height/o:1;if(Math.abs(s-c)>.02)return 0;let u=l.createElement("div");u.setAttribute("data-snapdom-internal",""),u.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let d=u.attachShadow({mode:"open"}),f=l.createElement("style");f.textContent=r,d.appendChild(f);let h=e.cloneNode(!0);d.appendChild(h),l.body.appendChild(u);try{let t=(e,r)=>{let i=e.children,o=r.children,l=Math.min(i.length,o.length);for(let a=0;a<l;a++){let e=i[a],r=o[a],l=n.get(e);if(1===l?.nodeType&&e instanceof HTMLElement&&l.isConnected){let t=l.getBoundingClientRect();if(t.width>0&&t.height>0){let n=r.getBoundingClientRect(),i=n.width-t.width/s,o=n.height-t.height/c;(Math.abs(i)>At||Math.abs(o)>At)&&(e.style.boxSizing="border-box",e.style.width=`${kt(t.width/s)}px`,e.style.height=`${kt(t.height/c)}px`)}}t(e,r)}};t(e,h)}finally{u.remove()}}(g.element,g.clone,t,g.nodeMap,i,o)}catch(rt){console.warn("[snapdom] reconcile pass failed:",rt)}let s=(t,e=NaN)=>{let r="string"==typeof t?parseFloat(t):t;return Number.isFinite(r)?r:e},f=s(g.options.width),p=s(g.options.height),y=c?kt(c.width):i,b=c?kt(c.height):o,x=y,S=b,v=Number.isFinite(f),C=Number.isFinite(p),M=b>0?y/b:1;v&&C?(x=Math.max(1,kt(f)),S=Math.max(1,kt(p))):v?(x=Math.max(1,kt(f)),S=Math.max(1,kt(x/(M||1)))):C&&(S=Math.max(1,kt(p)),x=Math.max(1,kt(S*(M||1))));let $=0,k=0,A=i,E=o;if(c){let t=0,e=0;if(Cn(g.element)){let n=null;if(!h&&w&&Number.isFinite(w.a))n={a:w.a,b:w.b||0,c:w.c||0,d:w.d||1,e:0,f:0};else{let t=qr(g.element),e=Jr(r.transform&&"none"!==r.transform?r.transform:"",t);e&&e.is2D&&(n={a:e.a,b:e.b,c:e.c,d:e.d,e:0,f:0})}if(n&&(1!==n.a||0!==n.b||0!==n.c||1!==n.d)){let{ox:l,oy:a}=Vr(r,i,o),s=Br(i,o,n,l,a);t=s.minX,e=s.minY}}$=kt(c.x+t),k=kt(c.y+e),A=kt($+c.width),E=kt(k+c.height)}else if(!h&&w&&Number.isFinite(w.a)){let t=Br(i,o,{a:w.a,b:w.b||0,c:w.c||0,d:w.d||1,e:0,f:0},0,0);$=kt(t.minX),k=kt(t.minY),A=kt(t.maxX),E=kt(t.maxY)}else if(h&&Cn(g.element)){let t=r.transform&&"none"!==r.transform?r.transform:"",e=qr(g.element),n=zr({baseTransform:t,rotate:e.rotate||"0deg",scale:e.scale,translate:e.translate}),{ox:l,oy:a}=Vr(r,i,o),s=n.is2D?n:new DOMMatrix(n.toString()),c=Br(i,o,{a:s.a,b:s.b,c:s.c,d:s.d,e:0,f:0},l,a);$=kt(c.minX),k=kt(c.minY),A=kt(c.maxX),E=kt(c.maxY)}let F=function(t){return Ur(t.boxShadow)}(r),N=function(t){return Ur(t.textShadow)}(r),R=function(t){let e,r=t.filter&&"none"!==t.filter?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,i=0;for(;e=n.exec(r);)i+=parseFloat(e[1])||0;let o=Math.ceil(i);return{top:o,right:o,bottom:o,left:o}}(r),L=function(t){if("none"===(t.outlineStyle||"none"))return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),r=parseFloat(t.outlineOffset||"0")||0,n=e+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}(r),P=function(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||"none"===e)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,i=0,o=0,l=0,a=!1;for(let s of r){a=!0;let[t=0,e=0,r=0]=s.match(/-?\d+(?:\.\d+)?px/gi)?.map(t=>parseFloat(t))||[],c=Math.abs(t)+r,u=Math.abs(e)+r;i=Math.max(i,c+Math.max(t,0)),l=Math.max(l,c+Math.max(-t,0)),o=Math.max(o,u+Math.max(e,0)),n=Math.max(n,u+Math.max(-e,0))}return{bleed:{top:kt(n),right:kt(i),bottom:kt(o),left:kt(l)},has:a}}(r),T=c?{top:0,right:0,bottom:0,left:0}:m?{top:kt(Math.max(F.top,N.top)+R.top+L.top+P.bleed.top),right:kt(Math.max(F.right,N.right)+R.right+L.right+P.bleed.right),bottom:kt(Math.max(F.bottom,N.bottom)+R.bottom+L.bottom+P.bleed.bottom),left:kt(Math.max(F.left,N.left)+R.left+L.left+P.bleed.left)}:{top:R.top,right:R.right,bottom:R.bottom,left:R.left};$=kt($-T.left),k=kt(k-T.top),A=kt(A+T.right),E=kt(E+T.bottom);let W=Math.max(1,kt(A-$)),I=Math.max(1,kt(E-k)),_=v||C?kt(x/y):1,O=C||v?kt(S/b):1,D=Math.max(1,kt(W*_)),H=Math.max(1,kt(I*O)),j="http://www.w3.org/2000/svg",U=kt((Cn(g.element)?2:0)+(h?0:1)),B=Math.ceil(W+2*U),V=Math.ceil(I+2*U),q=kt(-(kt($)-U)),z=kt(-(kt(k)-U)),X=Math.max(0,q),Y=Math.max(0,z),G=kt(B-Math.min(0,q)),Q=kt(V-Math.min(0,z)),J=document.createElementNS(j,"foreignObject");J.setAttribute("x",String(Math.min(0,q))),J.setAttribute("y",String(Math.min(0,z))),J.setAttribute("width",String(G)),J.setAttribute("height",String(Q)),J.style.overflow="visible";let K=document.createElement("style");K.textContent=(g.scrollbarCSS||"")+g.baseCSS+g.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}"+g.classCSS,J.appendChild(K);let Z=document.createElement("div");Z.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${Q}px`+(0!==X||0!==Y?`;padding:${Y}px 0 0 ${X}px !important`:""),Z.appendChild(g.clone),J.appendChild(Z);let tt=(new XMLSerializer).serializeToString(J),et=v||C;e.meta={w0:y,h0:b,vbW:B,vbH:V,targetW:x,targetH:S},d=`<svg xmlns="${j}" width="${!et||le()?B:kt(D+2*U)}" height="${!et||le()?V:kt(H+2*U)}" viewBox="0 0 ${B} ${V}" font-size="${parseFloat(re(a.documentElement)?.fontSize)||16}px">`+tt+"</svg>",u=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,g={svgString:d,dataURL:u,...g},t()},{fast:f})}),await yn("afterRender",g);let E=document.getElementById("snapdom-sandbox");return E&&"absolute"===E.style.position&&E.remove(),g.dataURL}function Cn(t){return function(t){let e=re(t),r=e.transform||"none";if("none"!==r&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=e.rotate&&"none"!==e.rotate&&"0deg"!==e.rotate,i=e.scale&&"none"!==e.scale&&"1"!==e.scale,o=e.translate&&"none"!==e.translate&&"0px 0px"!==e.translate;return!!(n||i||o)}(t)}function Mn(t,e,r){let n=new Set;if(t instanceof HTMLVideoElement&&n.add(t),t.querySelectorAll)for(let i of t.querySelectorAll("video"))n.add(i);for(let i of e.trackedVideos)n.has(i)||(i.removeEventListener("timeupdate",r),i.removeEventListener("seeked",r),e.trackedVideos.delete(i));for(let i of n)e.trackedVideos.has(i)||(i.addEventListener("timeupdate",r),i.addEventListener("seeked",r),e.trackedVideos.add(i))}function $n(t){let{burst:e,invalidate:r,...n}=t||{};try{return JSON.stringify(n,Object.keys(n).sort())}catch{return null}}function kn(t,e,r,n){let i=jt.get(t);i||(i=function(t){let e={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},r=t=>{e.capturing||Ce(t)&&(e.dirty=!0)},n=()=>{e.capturing||(e.dirty=!0)},i=t.ownerDocument||document;try{let n=new MutationObserver(r);n.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),e.observers.push(n)}catch{}try{if(i.head){let t=new MutationObserver(r);t.observe(i.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),e.observers.push(t)}}catch{}return e.markDirty=r,e.onMediaDirty=n,Mn(t,e,n),e}(t),i.baselineSignature=$n(e),jt.set(t,i));let o=$n(e),l=null===o||o!==i.baselineSignature,a=async()=>{for(let t of i.observers)i.markDirty(t.takeRecords());if(r.invalidate&&(i.dirty=!0),!l&&!i.dirty&&i.last)return i.last;i.capturing=!0,l||(i.dirty=!1);try{let t=await n();return l||(i.last=t),t}finally{for(let t of i.observers)t.takeRecords();i.capturing=!1,Mn(t,i,i.onMediaDirty)}},s=i.inflight.then(a,a);return i.inflight=s.catch(()=>{}),s}function An(...t){return function(...t){let e=t.flat();for(let r of e){let t=pn(r);t&&(It.some(e=>e&&e.name&&t.name&&e.name===t.name)||It.push(t))}}(...t),Ut}async function En(t,e){if(!t)throw new Error("Element cannot be null or undefined");let r=function(t={}){let e=t.format??"png";"jpg"===e&&(e="jpeg");let r=function(t){if(!0===t)return"soft";if(!1===t)return"disabled";if("string"==typeof t){let e=t.toLowerCase().trim();if("auto"===e)return"auto";if("full"===e)return"full";if("soft"===e||"disabled"===e)return e}return"soft"}(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:!1!==t.placeholders,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[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:r,useProxy:"string"==typeof t.useProxy?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst??!1,invalidate:t.invalidate??!1,clip:t.clip??null,compress:!1!==t.compress,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:!1!==t.resolvePicturePlaceholders,pictureResolver:t.pictureResolver&&"object"==typeof t.pictureResolver?t.pictureResolver:{}}}(e);if(bn(r,e&&e.plugins),le()){if(!0===r.embedFonts)try{let e=function(t,e){return Cr(t,e).required}(t);await Mr(new Set([...e].map(t=>String(t).split("__")[0]).filter(Boolean)),1)}catch{}let i=Array.from(t.querySelectorAll("canvas"));"CANVAS"===t.tagName&&i.unshift(t);for(let t of i)try{let e=t.getContext("2d",{willReadFrequently:!0});e&&e.getImageData(0,0,1,1)}catch(n){ae(e,"safari canvas poke failed",n)}}return r.iconFonts&&r.iconFonts.length>0&&function(t){let e=Array.isArray(t)?t:[t];for(let r of e){let t;if(r instanceof RegExp)t=r;else{if("string"!=typeof r){console.warn("[snapdom] Ignored invalid iconFont value:",r);continue}t=new RegExp(tr(r),"i")}let e=`${t.source}/${t.flags}`;ft.has(e)||(ft.add(e),dt.push(t))}}(r.iconFonts),r.snap||(r.snap={toPng:(t,e)=>Ut.toPng(t,e),toSvg:(t,e)=>Ut.toSvg(t,e)}),r.burst?kn(t,e,r,()=>Ut.capture(t,r,Bt)):Ut.capture(t,r,Bt)}return{setters:[],execute:function(){r=Object.defineProperty,i=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},a=(n=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}})(()=>{o=class extends Map{constructor(t=100,...e){super(...e),this._maxSize=t}set(t,e){if(this.size>=this._maxSize&&!this.has(t)){let t=this.keys().next().value;void 0!==t&&this.delete(t)}return super.set(t,e)}},l={image:new o(100),background:new o(100),resource:new o(150),defaultStyle:new o(30),baseStyle:new o(50),compress:new o(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}}),c=n(()=>{s=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i}),h=n(()=>{c(),u=function(t="[snapDOM]",{ttlMs:e=3e5,maxEntries:r=12}={}){let n=new Map,i=0;function o(o,l,a){if(i>=r)return;let s=Date.now();(n.get(l)||0)>s||(n.set(l,s+e),i++,"warn"===o&&console&&console.warn?console.warn(`${t} ${a}`):console&&console.error&&console.error(`${t} ${a}`))}return{warnOnce(t,e){o("warn",t,e)},errorOnce(t,e){o("error",t,e)},reset(){n.clear(),i=0}}}("[snapDOM]",{ttlMs:18e4,maxEntries:10}),d=new Map,f=new Map}),m=n(()=>{a(),c(),h()}),A=n(()=>{a(),p=new Set(["meta","script","noscript","title","link","template"]),g=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),y=/(?:^|-)(animation|transition)(?:-|$)/i,b=/^(--.+|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,w=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"]),x=new Map,S=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),v=new Set(["table","thead","tbody","tfoot","tr","td","th"]),C=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),M=new Set(["width","max-width","inline-size","max-inline-size"]),$=new Set(["min-width","min-inline-size"]),k=["top","right","bottom","left"]}),E=n(()=>{}),F=n(()=>{}),N=n(()=>{m(),A(),E(),c(),F()}),i(R={},{decodeSvgFromDataURL:()=>se,encodeSvgToDataURL:()=>ce,fixSafariShadows:()=>me,toCanvas:()=>pe}),W=n(()=>{E(),L=16384,P=268435456,T=null}),i(I={},{rasterize:()=>ge}),_=n(()=>{W()}),i(O={},{toImg:()=>ye,toSvg:()=>ye}),D=n(()=>{N(),_(),W()}),i(H={},{toBlob:()=>be}),j=n(()=>{W()}),i(U={},{download:()=>xe}),B=n(()=>{j(),W(),E()}),N(),N(),a(),V=new WeakMap,q=new Map,z=2e3,X=0,Y="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]",G=!1,Q=["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"],J=new WeakMap,A(),K=["fill","stroke","color","background-color","stop-color"],Z=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]),tt=new Map,N(),N(),a(),h(),h(),et="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]",rt=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,nt=new o(80),it=/\bblob:[^)"'\s]+/g,E(),ot=new Map,lt=new Set(["IFRAME"]),at=200,st=new Set(["img","canvas","video","iframe","object","embed"]),ze("IFRAME",Qe),ze("CANVAS",Je),ze("VIDEO",Ke),ze("AUDIO",Ze),N(),c(),A(),a(),a(),ct=[/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],ut=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__||{}),dt=[],ft=new Set,ht=new Map,h(),mt=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),pt=["katex","mathjax","mathml"],gt=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,yt=4,bt=/url\((["']?)([^"')]+)\1\)/g,wt=/@font-face[^{}]*\{[^}]*\}/g,xt=new WeakMap,St=0,h(),vt=new WeakMap,Ct=1e3,a(),N(),A(),Mt=null,$t=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,kt=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,At=.75,Et=/::-webkit-scrollbar(-[a-z]+)?\b/i,Ft=new WeakMap,h(),a(),Nt="http://www.w3.org/1999/xlink",N(),a(),Rt=["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"],Lt=["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"],Pt=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Tt=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"],a(),N(),Wt=128,N(),a(),It=[],a(),_t=.92,Ot=.95,Dt=2e3,Ht=3,a(),E(),F(),jt=new WeakMap,N(),h(),a(),t("t",Ut=Object.assign(En,{plugins:An})),Bt=Symbol("snapdom.internal"),Vt=Symbol("snapdom.internal.silent"),Ut.capture=async(t,e,r)=>{if(r!==Bt)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let n=await vn(t,e),i={img:async(t,e)=>{let{toImg:r}=await Promise.resolve().then(()=>(D(),O));return r(n,{...t,...e||{}})},svg:async(t,e)=>{let{toSvg:r}=await Promise.resolve().then(()=>(D(),O));return r(n,{...t,...e||{}})},canvas:async(t,e)=>{let{toCanvas:r}=await Promise.resolve().then(()=>(W(),R));return r(n,{...t,...e||{}})},blob:async(t,e)=>{let{toBlob:r}=await Promise.resolve().then(()=>(j(),H));return r(n,{...t,...e||{}})},png:async(t,e)=>{let{rasterize:r}=await Promise.resolve().then(()=>(_(),I));return r(n,{...t,...e||{},format:"png"})},jpeg:async(t,e)=>{let{rasterize:r}=await Promise.resolve().then(()=>(_(),I));return r(n,{...t,...e||{},format:"jpeg"})},webp:async(t,e)=>{let{rasterize:r}=await Promise.resolve().then(()=>(_(),I));return r(n,{...t,...e||{},format:"webp"})},download:async(t,e)=>{let{download:r}=await Promise.resolve().then(()=>(B(),U));return r(n,{...t,...e||{}})}},o={};for(let h of["img","svg","canvas","blob","png","jpeg","webp"])o[h]=async t=>i[h](e,{...t||{},[Vt]:!0});o.jpg=o.jpeg;let l=await async function(t,e,r){let n=[],i=gn(e);for(let o of i){let i=o&&"function"==typeof o[t]?o[t]:null;if(!i)continue;let l=await i(e,r);typeof l<"u"&&n.push(l)}return n}("defineExports",{...e,export:{url:n},exports:o}),a=Object.assign({},...l.filter(t=>t&&"object"==typeof t).reverse()),s={...i,...a};s.jpeg&&!s.jpg&&(s.jpg=(t,e)=>s.jpeg(t,e));let c=!1,u=Promise.resolve();async function d(t,r){let i=u.then(async()=>{let i=s[t];if(!i)throw new Error(`[snapdom] Unknown export type: ${t}`);let o=function(t,r){let n={...e,...r||{}};return[t,n.format,n.type].map(t=>"string"==typeof t?t.toLowerCase():"").find(t=>"jpeg"===t||"jpg"===t||"webp"===t)&&(null==n.backgroundColor||"transparent"===n.backgroundColor)&&(n.backgroundColor="#ffffff"),n}(t,r),l={...e,export:{type:t,options:o,url:n}};await yn("beforeExport",l,{format:t,options:o});let a=await i(l,o);return await yn("afterExport",l,{format:t,options:o,result:a}),c||(c=!0,await yn("afterSnap",e)),a});return u=i.catch(()=>{}),i}let f={url:n,toRaw:()=>n,to:(t,e)=>d(t,e),toImg:t=>d("img",t),toSvg:t=>d("svg",t),toCanvas:t=>d("canvas",t),toBlob:t=>d("blob",t),toPng:t=>d("png",t),toJpg:t=>d("jpg",t),toWebp:t=>d("webp",t),download:t=>d("download",t)};for(let h of Object.keys(s)){let t="to"+h.charAt(0).toUpperCase()+h.slice(1);f[t]||(f[t]=t=>d(h,t))}return f},Ut.toRaw=(t,e)=>Ut(t,e).then(t=>t.toRaw()),Ut.toImg=(t,e)=>Ut(t,e).then(t=>t.toImg()),Ut.toSvg=(t,e)=>Ut(t,e).then(t=>t.toSvg()),Ut.toCanvas=(t,e)=>Ut(t,e).then(t=>t.toCanvas()),Ut.toBlob=(t,e)=>Ut(t,e).then(t=>t.toBlob()),Ut.toPng=(t,e)=>Ut(t,{...e,format:"png"}).then(t=>t.toPng()),Ut.toJpg=(t,e)=>Ut(t,{...e,format:"jpeg"}).then(t=>t.toJpg()),Ut.toWebp=(t,e)=>Ut(t,{...e,format:"webp"}).then(t=>t.toWebp()),Ut.download=(t,e)=>Ut(t,e).then(t=>t.download())}}}); |