@zumer/snapdom 1.9.12-dev.2 → 1.9.12-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- (()=>{var Be=Object.defineProperty,Oe=Object.defineProperties;var De=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var ie=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e)=>{for(var n in e||(e={}))He.call(e,n)&&ie(t,n,e[n]);if(se)for(var n of se(e))qe.call(e,n)&&ie(t,n,e[n]);return t},G=(t,e)=>Oe(t,De(e));var F=(t,e,n)=>new Promise((r,o)=>{var a=i=>{try{c(n.next(i))}catch(f){o(f)}},s=i=>{try{c(n.throw(i))}catch(f){o(f)}},c=i=>i.done?r(i.value):Promise.resolve(i.value).then(a,s);c((n=n.apply(t,e)).next())});var g={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function $t(t="soft"){switch(t){case"auto":{g.session.styleMap=new Map,g.session.nodeMap=new Map;return}case"soft":{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap,g.computedStyle=new WeakMap,g.baseStyle=new Map,g.defaultStyle=new Map,g.image=new Map,g.background=new Map,g.resource=new Map,g.font=new Set;return}default:{g.session.styleMap=new Map,g.session.nodeMap=new Map,g.session.styleCache=new WeakMap;return}}}function dt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Ot(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(a=>a.trim());return o.length!==6?`matrix(${r})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(a=>a.trim());return o.length!==16?`matrix3d(${r})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function it(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function je(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,o=0;function a(s,c,i){if(o>=n)return;let f=Date.now();(r.get(c)||0)>f||(r.set(c,f+e),o++,s==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(s,c){a("warn",s,c)},errorOnce(s,c){a("error",s,c)},reset(){r.clear(),o=0}}}var ce=je("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Dt=new Map,Ft=new Map;function ze(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Ve(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,o=new URL(r||".",n),a=new URL(t,n);if(a.origin===o.origin)return!0;let s=a.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch(n){}return!1}function Xe(t,e){if(!e||ze(t)||Ve(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location!="undefined"?r.origin!==location.origin:!0}catch(n){return!!e}}function Ge(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",it(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${it(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function le(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Ke(t,e){var n,r;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(r=e.errorTTL)!=null?r:8e3,t].join("|")}function V(n){return F(this,arguments,function*(t,e={}){var y,E,R;let r=(y=e.as)!=null?y:"blob",o=(E=e.timeout)!=null?E:3e3,a=e.useProxy||"",s=(R=e.errorTTL)!=null?R:8e3,c=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(r==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,M="",S=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],P=/;base64/i.test(M)?atob(S):decodeURIComponent(S),N=new Uint8Array([...P].map(O=>O.charCodeAt(0))),_=new Blob([N],{type:(M||"").split(";")[0]||""});return{ok:!0,data:_,status:200,url:t,fromCache:!1,mime:_.type||""}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let M=yield fetch(t);if(!M.ok)return{ok:!1,data:null,status:M.status,url:t,fromCache:!1,reason:"http_error"};let S=yield M.blob(),A=S.type||M.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield le(S),status:M.status,url:t,fromCache:!1,mime:A}:r==="text"?{ok:!0,data:yield S.text(),status:M.status,url:t,fromCache:!1,mime:A}:{ok:!0,data:S,status:M.status,url:t,fromCache:!1,mime:A}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let f=Ke(t,{as:r,timeout:o,useProxy:a,errorTTL:s}),l=Ft.get(f);if(l&&l.until>Date.now())return G(z({},l.result),{fromCache:!0});l&&Ft.delete(f);let u=Dt.get(f);if(u)return u;let h=Xe(t,a)?Ge(t,a):t,w=e.credentials;if(!w)try{let M=typeof location!="undefined"&&location.href?location.href:"http://localhost/",S=new URL(t,M);w=typeof location!="undefined"&&S.origin===location.origin?"include":"omit"}catch(M){w="omit"}let $=new AbortController,d=setTimeout(()=>$.abort("timeout"),o),p=F(null,null,function*(){var M,S;try{let A=yield fetch(h,{signal:$.signal,credentials:w,headers:c});if(!A.ok){let _={ok:!1,data:null,status:A.status,url:h,fromCache:!1,reason:"http_error"};if(s>0&&Ft.set(f,{until:Date.now()+s,result:_}),!i){let O=`${A.status} ${A.statusText||""}`.trim();ce.warnOnce(`http:${A.status}:${r}:${new URL(t,(M=location==null?void 0:location.href)!=null?M:"http://localhost/").origin}`,`HTTP error ${O} while fetching ${r} ${t}`)}return e.onError&&e.onError(_),_}if(r==="text")return{ok:!0,data:yield A.text(),status:A.status,url:h,fromCache:!1};let P=yield A.blob(),N=P.type||A.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield le(P),status:A.status,url:h,fromCache:!1,mime:N}:{ok:!0,data:P,status:A.status,url:h,fromCache:!1,mime:N}}catch(A){let P=A&&typeof A=="object"&&"name"in A&&A.name==="AbortError"?String(A.message||"").includes("timeout")?"timeout":"abort":"network",N={ok:!1,data:null,status:0,url:h,fromCache:!1,reason:P};if(!/^blob:/i.test(t)&&s>0&&Ft.set(f,{until:Date.now()+s,result:N}),!i){let _=`${P}:${r}:${new URL(t,(S=location==null?void 0:location.href)!=null?S:"http://localhost/").origin}`,O=P==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:P==="abort"?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;ce.errorOnce(_,O)}return e.onError&&e.onError(N),N}finally{clearTimeout(d),Dt.delete(f)}});return Dt.set(f,p),p})}function mt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let r=n.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),n}function ht(n){return F(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=dt(t);if(!o)return t;let a=it(o);if(g.background.has(a)){let s=g.background.get(a);return s?`url("${s}")`:"none"}try{let s=yield V(a,{as:"dataURL",useProxy:e.useProxy});return s.ok?(g.background.set(a,s.data),`url("${s.data}")`):(g.background.set(a,null),"none")}catch(s){return g.background.set(a,null),"none"}})}var vt=new Set(["meta","script","noscript","title","link","template"]),St=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"]),Ye=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function Ht(){for(let t of Ye){let e=String(t).toLowerCase();vt.has(e)||St.has(e)||qt(e)}}function qt(t){if(t=String(t).toLowerCase(),St.has(t)){let a={};return g.defaultStyle.set(t,a),a}if(g.defaultStyle.has(t))return g.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 n=document.createElement(t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),o={};for(let a of r){if(fe(a))continue;let s=r.getPropertyValue(a);o[a]=s}return e.removeChild(n),g.defaultStyle.set(t,o),o}var Je=/(?:^|-)(animation|transition)(?:-|$)/i,Qe=/^(--|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,Ze=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"]);function fe(t){let e=String(t).toLowerCase();return!!(Ze.has(e)||Qe.test(e)||Je.test(e))}function xt(t,e){if(e=String(e||"").toLowerCase(),St.has(e))return"";let n=[],r=qt(e);for(let[o,a]of Object.entries(t)){if(fe(o))continue;let s=r[o];a&&a!==s&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function jt(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function zt(t){let e=new Map;for(let r of t){let o=g.defaultStyle.get(r);if(!o)continue;let a=Object.entries(o).map(([s,c])=>`${s}:${c};`).sort().join("");a&&(e.has(a)||e.set(a,[]),e.get(a).push(r))}let n="";for(let[r,o]of e.entries())n+=`${o.join(",")} { ${r} }
2
- `;return n}function Vt(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let o of e)n.set(o,`c${r++}`);return n}function pt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=g.computedStyle.get(t);if(n||(n=new Map,g.computedStyle.set(t,n)),!n.has(e)){let r=window.getComputedStyle(t,e);n.set(e,r)}return n.get(e)}function Xt(t){let e=t.replace(/^['"]|['"]$/g,"");if(e.startsWith("\\"))try{return String.fromCharCode(parseInt(e.replace("\\",""),16))}catch(n){return e}return e}function Lt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function gt(t){let e=[],n=0,r=0;for(let o=0;o<t.length;o++){let a=t[o];a==="("&&n++,a===")"&&n--,a===","&&n===0&&(e.push(t.slice(r,o).trim()),r=o+1)}return e.push(t.slice(r).trim()),e}function at(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function st(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n}var ue=new WeakMap,Gt=new Map,Kt=0;function Ct(){Kt++}var de=!1;function tn(t=document.documentElement){var e,n;if(!de){de=!0;try{new MutationObserver(()=>Ct()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{new MutationObserver(()=>Ct()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",Ct),(n=r.ready)==null||n.then(()=>Ct()).catch(()=>{}))}catch(r){}}}function en(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let o=0;o<t.length;o++){let a=t[o],s=t.getPropertyValue(a);(a==="background-image"||a==="content")&&s.includes("url(")&&!s.includes("data:")&&(s="none"),n[a]=s}if(e.embedFonts){let o=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let a of o)if(!n[a])try{let s=t.getPropertyValue(a);s&&(n[a]=s)}catch(s){}}return r==="hidden"&&(n.opacity="0"),n}var me=new WeakMap;function nn(t){let e=me.get(t);return e||(e=Object.entries(t).sort((r,o)=>r[0]<o[0]?-1:r[0]>o[0]?1:0).map(([r,o])=>`${r}:${o}`).join(";"),me.set(t,e),e)}function rn(t,e=null,n={}){let r=ue.get(t);if(r&&r.epoch===Kt)return r.snapshot;let o=e||getComputedStyle(t),a=en(o,n);return fn(t,o,a),ue.set(t,{epoch:Kt,snapshot:a}),a}function on(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Gt,defaultStyle:g.defaultStyle,baseStyle:g.baseStyle,image:g.image,resource:g.resource,background:g.background,font:g.font},options:e||{}}:{session:g.session,persist:{snapshotKeyCache:Gt,defaultStyle:g.defaultStyle,baseStyle:g.baseStyle,image:g.image,resource:g.resource,background:g.background,font:g.font},options:t||e||{}}}function yt(t,e,n,r){return F(this,null,function*(){var h,w,$;if(t.tagName==="STYLE")return;let o=on(n,r),a=o.options&&o.options.cache||"auto";if(a!=="disabled"&&tn(document.documentElement),a==="disabled"&&!o.session.__bumpedForDisabled&&(Ct(),Gt.clear(),o.session.__bumpedForDisabled=!0),St.has((h=t.tagName)==null?void 0:h.toLowerCase())){let d=(w=t.getAttribute)==null?void 0:w.call(t,"style");d&&e.setAttribute("style",d)}let{session:s,persist:c}=o;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let i=s.styleCache.get(t),f=rn(t,i,o.options),l=nn(f),u=c.snapshotKeyCache.get(l);if(!u){let d=(($=t.tagName)==null?void 0:$.toLowerCase())||"div";u=xt(f,d),c.snapshotKeyCache.set(l,u)}s.styleMap.set(e,u)})}function an(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function sn(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function cn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function ln(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let o=t.scrollHeight;if(o===0)return!1;let a=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0;return o>a+s}function fn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=e.display||"";if(r.includes("flex")||r.includes("grid")||an(t))return;let o=e.position;o==="absolute"||o==="fixed"||o==="sticky"||e.transform==="none"&&(sn(e)||cn(t)||ln(t,e)&&(delete n.height,delete n["block-size"]))}function Yt(t,e,n){return Promise.all(t.map(r=>new Promise(o=>{function a(){at(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(r,o):a()},{fast:n})}a()})))}function un(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function dn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let o=n?un(r):r;return`:where(${e} ${o})`}).join(", ")}function mn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,o,a)=>{let s=dn(a,e,!0);return`${r}${o}${s}{`}),t):""}function hn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function pn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
3
- `});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let o of r.cssRules)e+=o.cssText+`
4
- `}catch(o){}}catch(n){}return e}function gn(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function yn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function wn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function bn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch(n){}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch(n){}return""}function Sn(t,e,n){let r=[];for(let o of e){let a=bn(t,o);a&&r.push(`${o}: ${a};`)}return r.length?`${n}{${r.join("")}}
5
- `:""}function xn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function Cn(t,e=3){return F(this,null,function*(){let n=()=>{var a;try{return t.contentDocument||((a=t.contentWindow)==null?void 0:a.document)||null}catch(s){return null}},r=n(),o=0;for(;o<e&&(!r||!r.body&&!r.documentElement);)yield new Promise(a=>setTimeout(a,0)),r=n(),o++;return r&&(r.body||r.documentElement)?r:null})}function kn(t){let e=t.getBoundingClientRect(),n=0,r=0,o=0,a=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,r=parseFloat(i.borderRightWidth)||0,o=parseFloat(i.borderTopWidth)||0,a=parseFloat(i.borderBottomWidth)||0}catch(i){}let s=Math.max(0,Math.round(e.width-(n+r))),c=Math.max(0,Math.round(e.height-(o+a)));return{contentWidth:s,contentHeight:c,rect:e}}function An(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(r),()=>{try{r.remove()}catch(o){}}}function En(t,e,n){return F(this,null,function*(){let r=yield Cn(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:a,rect:s}=kn(t),c=n==null?void 0:n.snap;if(!c||typeof c.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=G(z({},n),{scale:1}),f=An(r,o,a),l;try{l=yield c.toPng(r.documentElement,i)}finally{f()}l.style.display="block",l.style.width=`${o}px`,l.style.height=`${a}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),yt(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(s.width)}px`),u.style.height||(u.style.height=`${Math.round(s.height)}px`),u.appendChild(l),u})}function kt(t,e,n){return F(this,null,function*(){var f,l,u,h,w,$;if(!t)throw new Error("Invalid node");let r=new Set,o=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){let d=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||vt.has(d))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let d=document.createElement("div"),p=t.getBoundingClientRect();return d.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let d of n.exclude)try{if((f=t.matches)!=null&&f.call(t,d)){if(n.excludeMode==="hide"){let p=document.createElement("div"),y=t.getBoundingClientRect();return p.style.cssText=`display:inline-block;width:${y.width}px;height:${y.height}px;visibility:hidden;`,p}else if(n.excludeMode==="remove")return null}}catch(p){console.warn(`Invalid selector in exclude option: ${d}`,p)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let d=document.createElement("div"),p=t.getBoundingClientRect();return d.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,d}else if(n.filterMode==="remove")return null}}catch(d){console.warn("Error in filter function:",d)}if(t.tagName==="IFRAME"){let d=!1;try{d=!!(t.contentDocument||(l=t.contentWindow)!=null&&l.document)}catch(p){d=!1}if(d)try{return yield En(t,e,n)}catch(p){console.warn("[SnapDOM] iframe rasterization failed, fallback:",p)}if(n.placeholders){let p=document.createElement("div");return p.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,yt(t,p,e,n),p}else{let p=t.getBoundingClientRect(),y=document.createElement("div");return y.style.cssText=`display:inline-block;width:${p.width}px;height:${p.height}px;visibility:hidden;`,yt(t,y,e,n),y}}if(t.getAttribute("data-capture")==="placeholder"){let d=t.cloneNode(!1);e.nodeMap.set(d,t),yt(t,d,e,n);let p=document.createElement("div");return p.textContent=t.getAttribute("data-placeholder-text")||"",p.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",d.appendChild(p),d}if(t.tagName==="CANVAS"){let d=t.toDataURL(),p=document.createElement("img");return p.src=d,p.width=t.width,p.height=t.height,e.nodeMap.set(p,t),yt(t,p,e,n),p}let s;try{if(s=t.cloneNode(!1),e.nodeMap.set(s,t),t.tagName==="IMG"){yn(t,s);try{let d=t.getBoundingClientRect(),p=Math.round(d.width||0),y=Math.round(d.height||0);if(!p||!y){let E=window.getComputedStyle(t),R=parseFloat(E.width)||0,M=parseFloat(E.height)||0,S=parseInt(t.getAttribute("width")||"",10)||0,A=parseInt(t.getAttribute("height")||"",10)||0,P=t.width||t.naturalWidth||0,N=t.height||t.naturalHeight||0;p=Math.round(p||R||S||P||0),y=Math.round(y||M||A||N||0)}p&&(s.dataset.snapdomWidth=String(p)),y&&(s.dataset.snapdomHeight=String(y))}catch(d){}}}catch(d){throw console.error("[Snapdom] Failed to clone node:",t,d),d}if(t instanceof HTMLTextAreaElement){let d=t.getBoundingClientRect();s.style.width=`${d.width}px`,s.style.height=`${d.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(o=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),yt(t,s,e,n),t.shadowRoot){let A=function(N,_){if(N.nodeType===Node.ELEMENT_NODE&&N.tagName==="STYLE")return _(null);kt(N,e,n).then(O=>{_(O||null)}).catch(O=>{_(null)})};try{let N=t.shadowRoot.querySelectorAll("slot");for(let _ of N){let O=[];try{O=((u=_.assignedNodes)==null?void 0:u.call(_,{flatten:!0}))||((h=_.assignedNodes)==null?void 0:h.call(_))||[]}catch(K){O=((w=_.assignedNodes)==null?void 0:w.call(_))||[]}for(let K of O)r.add(K)}}catch(N){}let d=hn(e),p=`[data-sd="${d}"]`;try{s.setAttribute("data-sd",d)}catch(N){}let y=pn(t.shadowRoot),E=mn(y,p),R=wn(y),M=Sn(t,R,p);gn(s,M+E,d);let S=document.createDocumentFragment(),P=yield Yt(Array.from(t.shadowRoot.childNodes),A,n.fast);S.append(...P.filter(N=>!!N)),s.appendChild(S)}if(t.tagName==="SLOT"){let E=function(M,S){kt(M,e,n).then(A=>{A&&xn(A),S(A||null)}).catch(A=>{S(null)})},d=(($=t.assignedNodes)==null?void 0:$.call(t,{flatten:!0}))||[],p=d.length>0?d:Array.from(t.childNodes),y=document.createDocumentFragment(),R=yield Yt(Array.from(p),E,n.fast);return y.append(...R.filter(M=>!!M)),y}function c(d,p){if(r.has(d))return p(null);kt(d,e,n).then(y=>{p(y||null)}).catch(y=>{p(null)})}let i=yield Yt(Array.from(t.childNodes),c,n.fast);if(s.append(...i.filter(d=>!!d)),o!==null&&s instanceof HTMLSelectElement){s.value=o;for(let d of s.options)d.value===o?d.setAttribute("selected",""):d.removeAttribute("selected")}return a!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=a),s})}var Mn=[/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],Jt=[];function he(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Jt.push(n):typeof n=="string"?Jt.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function Q(t){let e=typeof t=="string"?t:"",n=[...Mn,...Jt];for(let r of n)if(r instanceof RegExp&&r.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 pe(t,e,n,r=32,o="#000"){return F(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let a=window.devicePixelRatio||1;yield document.fonts.ready;let s=document.createElement("span");s.textContent=t,s.style.position="absolute",s.style.visibility="hidden",s.style.fontFamily=`"${e}"`,s.style.fontWeight=n||"normal",s.style.fontSize=`${r}px`,s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.padding="0",s.style.margin="0",document.body.appendChild(s);let c=s.getBoundingClientRect(),i=Math.ceil(c.width),f=Math.ceil(c.height);document.body.removeChild(s);let l=document.createElement("canvas");l.width=i*a,l.height=f*a;let u=l.getContext("2d");return u.scale(a,a),u.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=o,u.fillText(t,0,0),{dataUrl:l.toDataURL(),width:i,height:f}})}var $n=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Rt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!$n.has(n.toLowerCase()))return n}return""}function Nt(t){let e=String(t!=null?t:"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Qt(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Fn(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function vn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let o=Nt(n[1]),a=Nt(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=Nt(e);return{min:r,max:r}}function Ln(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Rn(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let a=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(a,s),max:Math.max(a,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),o=r?parseFloat(r[1]):100;return{min:o,max:o}}function Nn(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(c=>o.endsWith(c)))return!0;let s=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(s)||/\.woff2?(\b|$)/.test(s))return!0;for(let c of e){let i=c.toLowerCase().replace(/\s+/g,"+"),f=c.toLowerCase().replace(/\s+/g,"-");if(s.includes(i)||s.includes(f))return!0}return!1}catch(n){return!1}}function Tn(t){var n;let e=new Set;for(let r of t||[]){let o=(n=String(r).split("__")[0])==null?void 0:n.trim();o&&e.add(o)}return e}function Tt(){return F(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:o=""}={}){var N,_,O,K,et,nt,rt,wt,D,lt,Y,ot,Mt,j,X,J,Z,ft;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let m of t){let[C,x,v,b]=String(m).split("__");if(!C)continue;let k=a.get(C)||[];k.push({w:parseInt(x,10),s:v,st:parseInt(b,10)}),a.set(C,k)}let s=/@import\s+url\(["']?([^"')]+)["']?\)/g,c=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function f(m,C,x,v){if(!a.has(m))return!1;let b=a.get(m),k=vn(x),L=Ln(C),T=Rn(v),I=k.min!==k.max,U=k.min,W=H=>L.kind==="normal"&&H==="normal"||L.kind!=="normal"&&(H==="italic"||H==="oblique"),B=!1;for(let H of b){let tt=I?H.w>=k.min&&H.w<=k.max:H.w===U,ut=W(Qt(H.s)),bt=H.st>=T.min&&H.st<=T.max;if(tt&&ut&&bt){B=!0;break}}if(B)return!0;if(!I)for(let H of b){let tt=W(Qt(H.s)),ut=H.st>=T.min&&H.st<=T.max;if(Math.abs(U-H.w)<=300&&tt&&ut)return!0}return!1}function l(m){if(!m)return[];let C=[],x=m.split(",").map(v=>v.trim()).filter(Boolean);for(let v of x){let b=v.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!b)continue;let k=b[1],L=b[2],T=I=>{if(!I.includes("?"))return parseInt(I,16);let U=parseInt(I.replace(/\?/g,"0"),16),W=parseInt(I.replace(/\?/g,"F"),16);return[U,W]};if(L){let I=T(k),U=T(L),W=Array.isArray(I)?I[0]:I,B=Array.isArray(U)?U[1]:U;C.push([Math.min(W,B),Math.max(W,B)])}else{let I=T(k);Array.isArray(I)?C.push([I[0],I[1]]):C.push([I,I])}}return C}function u(m,C){if(!C.length||!m||m.size===0)return!0;for(let x of m)for(let[v,b]of C)if(x>=v&&x<=b)return!0;return!1}function h(m,C){let x=[];if(!m)return x;for(let v of m.matchAll(c)){let b=(v[2]||"").trim();if(!(!b||b.startsWith("data:"))){if(!/^https?:/i.test(b))try{b=new URL(b,C||location.href).href}catch(k){}x.push(b)}}return x}function w(m,C){return F(this,null,function*(){var v,b,k,L,T;let x=m;for(let I of m.matchAll(c)){let U=dt(I[0]);if(!U)continue;let W=U;if(!W.startsWith("http")&&!W.startsWith("data:"))try{W=new URL(W,C||location.href).href}catch(B){}if(!Q(W)){if((v=g.resource)!=null&&v.has(W)){(b=g.font)==null||b.add(W),x=x.replace(I[0],`url(${g.resource.get(W)})`);continue}if(!((k=g.font)!=null&&k.has(W)))try{let B=yield V(W,{as:"dataURL",useProxy:o,silent:!0});if(B.ok&&typeof B.data=="string"){let H=B.data;(L=g.resource)==null||L.set(W,H),(T=g.font)==null||T.add(W),x=x.replace(I[0],`url(${H})`)}}catch(B){console.warn("[snapDOM] Failed to fetch font resource:",W)}}}return x})}function $(m){if(!m.length)return null;let C=(T,I)=>m.some(([U,W])=>!(W<T||U>I)),x=C(0,255)||C(305,305),v=C(256,591)||C(7680,7935),b=C(880,1023),k=C(1024,1279);return C(7840,7929)||C(258,259)||C(416,417)||C(431,432)?"vietnamese":k?"cyrillic":b?"greek":v?"latin-ext":x?"latin":null}function d(m={}){let C=new Set((m.families||[]).map(b=>String(b).toLowerCase())),x=new Set((m.domains||[]).map(b=>String(b).toLowerCase())),v=new Set((m.subsets||[]).map(b=>String(b).toLowerCase()));return(b,k)=>{if(C.size&&C.has(b.family.toLowerCase()))return!0;if(x.size)for(let L of b.srcUrls)try{if(x.has(new URL(L).host.toLowerCase()))return!0}catch(T){}if(v.size){let L=$(k);if(L&&v.has(L))return!0}return!1}}let p=d(n);function y(m){var k,L,T,I,U,W;if(!m)return m;let C=/@font-face[^{}]*\{[^}]*\}/gi,x=new Set,v=[];for(let B of m.match(C)||[]){let H=((k=B.match(/font-family:\s*([^;]+);/i))==null?void 0:k[1])||"",tt=Rt(H),ut=(((L=B.match(/font-weight:\s*([^;]+);/i))==null?void 0:L[1])||"400").trim(),bt=(((T=B.match(/font-style:\s*([^;]+);/i))==null?void 0:T[1])||"normal").trim(),_e=(((I=B.match(/font-stretch:\s*([^;]+);/i))==null?void 0:I[1])||"100%").trim(),Pe=(((U=B.match(/unicode-range:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),re=(((W=B.match(/src\s*:\s*([^;]+);/i))==null?void 0:W[1])||"").trim(),oe=h(re,location.href),Ue=oe.length?oe.map(We=>String(We).toLowerCase()).sort().join("|"):re.toLowerCase(),ae=[String(tt||"").toLowerCase(),ut,bt,_e,Pe.toLowerCase(),Ue].join("|");x.has(ae)||(x.add(ae),v.push(B))}if(v.length===0)return m;let b=0;return m.replace(C,()=>v[b++]||"")}function E(){let m=Array.from(t||[]).sort().join("|"),C=n?JSON.stringify({families:(n.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(n.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(n.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",x=(r||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.src||""}`).sort().join("|");return`fonts-embed-css::req=${m}::ex=${C}::lf=${x}::px=${o||""}`}let R=E();if((N=g.resource)!=null&&N.has(R))return g.resource.get(R);let M=Tn(t),S=[];for(let m of document.querySelectorAll("style")){let C=m.textContent||"";for(let x of C.matchAll(s)){let v=x[1];if(!v||Q(v))continue;!!document.querySelector(`link[rel="stylesheet"][href="${v}"]`)||S.push(v)}}S.length&&(yield Promise.all(S.map(m=>new Promise(C=>{if(document.querySelector(`link[rel="stylesheet"][href="${m}"]`))return C(null);let x=document.createElement("link");x.rel="stylesheet",x.href=m,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>C(x),x.onerror=()=>C(null),document.head.appendChild(x)}))));let A="",P=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(m=>!!m.href);for(let m of P)try{if(Q(m.href))continue;let C="",x=!1;try{x=new URL(m.href,location.href).origin===location.origin}catch(b){}if(!x&&!Nn(m.href,M))continue;if(x){let b=Array.from(document.styleSheets).find(k=>k.href===m.href);if(b)try{let k=b.cssRules||[];C=Array.from(k).map(L=>L.cssText).join("")}catch(k){}}if(!C&&(C=(yield V(m.href,{as:"text",useProxy:o})).data,Q(m.href)))continue;let v="";for(let b of C.match(i)||[]){let k=(((_=b.match(/font-family:\s*([^;]+);/i))==null?void 0:_[1])||"").trim(),L=Rt(k);if(!L||Q(L))continue;let T=(((O=b.match(/font-weight:\s*([^;]+);/i))==null?void 0:O[1])||"400").trim(),I=(((K=b.match(/font-style:\s*([^;]+);/i))==null?void 0:K[1])||"normal").trim(),U=(((et=b.match(/font-stretch:\s*([^;]+);/i))==null?void 0:et[1])||"100%").trim(),W=(((nt=b.match(/unicode-range:\s*([^;]+);/i))==null?void 0:nt[1])||"").trim(),B=(((rt=b.match(/src\s*:\s*([^;]+);/i))==null?void 0:rt[1])||"").trim(),H=h(B,m.href);if(!f(L,I,T,U))continue;let tt=l(W);if(!u(e,tt))continue;let ut={family:L,weightSpec:T,styleSpec:I,stretchSpec:U,unicodeRange:W,srcRaw:B,srcUrls:H,href:m.href};if(n&&p(ut,tt))continue;let bt=/url\(/i.test(B)?yield w(b,m.href):b;v+=bt+""}v.trim()&&(A+=v+"")}catch(C){console.warn("[snapdom] Failed to process stylesheet:",m.href)}for(let m of document.styleSheets)try{if(m.href&&P.some(x=>x.href===m.href))continue;let C=m.cssRules||[];for(let x of C){if(x.type!==CSSRule.FONT_FACE_RULE)continue;let v=(x.style.getPropertyValue("font-family")||"").trim(),b=Rt(v);if(!b||Q(b))continue;let k=(x.style.getPropertyValue("font-weight")||"400").trim(),L=(x.style.getPropertyValue("font-style")||"normal").trim(),T=(x.style.getPropertyValue("font-stretch")||"100%").trim(),I=(x.style.getPropertyValue("src")||"").trim(),U=(x.style.getPropertyValue("unicode-range")||"").trim(),W=h(I,m.href||location.href);if(!f(b,L,k,T))continue;let B=l(U);if(!u(e,B))continue;let H={family:b,weightSpec:k,styleSpec:L,stretchSpec:T,unicodeRange:U,srcRaw:I,srcUrls:W,href:m.href||location.href};if(!(n&&p(H,B)))if(/url\(/i.test(I)){let tt=yield w(I,m.href||location.href);A+=`@font-face{font-family:${b};src:${tt};font-style:${L};font-weight:${k};font-stretch:${T};${U?`unicode-range:${U};`:""}}`}else A+=`@font-face{font-family:${b};src:${I};font-style:${L};font-weight:${k};font-stretch:${T};${U?`unicode-range:${U};`:""}}`}}catch(C){}try{for(let m of document.fonts||[]){if(!m||!m.family||m.status!=="loaded"||!m._snapdomSrc)continue;let C=String(m.family).replace(/^['"]+|['"]+$/g,"");if(Q(C)||!a.has(C)||n!=null&&n.families&&n.families.some(v=>String(v).toLowerCase()===C.toLowerCase()))continue;let x=m._snapdomSrc;if(!String(x).startsWith("data:")){if((wt=g.resource)!=null&&wt.has(m._snapdomSrc))x=g.resource.get(m._snapdomSrc),(D=g.font)==null||D.add(m._snapdomSrc);else if(!((lt=g.font)!=null&&lt.has(m._snapdomSrc)))try{let v=yield V(m._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(v.ok&&typeof v.data=="string")x=v.data,(Y=g.resource)==null||Y.set(m._snapdomSrc,x),(ot=g.font)==null||ot.add(m._snapdomSrc);else continue}catch(v){console.warn("[snapdom] Failed to fetch dynamic font src:",m._snapdomSrc);continue}}A+=`@font-face{font-family:'${C}';src:url(${x});font-style:${m.style||"normal"};font-weight:${m.weight||"normal"};}`}}catch(m){}for(let m of r){if(!m||typeof m!="object")continue;let C=String(m.family||"").replace(/^['"]+|['"]+$/g,"");if(!C||Q(C)||!a.has(C)||n!=null&&n.families&&n.families.some(T=>String(T).toLowerCase()===C.toLowerCase()))continue;let x=m.weight!=null?String(m.weight):"normal",v=m.style!=null?String(m.style):"normal",b=m.stretchPct!=null?`${m.stretchPct}%`:"100%",k=String(m.src||""),L=k;if(!L.startsWith("data:")){if((Mt=g.resource)!=null&&Mt.has(k))L=g.resource.get(k),(j=g.font)==null||j.add(k);else if(!((X=g.font)!=null&&X.has(k)))try{let T=yield V(k,{as:"dataURL",useProxy:o,silent:!0});if(T.ok&&typeof T.data=="string")L=T.data,(J=g.resource)==null||J.set(k,L),(Z=g.font)==null||Z.add(k);else continue}catch(T){console.warn("[snapdom] Failed to fetch localFonts src:",k);continue}}A+=`@font-face{font-family:'${C}';src:url(${L});font-style:${v};font-weight:${x};font-stretch:${b};}`}return A&&(A=y(A),(ft=g.resource)==null||ft.set(R,A)),A})}function It(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=s=>{let c=Rt(s.fontFamily);if(!c)return;let i=(f,l,u)=>`${c}__${Nt(f)}__${Qt(l)}__${Fn(u)}`;e.add(i(s.fontWeight,s.fontStyle,s.fontStretch))};r(getComputedStyle(t));let o=getComputedStyle(t,"::before");o&&o.content&&o.content!=="none"&&r(o);let a=getComputedStyle(t,"::after");for(a&&a.content&&a.content!=="none"&&r(a);n.nextNode();){let s=n.currentNode,c=getComputedStyle(s);r(c);let i=getComputedStyle(s,"::before");i&&i.content&&i.content!=="none"&&r(i);let f=getComputedStyle(s,"::after");f&&f.content&&f.content!=="none"&&r(f)}return e}function _t(t){let e=new Set,n=o=>{if(o)for(let a of o)e.add(a.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let o=r.currentNode;if(o.nodeType===Node.TEXT_NODE)n(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let a=o;for(let s of["::before","::after"]){let c=getComputedStyle(a,s),i=c==null?void 0:c.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let f=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(f)for(let l of f)try{e.add(parseInt(l.slice(1),16))}catch(u){}}}}}return e}function Pt(t,e=2){return F(this,null,function*(){try{yield document.fonts.ready}catch(o){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let o=document.createElement("div");o.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let a of n){let s=document.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",o.appendChild(s)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)r(),yield new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(a)))})}function be(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function In(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function ge(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ye(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),o="";for(let[a,s]of n)for(;r>=a;)o+=s,r-=a;return e?o:o.toLowerCase()}function we(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return ge(t,!1);case"upper-alpha":return ge(t,!0);case"lower-roman":return ye(t,!1);case"upper-roman":return ye(t,!0);default:return String(Math.max(0,t))}}function Se(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,r=f=>f&&f.tagName==="LI",o=f=>{let l=0,u=f==null?void 0:f.parentElement;if(!u)return 0;for(let h of u.children){if(h===f)break;h.tagName==="LI"&&l++}return l},a=f=>{let l=new Map;for(let[u,h]of f)l.set(u,h.slice());return l},s=(f,l,u)=>{var d,p;let h=a(f),w;try{w=((d=u.style)==null?void 0:d.counterReset)||getComputedStyle(u).counterReset}catch(y){}if(w&&w!=="none")for(let y of w.split(",")){let E=y.trim().split(/\s+/),R=E[0],M=Number.isFinite(Number(E[1]))?Number(E[1]):0;if(!R)continue;let S=l.get(R);if(S&&S.length){let A=S.slice();A.push(M),h.set(R,A)}else h.set(R,[M])}let $;try{$=((p=u.style)==null?void 0:p.counterIncrement)||getComputedStyle(u).counterIncrement}catch(y){}if($&&$!=="none")for(let y of $.split(",")){let E=y.trim().split(/\s+/),R=E[0],M=Number.isFinite(Number(E[1]))?Number(E[1]):1;if(!R)continue;let S=h.get(R)||[];S.length===0&&S.push(0),S[S.length-1]+=M,h.set(R,S)}try{if(getComputedStyle(u).display==="list-item"&&r(u)){let E=u.parentElement,R=1;if(E&&E.tagName==="OL"){let S=E.getAttribute("start"),A=Number.isFinite(Number(S))?Number(S):1,P=o(u),N=u.getAttribute("value");R=Number.isFinite(Number(N))?Number(N):A+P}else R=1+o(u);let M=h.get("list-item")||[];M.length===0&&M.push(0),M[M.length-1]=R,h.set("list-item",M)}}catch(y){}return h},c=(f,l,u)=>{let h=s(u,l,f);e.set(f,h);let w=h;for(let $ of f.children)w=c($,h,w);return h},i=new Map;return c(n,i,i),{get(f,l){var h;let u=(h=e.get(f))==null?void 0:h.get(l);return u&&u.length?u[u.length-1]:0},getStack(f,l){var h;let u=(h=e.get(f))==null?void 0:h.get(l);return u?u.slice():[]}}}function xe(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,o=t.replace(r,(a,s,c)=>{var f,l,u,h;let i=String(c).split(",").map(w=>w.trim());if(s==="counter"){let w=(f=i[0])==null?void 0:f.replace(/^["']|["']$/g,""),$=(i[1]||"decimal").toLowerCase(),d=n.get(e,w);return we(d,$)}else{let w=(l=i[0])==null?void 0:l.replace(/^["']|["']$/g,""),$=(h=(u=i[1])==null?void 0:u.replace(/^["']|["']$/g,""))!=null?h:"",d=(i[2]||"decimal").toLowerCase(),p=n.getStack(e,w);return p.length?p.map(E=>we(E,d)).join($):""}});return In(o)}catch(r){return"- "}}var Ce=null;function Zt(t,e,n,r){return F(this,null,function*(){var s;if(!(t instanceof Element)||!(e instanceof Element))return;for(let c of["::before","::after","::first-letter"])try{let i=pt(t,c);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(c==="::first-letter"){let j=getComputedStyle(t);if(!(i.color!==j.color||i.fontSize!==j.fontSize||i.fontWeight!==j.fontWeight))continue;let J=Array.from(e.childNodes).find(L=>{var T;return L.nodeType===Node.TEXT_NODE&&((T=L.textContent)==null?void 0:T.trim().length)>0});if(!J)continue;let Z=J.textContent,ft=Z.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),m=ft==null?void 0:ft[0],C=Z.slice((m==null?void 0:m.length)||0);if(!m||/[\uD800-\uDFFF]/.test(m))continue;let x=document.createElement("span");x.textContent=m,x.dataset.snapdomPseudo="::first-letter";let v=Lt(i),b=xt(v,"span");n.styleMap.set(x,b);let k=document.createTextNode(C);e.replaceChild(k,J),e.insertBefore(x,k);continue}let l=i.content,u=Xt(l);be(l)&&(Ce=Se(t.ownerDocument||document),u=xe(u,t,Ce));let h=i.backgroundImage,w=i.backgroundColor,$=i.fontFamily,d=parseInt(i.fontSize)||32,p=parseInt(i.fontWeight)||!1,y=i.color||"#000",E=i.display,R=parseFloat(i.width),M=parseFloat(i.height),S=i.borderStyle,A=parseFloat(i.borderWidth),P=i.transform,N=Q($),_=l!=="none"&&u!=="",O=h&&h!=="none",K=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",et=E!=="inline"&&(R>0||M>0),nt=S&&S!=="none"&&A>0,rt=P&&P!=="none";if(!(_||O||K||et||nt||rt))continue;let D=document.createElement("span");D.dataset.snapdomPseudo=c,D.style.verticalAlign="middle";let lt=Lt(i),Y=xt(lt,"span");if(n.styleMap.set(D,Y),N&&u.length===1){let{dataUrl:j,width:X,height:J}=yield pe(u,$,p,d,y),Z=document.createElement("img");Z.src=j,Z.style=`height:${d}px;width:${X/J*d}px;object-fit:contain;`,D.appendChild(Z),e.dataset.snapdomHasIcon="true"}else if(u.startsWith("url(")){let j=dt(u);if(j!=null&&j.trim())try{let X=document.createElement("img"),J=yield V(it(j),{as:"dataURL",useProxy:r.useProxy});X.src=J.data,X.style=`width:${d}px;height:auto;object-fit:contain;`,D.appendChild(X)}catch(X){console.error(`[snapdom] Error in pseudo ${c} for`,t,X)}}else!N&&_&&(D.textContent=u);if(O)try{let j=gt(h),X=yield Promise.all(j.map(ht));D.style.backgroundImage=X.join(", ")}catch(j){console.warn(`[snapdom] Failed to inline background-image for ${c}`,j)}if(K&&(D.style.backgroundColor=w),!(D.childNodes.length>0||((s=D.textContent)==null?void 0:s.trim())!==""||O||K||et||nt||rt))continue;c==="::before"?e.insertBefore(D,e.firstChild):e.appendChild(D)}catch(i){console.warn(`[snapdom] Failed to capture ${c} for`,t,i)}let o=Array.from(t.children),a=Array.from(e.children).filter(c=>!c.dataset.snapdomPseudo);for(let c=0;c<Math.min(o.length,a.length);c++)yield Zt(o[c],a[c],n,r)})}function ke(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(c=>{let i=c.getAttribute("xlink:href")||c.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),r=n.filter(c=>c.tagName.toLowerCase()==="symbol"),o=n.filter(c=>c.tagName.toLowerCase()==="defs"),a=t.querySelector("svg.inline-defs-container");a||(a=document.createElementNS("http://www.w3.org/2000/svg","svg"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),a.classList.add("inline-defs-container"),t.insertBefore(a,t.firstChild));let s=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(c=>{s.add(c.id)}),e.forEach(c=>{if(s.has(c))return;let i=r.find(f=>f.id===c);if(i){a.appendChild(i.cloneNode(!0)),s.add(c);return}for(let f of o){let l=f.querySelector(`#${CSS.escape(c)}`);if(l){let u=a.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),a.appendChild(u)),u.appendChild(l.cloneNode(!0)),s.add(c);break}}})}function Ee(n){return F(this,arguments,function*(t,e={}){var i,f;let r={styleMap:g.session.styleMap,styleCache:g.session.styleCache,nodeMap:g.session.nodeMap},o,a="",s="";_n(t);try{ke(t)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{o=yield kt(t,r,e,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{yield Zt(t,o,r,e)}catch(l){console.warn("inlinePseudoElements failed:",l)}yield Bn(o);try{let l=o.querySelectorAll("style[data-sd]");for(let u of l)s+=u.textContent||"",u.remove()}catch(l){}let c=Vt(r.styleMap);a=Array.from(c.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),a=s+a;for(let[l,u]of r.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let h=c.get(u);h&&l.classList.add(h);let w=(i=l.style)==null?void 0:i.backgroundImage,$=(f=l.dataset)==null?void 0:f.snapdomHasIcon;w&&w!=="none"&&(l.style.backgroundImage=w),$&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of r.nodeMap.entries()){let h=u.scrollLeft,w=u.scrollTop;if((h||w)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let d=document.createElement("div");for(d.style.transform=`translate(${-h}px, ${-w}px)`,d.style.willChange="transform",d.style.display="inline-block",d.style.width="100%";l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d)}}if(t===r.nodeMap.get(o)){let l=r.styleCache.get(t)||window.getComputedStyle(t);r.styleCache.set(t,l);let u=Ot(l.transform);o.style.margin="0",o.style.position="static",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.zIndex="auto",o.style.float="none",o.style.clear="none",o.style.transform=u||""}for(let[l,u]of r.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:o,classCSS:a,styleCache:r.styleCache}})}function _n(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,o=e.borderStyle,a=e.borderWidth,s=n!=="none"&&parseFloat(r)>0,c=o==="none"||parseFloat(a)===0;s&&c&&(t.style.border=`${r} solid transparent`)}var At=new Map;function Et(t){return F(this,null,function*(){var n;if((n=g.resource)!=null&&n.has(t))return g.resource.get(t);if(At.has(t))return At.get(t);let e=F(null,null,function*(){var o;let r=yield V(t,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(o=g.resource)==null||o.set(t,r.data),r.data});At.set(t,e);try{let r=yield e;return At.set(t,r),r}catch(r){throw At.delete(t),r}})}var Pn=/\bblob:[^)"'\s]+/g;function Ae(t){return F(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Pn)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let o=yield Et(r);n=n.split(r).join(o)}catch(o){}return n})}function Ut(t){return typeof t=="string"&&t.startsWith("blob:")}function Un(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Wn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Bn(t){return F(this,null,function*(){var s,c;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let l=i.getAttribute("src")||i.currentSrc||"";if(Ut(l)){let h=yield Et(l);i.setAttribute("src",h)}let u=i.getAttribute("srcset");if(u&&u.includes("blob:")){let h=Un(u),w=!1;for(let $ of h)if(Ut($.url))try{$.url=yield Et($.url),w=!0}catch(d){}w&&i.setAttribute("srcset",Wn(h))}}catch(f){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let f="http://www.w3.org/1999/xlink",l=i.getAttribute("href")||((s=i.getAttributeNS)==null?void 0:s.call(i,f,"href"));if(Ut(l)){let u=yield Et(l);i.setAttribute("href",u),(c=i.removeAttributeNS)==null||c.call(i,f,"href")}}catch(f){}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of r)try{let f=i.getAttribute("style");if(f&&f.includes("blob:")){let l=yield Ae(f);i.setAttribute("style",l)}}catch(f){}let o=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of o)try{let f=i.textContent||"";f.includes("blob:")&&(i.textContent=yield Ae(f))}catch(f){}let a=["poster"];for(let i of a){let f=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let l of f)try{let u=l.getAttribute(i);Ut(u)&&l.setAttribute(i,yield Et(u))}catch(u){}}})}function Me(n){return F(this,arguments,function*(t,e={}){let r=Array.from(t.querySelectorAll("img")),o=a=>F(null,null,function*(){var u,h,w,$;if(!a.getAttribute("src")){let d=a.currentSrc||a.src||"";d&&a.setAttribute("src",d)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=yield V(s,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let d=parseInt(((u=a.dataset)==null?void 0:u.snapdomWidth)||"",10)||0,p=parseInt(((h=a.dataset)==null?void 0:h.snapdomHeight)||"",10)||0,y=parseInt(a.getAttribute("width")||"",10)||0,E=parseInt(a.getAttribute("height")||"",10)||0,R=parseFloat(((w=a.style)==null?void 0:w.width)||"")||0,M=parseFloat((($=a.style)==null?void 0:$.height)||"")||0,S=d||R||y||a.width||void 0,A=p||M||E||a.height||void 0,P=typeof i=="function"?yield i({width:S,height:A,src:s,element:a}):i;if(P){let N=yield V(P,{as:"dataURL",useProxy:e.useProxy});a.src=N.data,!a.width&&S&&(a.width=S),!a.height&&A&&(a.height=A),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}}catch(d){}let f=a.width||a.naturalWidth||100,l=a.height||a.naturalHeight||100;if(e.placeholders!==!1){let d=document.createElement("div");d.style.cssText=[`width:${f}px`,`height:${l}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${l}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",a.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${f}px;height:${l}px;visibility:hidden;`,a.replaceWith(d)}});for(let a=0;a<r.length;a+=4){let s=r.slice(a,a+4).map(o);yield Promise.allSettled(s)}})}function Wt(o,a,s){return F(this,arguments,function*(t,e,n,r={}){let c=[[t,e]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],f=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;c.length;){let[u,h]=c.shift(),w=n.get(u)||pt(u);n.has(u)||n.set(u,w);let $=(()=>{let y=w.getPropertyValue("border-image"),E=w.getPropertyValue("border-image-source");return y&&y!=="none"||E&&E!=="none"})();for(let y of i){let E=w.getPropertyValue(y);if(!E||E==="none")continue;let R=gt(E),M=yield Promise.all(R.map(S=>ht(S,r)));M.some(S=>S&&S!=="none"&&!/^url\(undefined/.test(S))&&h.style.setProperty(y,M.join(", "))}for(let y of f){let E=w.getPropertyValue(y);!E||E==="initial"||h.style.setProperty(y,E)}if($)for(let y of l){let E=w.getPropertyValue(y);!E||E==="initial"||h.style.setProperty(y,E)}let d=Array.from(u.children),p=Array.from(h.children);for(let y=0;y<Math.min(d.length,p.length);y++)c.push([d[y],p[y]])}})}function $e(t){var f;if(!t)return()=>{};let e=On(t);if(e<=0)return()=>{};if(!qn(t))return()=>{};let n=getComputedStyle(t),r=Math.round(Dn(n)*e+Hn(n)),o=(f=t.textContent)!=null?f:"",a=o;if(t.scrollHeight<=r+.5)return()=>{};let s=0,c=o.length,i=-1;for(;s<=c;){let l=s+c>>1;t.textContent=o.slice(0,l)+"\u2026",t.scrollHeight<=r+.5?(i=l,s=l+1):c=l-1}return t.textContent=(i>=0?o.slice(0,i):"")+"\u2026",()=>{t.textContent=a}}function On(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Dn(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Hn(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function qn(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function ee(t,e){return F(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");$t(e.cache);let n=e.fast,r,o,a,s="",c="",i,f,l=$e(t);try{({clone:r,classCSS:o,styleCache:a}=yield Ee(t,e))}finally{l()}yield new Promise($=>{at(()=>F(null,null,function*(){yield Me(r,e),$()}),{fast:n})}),yield new Promise($=>{at(()=>F(null,null,function*(){yield Wt(t,r,a,e),$()}),{fast:n})}),e.embedFonts&&(yield new Promise($=>{at(()=>F(null,null,function*(){let d=It(t),p=_t(t);if(st){let y=new Set(Array.from(d).map(E=>String(E).split("__")[0]).filter(Boolean));yield Pt(y,2)}s=yield Tt({required:d,usedCodepoints:p,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),$()}),{fast:n})}));let u=jt(r).sort(),h=u.join(",");g.baseStyle.has(h)?c=g.baseStyle.get(h):yield new Promise($=>{at(()=>{c=zt(u),g.baseStyle.set(h,c),$()},{fast:n})}),yield new Promise($=>{at(()=>{var m,C,x,v,b;let d=t.getBoundingClientRect(),p=Number(d.width)||0,y=Number(d.height)||0,E=Number.isFinite(e.width),R=Number.isFinite(e.height),M=(m=e.scale)!=null?m:1,S=typeof M=="number"&&M!==1;if(!S){let k=y>0?p/y:1;E&&R?(p=Number(e.width),y=Number(e.height)):E?(p=Number(e.width),y=p/(k||1)):R&&(y=Number(e.height),p=y*(k||1))}p=Math.max(1,Math.ceil(Number.isFinite(p)?p:1)),y=Math.max(1,Math.ceil(Number.isFinite(y)?y:1));let A=getComputedStyle(t),P=A.transform&&A.transform!=="none"?A.transform:"",N=Vn(t),_,O,K,et,nt=0,rt=0;if(Xn(t)){let k=Yn({baseTransform:P,rotate:N.rotate||"0deg",scale:N.scale,translate:N.translate}),L=(x=(C=k.e)!=null?C:k.m41)!=null?x:0,T=(b=(v=k.f)!=null?v:k.m42)!=null?b:0;nt=-L,rt=-T;let I=k.is2D?Fe(k):Fe(new DOMMatrix(k.toString())),U=zn(p,y,I);_=Math.max(1,Math.ceil(U.width)),O=Math.max(1,Math.ceil(U.height)),K=-U.minX,et=-U.minY}else{let k=t.getBoundingClientRect(),L=Gn(k,{top:0,right:0,bottom:0,left:0});_=Math.max(1,L.width),O=Math.max(1,L.height),K=-(L.x-Math.floor(k.left)),et=-(L.y-Math.floor(k.top))}let wt="http://www.w3.org/2000/svg",D=document.createElementNS(wt,"foreignObject");D.setAttribute("width","100%"),D.setAttribute("height","100%"),D.setAttribute("x",String(K)),D.setAttribute("y",String(et)),D.style.overflow="visible";let lt=document.createElement("style");lt.textContent=c+s+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o,D.appendChild(lt);let Y=document.createElement("div");Y.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Y.style.width=`${p}px`,Y.style.height=`${y}px`,Y.style.overflow="visible",Y.style.transformOrigin="0 0";let ot=[];if((nt||rt)&&ot.push(`translate(${nt}px, ${rt}px)`),!S&&(E||R)){let k=d.width?p/d.width:1,L=d.height?y/d.height:1;ot.push(`scale(${k}, ${L})`)}else S&&ot.push(`scale(${M})`);ot.length&&(Y.style.transform=ot.join(" ")),r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.transformOrigin="0 0",r.style.position="static",r.style.left="0",r.style.top="0",P&&(r.style.transform=P),r.style.rotate=N.rotate||"0deg",r.style.scale=N.scale||"1",r.style.translate=N.translate||"0 0",Y.appendChild(r),D.appendChild(Y);let j=new XMLSerializer().serializeToString(D);f=`<svg xmlns="${wt}" width="${!S&&(E||R)?p:_}" height="${!S&&(R||E)?y:O}" viewBox="0 0 ${_} ${O}">`+j+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,$()},{fast:n})});let w=document.getElementById("snapdom-sandbox");return w&&w.style.position==="absolute"&&w.remove(),i})}function jn(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function Fe(t){return new DOMMatrix([t.a,t.b,t.c,t.d,0,0])}function zn(t,e,n){let o=[{x:0,y:0},{x:t,y:0},{x:0,y:e},{x:t,y:e}].map(f=>({x:n.a*f.x+n.c*f.y,y:n.b*f.x+n.d*f.y})),a=Math.min(...o.map(f=>f.x)),s=Math.max(...o.map(f=>f.x)),c=Math.min(...o.map(f=>f.y)),i=Math.max(...o.map(f=>f.y));return{minX:a,minY:c,width:s-a,height:i-c}}function Vn(t){var o,a,s,c,i,f,l,u,h,w,$,d,p;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let y=S=>{try{return typeof n.has=="function"&&!n.has(S)||typeof n.get!="function"?null:n.get(S)}catch(A){return null}},E=y("rotate");if(E){let S=(o=E.angle)!=null?o:E;S&&typeof S=="object"&&"unit"in S?e.rotate=S.unit==="rad"?S.value*180/Math.PI+"deg":S.value+S.unit:e.rotate=String(E)}let R=y("scale");if(R&&R.length){let S=(s=(a=R[0])==null?void 0:a.value)!=null?s:1,A=(i=(c=R[1])==null?void 0:c.value)!=null?i:S;e.scale=`${S} ${A}`}let M=y("translate");if(M&&M.length){let S=(l=(f=M[0])==null?void 0:f.value)!=null?l:0,A=(h=(u=M[1])==null?void 0:u.value)!=null?h:0,P=($=(w=M[0])==null?void 0:w.unit)!=null?$:"px",N=(p=(d=M[1])==null?void 0:d.unit)!=null?p:"px";e.translate=`${S}${P} ${A}${N}`}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}function Xn(t){let e=getComputedStyle(t).transform||"none";return!(e==="none"||e==="matrix(1, 0, 0, 1, 0, 0)"||/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,/i.test(e))}function Gn(t,e){let n=Math.floor(t.left-e.left),r=Math.floor(t.top-e.top),o=Math.ceil(t.width+e.left+e.right),a=Math.ceil(t.height+e.top+e.bottom);return{x:n,y:r,width:o,height:a}}var te=null;function Kn(){if(te)return te;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),te=t,t}function Yn(t){let e=Kn(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let r=jn(n);return e.removeChild(n),r}function Jn(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function ve(t={}){var r,o,a,s,c,i,f,l,u,h,w,$,d,p,y,E,R,M;let e=(r=t.format)!=null?r:"png",n=Jn(t.cache);return{debug:(o=t.debug)!=null?o:!1,fast:(a=t.fast)!=null?a:!0,scale:(s=t.scale)!=null?s:1,exclude:(c=t.exclude)!=null?c:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(f=t.filter)!=null?f:null,filterMode:(l=t.filterMode)!=null?l:"hide",placeholders:t.placeholders!==!1,embedFonts:(u=t.embedFonts)!=null?u:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(h=t.excludeFonts)!=null?h:void 0,fallbackURL:(w=t.fallbackURL)!=null?w:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:($=t.width)!=null?$:null,height:(d=t.height)!=null?d:null,format:e,type:(p=t.type)!=null?p:"svg",quality:(y=t.quality)!=null?y:.92,dpr:(E=t.dpr)!=null?E:window.devicePixelRatio||1,backgroundColor:(R=t.backgroundColor)!=null?R:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:(M=t.filename)!=null?M:"snapDOM"}}function Le(t,e){return F(this,null,function*(){let n=new Image;return n.src=t,yield n.decode(),e.scale!==1&&(n.style.width=`${n.naturalWidth*e.scale}px`,n.style.height=`${n.naturalHeight*e.scale}px`),n})}function ct(t,e){return F(this,null,function*(){let{scale:n,dpr:r}=e,o=new Image;o.crossOrigin="anonymous",o.loading="eager",o.decoding="sync",o.src=t,yield o.decode();let a=o.naturalWidth*n,s=o.naturalHeight*n,c=document.createElement("canvas");c.width=Math.ceil(a*r),c.height=Math.ceil(s*r),c.style.width=`${a}px`,c.style.height=`${s}px`;let i=c.getContext("2d");return r!==1&&i.scale(r,r),i.drawImage(o,0,0,a,s),c})}function Bt(t,e){return F(this,null,function*(){let n=e.type;if(n==="svg"){let a=decodeURIComponent(t.split(",")[1]);return new Blob([a],{type:"image/svg+xml"})}let r=yield ct(t,e),o=e.backgroundColor?mt(r,e.backgroundColor):r;return new Promise(a=>o.toBlob(s=>a(s),`image/${n}`,e.quality))})}function Re(t,e){return F(this,null,function*(){let n=yield ct(t,e),r=e.backgroundColor?mt(n,e.backgroundColor):n,o=new Image;return o.src=r.toDataURL(`image/${e.format}`,e.quality),yield o.decode(),o.style.width=`${r.width/e.dpr}px`,o.style.height=`${r.height/e.dpr}px`,o})}function Ne(t,e){return F(this,null,function*(){if(e.dpr=1,e.format==="svg"){let a=yield Bt(t,G(z({},e),{type:"svg"})),s=URL.createObjectURL(a),c=document.createElement("a");c.href=s,c.download=e.filename,c.click(),URL.revokeObjectURL(s);return}let n=yield ct(t,e),r=e.backgroundColor?mt(n,e.backgroundColor):n,o=document.createElement("a");o.href=r.toDataURL(`image/${e.format}`,e.quality),o.download=e.filename,o.click()})}var Te=Symbol("snapdom.internal"),ne=!1;function q(t,e){return F(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");if(st())for(let r=0;r<3;r++)try{yield Qn(t,e),console.log("Iteraci\xF3n n\xFAmero:",r),ne=!1}catch(o){}let n=ve(e);return n.iconFonts&&n.iconFonts.length>0&&he(n.iconFonts),n.snap||(n.snap={toPng:(r,o)=>q.toPng(r,o),toImg:(r,o)=>q.toImg(r,o)}),q.capture(t,n,Te)})}q.capture=(t,e,n)=>F(null,null,function*(){if(n!==Te)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=yield ee(t,e),o=s=>z(z({},e),s||{}),a=s=>c=>{let i=o(G(z({},c||{}),{format:s})),f=s==="jpeg"||s==="jpg",l=i.backgroundColor==null||i.backgroundColor==="transparent";return f&&l&&(i.backgroundColor="#ffffff"),Re(r,i)};return{url:r,toRaw:()=>r,toImg:s=>Le(r,o(s)),toCanvas:s=>ct(r,o(s)),toBlob:s=>Bt(r,o(s)),toPng:a("png"),toJpg:a("jpeg"),toWebp:a("webp"),download:s=>Ne(r,o(s))}});q.toRaw=(t,e)=>q(t,e).then(n=>n.toRaw());q.toImg=(t,e)=>q(t,e).then(n=>n.toImg());q.toCanvas=(t,e)=>q(t,e).then(n=>n.toCanvas());q.toBlob=(t,e)=>q(t,e).then(n=>n.toBlob());q.toPng=(t,e)=>q(t,G(z({},e),{format:"png"})).then(n=>n.toPng());q.toJpg=(t,e)=>q(t,G(z({},e),{format:"jpeg"})).then(n=>n.toJpg());q.toWebp=(t,e)=>q(t,G(z({},e),{format:"webp"})).then(n=>n.toWebp());q.download=(t,e)=>q(t,e).then(n=>n.download());function Qn(t,e){return F(this,null,function*(){if(ne)return;let n=G(z({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=yield ee(t,n)}catch(o){return}yield new Promise(o=>{let a=new Image;a.decoding="sync",a.loading="eager",a.style.position="fixed",a.style.left=0,a.style.top=0,a.style.width="10px",a.style.height="10px",a.style.opacity="0.01",a.style.transform="translateZ(10px)",a.style.willChange="transform,opacity;",a.src=r;let s=()=>F(null,null,function*(){yield new Promise(c=>setTimeout(c,100)),a&&a.parentNode&&a.parentNode.removeChild(a),ne=!0,o()});document.body.appendChild(a),s()})})}function Ie(){return F(this,arguments,function*(t=document,e={}){var i,f,l,u;let{embedFonts:n=!0,useProxy:r=""}=e,o=(f=(i=e.cache)!=null?i:e.cacheOpt)!=null?f:"full";$t(o);try{yield(l=document.fonts)==null?void 0:l.ready}catch(h){}try{Ht()}catch(h){}g.session=g.session||{},g.session.styleCache||(g.session.styleCache=new WeakMap),g.image=g.image||new Map;try{yield Wt(t,void 0,g.session.styleCache,{useProxy:r})}catch(h){}let a=[],s=[];try{t!=null&&t.querySelectorAll&&(a=Array.from(t.querySelectorAll("img[src]")),s=Array.from(t.querySelectorAll("*")))}catch(h){}let c=[];for(let h of a){let w=(h==null?void 0:h.currentSrc)||(h==null?void 0:h.src);if(w&&!g.image.has(w)){let $=Promise.resolve().then(()=>F(null,null,function*(){let d=yield V(w,{as:"dataURL",useProxy:r});d!=null&&d.ok&&typeof d.data=="string"&&g.image.set(w,d.data)})).catch(()=>{});c.push($)}}for(let h of s){let w="";try{w=pt(h).backgroundImage}catch($){}if(w&&w!=="none"){let $=gt(w);for(let d of $)if(d.startsWith("url(")){let p=Promise.resolve().then(()=>ht(d,G(z({},e),{useProxy:r}))).catch(()=>{});c.push(p)}}}if(n)try{let h=It(t),w=_t(t);if(typeof st=="function"?st():!!st){let d=new Set(Array.from(h).map(p=>String(p).split("__")[0]).filter(Boolean));yield Pt(d,2)}yield Tt({required:h,usedCodepoints:w,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(u=e.useProxy)!=null?u:r})}catch(h){}yield Promise.allSettled(c)})}typeof window!="undefined"&&(window.snapdom=q,window.preCache=Ie);})();
1
+ (()=>{var fn=Object.defineProperty,un=Object.defineProperties;var dn=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var We=(t,e,n)=>e in t?fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J=(t,e)=>{for(var n in e||(e={}))mn.call(e,n)&&We(t,n,e[n]);if(Te)for(var n of Te(e))hn.call(e,n)&&We(t,n,e[n]);return t},Q=(t,e)=>un(t,dn(e));var v=(t,e,n)=>new Promise((o,r)=>{var s=i=>{try{l(n.next(i))}catch(c){r(c)}},a=i=>{try{l(n.throw(i))}catch(c){r(c)}},l=i=>i.done?o(i.value):Promise.resolve(i.value).then(s,a);l((n=n.apply(t,e)).next())});var y={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Yt(t="soft"){switch(t){case"auto":{y.session.styleMap=new Map,y.session.nodeMap=new Map;return}case"soft":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap,y.computedStyle=new WeakMap,y.baseStyle=new Map,y.defaultStyle=new Map,y.image=new Map,y.background=new Map,y.resource=new Map,y.font=new Set;return}default:{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}}}function Nt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function de(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function At(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function pn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(a,l,i){if(r>=n)return;let c=Date.now();(o.get(l)||0)>c||(o.set(l,c+e),r++,a==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(a,l){s("warn",a,l)},errorOnce(a,l){s("error",a,l)},reset(){o.clear(),r=0}}}var _e=pn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),me=new Map,Gt=new Map;function gn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function yn(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,r=new URL(o||".",n),s=new URL(t,n);if(s.origin===r.origin)return!0;let a=s.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch(n){}return!1}function wn(t,e){if(!e||gn(t)||yn(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location!="undefined"?o.origin!==location.origin:!0}catch(n){return!!e}}function bn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",At(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${At(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Pe(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function xn(t,e){var n,o;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(o=e.errorTTL)!=null?o:8e3,t].join("|")}function Z(n){return v(this,arguments,function*(t,e={}){var b,k,R;let o=(b=e.as)!=null?b:"blob",r=(k=e.timeout)!=null?k:3e3,s=e.useProxy||"",a=(R=e.errorTTL)!=null?R:8e3,l=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(o==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(o==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,$="",F=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],T=/;base64/i.test($)?atob(F):decodeURIComponent(F),A=new Uint8Array([...T].map(V=>V.charCodeAt(0))),P=new Blob([A],{type:($||"").split(";")[0]||""});return{ok:!0,data:P,status:200,url:t,fromCache:!1,mime:P.type||""}}catch($){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let $=yield fetch(t);if(!$.ok)return{ok:!1,data:null,status:$.status,url:t,fromCache:!1,reason:"http_error"};let F=yield $.blob(),M=F.type||$.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Pe(F),status:$.status,url:t,fromCache:!1,mime:M}:o==="text"?{ok:!0,data:yield F.text(),status:$.status,url:t,fromCache:!1,mime:M}:{ok:!0,data:F,status:$.status,url:t,fromCache:!1,mime:M}}catch($){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return o==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:o==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=xn(t,{as:o,timeout:r,useProxy:s,errorTTL:a}),h=Gt.get(c);if(h&&h.until>Date.now())return Q(J({},h.result),{fromCache:!0});h&&Gt.delete(c);let f=me.get(c);if(f)return f;let d=wn(t,s)?bn(t,s):t,g=e.credentials;if(!g)try{let $=typeof location!="undefined"&&location.href?location.href:"http://localhost/",F=new URL(t,$);g=typeof location!="undefined"&&F.origin===location.origin?"include":"omit"}catch($){g="omit"}let w=new AbortController,u=setTimeout(()=>w.abort("timeout"),r),m=v(null,null,function*(){var $,F;try{let M=yield fetch(d,{signal:w.signal,credentials:g,headers:l});if(!M.ok){let P={ok:!1,data:null,status:M.status,url:d,fromCache:!1,reason:"http_error"};if(a>0&&Gt.set(c,{until:Date.now()+a,result:P}),!i){let V=`${M.status} ${M.statusText||""}`.trim();_e.warnOnce(`http:${M.status}:${o}:${new URL(t,($=location==null?void 0:location.href)!=null?$:"http://localhost/").origin}`,`HTTP error ${V} while fetching ${o} ${t}`)}return e.onError&&e.onError(P),P}if(o==="text")return{ok:!0,data:yield M.text(),status:M.status,url:d,fromCache:!1};let T=yield M.blob(),A=T.type||M.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Pe(T),status:M.status,url:d,fromCache:!1,mime:A}:{ok:!0,data:T,status:M.status,url:d,fromCache:!1,mime:A}}catch(M){let T=M&&typeof M=="object"&&"name"in M&&M.name==="AbortError"?String(M.message||"").includes("timeout")?"timeout":"abort":"network",A={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:T};if(!/^blob:/i.test(t)&&a>0&&Gt.set(c,{until:Date.now()+a,result:A}),!i){let P=`${T}:${o}:${new URL(t,(F=location==null?void 0:location.href)!=null?F:"http://localhost/").origin}`,V=T==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:T==="abort"?`Request aborted while fetching ${o} ${t}`:`Network/CORS issue while fetching ${o} ${t}. A proxy may be required`;_e.errorOnce(P,V)}return e.onError&&e.onError(A),A}finally{clearTimeout(u),me.delete(c)}});return me.set(c,m),m})}function Lt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}function Rt(n){return v(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Nt(t);if(!r)return t;let s=At(r);if(y.background.has(s)){let a=y.background.get(s);return a?`url("${a}")`:"none"}try{let a=yield Z(s,{as:"dataURL",useProxy:e.useProxy});return a.ok?(y.background.set(s,a.data),`url("${a.data}")`):(y.background.set(s,null),"none")}catch(a){return y.background.set(s,null),"none"}})}var Kt=new Set(["meta","script","noscript","title","link","template"]),Ot=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"]),Sn=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function he(){for(let t of Sn){let e=String(t).toLowerCase();Kt.has(e)||Ot.has(e)||pe(e)}}function pe(t){if(t=String(t).toLowerCase(),Ot.has(t)){let s={};return y.defaultStyle.set(t,s),s}if(y.defaultStyle.has(t))return y.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 n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let s of o){if(Ue(s))continue;let a=o.getPropertyValue(s);r[s]=a}return e.removeChild(n),y.defaultStyle.set(t,r),r}var Cn=/(?:^|-)(animation|transition)(?:-|$)/i,kn=/^(--|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,Mn=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"]);function Ue(t){let e=String(t).toLowerCase();return!!(Mn.has(e)||kn.test(e)||Cn.test(e))}function Ht(t,e){if(e=String(e||"").toLowerCase(),Ot.has(e))return"";let n=[],o=pe(e);for(let[r,s]of Object.entries(t)){if(Ue(r))continue;let a=o[r];s&&s!==a&&n.push(`${r}:${s}`)}return n.sort(),n.join(";")}function ge(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function ye(t){let e=new Map;for(let o of t){let r=y.defaultStyle.get(o);if(!r)continue;let s=Object.entries(r).map(([a,l])=>`${a}:${l};`).sort().join("");s&&(e.has(s)||e.set(s,[]),e.get(s).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
2
+ `;return n}function we(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function It(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=y.computedStyle.get(t);if(n||(n=new Map,y.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Jt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Tt(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&n++,s===")"&&n--,s===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}function xt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function tt(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),o=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||o}var Be=new WeakMap,be=new Map,xe=0;function Dt(){xe++}var Oe=!1;function An(t=document.documentElement){var e,n;if(!Oe){Oe=!0;try{new MutationObserver(()=>Dt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{new MutationObserver(()=>Dt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{let o=document.fonts;o&&((e=o.addEventListener)==null||e.call(o,"loadingdone",Dt),(n=o.ready)==null||n.then(()=>Dt()).catch(()=>{}))}catch(o){}}}function $n(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let s=t[r],a=t.getPropertyValue(s);(s==="background-image"||s==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),n[s]=a}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let s of r)if(!n[s])try{let a=t.getPropertyValue(s);a&&(n[s]=a)}catch(a){}}return o==="hidden"&&(n.opacity="0"),n}var He=new WeakMap;function En(t){let e=He.get(t);return e||(e=Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:o[0]>r[0]?1:0).map(([o,r])=>`${o}:${r}`).join(";"),He.set(t,e),e)}function Fn(t,e=null,n={}){let o=Be.get(t);if(o&&o.epoch===xe)return o.snapshot;let r=e||getComputedStyle(t),s=$n(r,n);return Tn(t,r,s),Be.set(t,{epoch:xe,snapshot:s}),s}function vn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:e||{}}:{session:y.session,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:t||e||{}}}function Wt(t,e,n,o){return v(this,null,function*(){var d,g,w;if(t.tagName==="STYLE")return;let r=vn(n,o),s=r.options&&r.options.cache||"auto";if(s!=="disabled"&&An(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(Dt(),be.clear(),r.session.__bumpedForDisabled=!0),Ot.has((d=t.tagName)==null?void 0:d.toLowerCase())){let u=(g=t.getAttribute)==null?void 0:g.call(t,"style");u&&e.setAttribute("style",u)}let{session:a,persist:l}=r;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let i=a.styleCache.get(t),c=Fn(t,i,r.options),h=En(c),f=l.snapshotKeyCache.get(h);if(!f){let u=((w=t.tagName)==null?void 0:w.toLowerCase())||"div";f=Ht(c,u),l.snapshotKeyCache.set(h,f)}a.styleMap.set(e,f)})}function Nn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Ln(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Rn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function In(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let r=t.scrollHeight;if(r===0)return!1;let s=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return r>s+a}function Tn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||Nn(t))return;let r=e.position;r==="absolute"||r==="fixed"||r==="sticky"||e.transform==="none"&&(Ln(e)||Rn(t)||In(t,e)&&(delete n.height,delete n["block-size"]))}function Se(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function s(){xt(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function Wn(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function _n(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Wn(o):o;return`:where(${e} ${r})`}).join(", ")}function Pn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let a=_n(s,e,!0);return`${o}${r}${a}{`}),t):""}function Un(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Bn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
+ `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
4
+ `}catch(r){}}catch(n){}return e}function On(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Hn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function Dn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function qn(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch(n){}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch(n){}return""}function jn(t,e,n){let o=[];for(let r of e){let s=qn(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
5
+ `:""}function zn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function Vn(t,e=3){return v(this,null,function*(){let n=()=>{var s;try{return t.contentDocument||((s=t.contentWindow)==null?void 0:s.document)||null}catch(a){return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)yield new Promise(s=>setTimeout(s,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null})}function Xn(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,o=parseFloat(i.borderRightWidth)||0,r=parseFloat(i.borderTopWidth)||0,s=parseFloat(i.borderBottomWidth)||0}catch(i){}let a=Math.max(0,Math.round(e.width-(n+o))),l=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:a,contentHeight:l,rect:e}}function Yn(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch(r){}}}function Gn(t,e,n){return v(this,null,function*(){let o=yield Vn(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:a}=Xn(t),l=n==null?void 0:n.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=Q(J({},n),{scale:1}),c=Yn(o,r,s),h;try{h=yield l.toPng(o.documentElement,i)}finally{c()}h.style.display="block",h.style.width=`${r}px`,h.style.height=`${s}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),Wt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(h),f})}function qt(t,e,n){return v(this,null,function*(){var c,h,f,d,g,w;if(!t)throw new Error("Invalid node");let o=new Set,r=null,s=null;if(t.nodeType===Node.ELEMENT_NODE){let u=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Kt.has(u))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let u=document.createElement("div"),m=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if((c=t.matches)!=null&&c.call(t,u)){if(n.excludeMode==="hide"){let m=document.createElement("div"),b=t.getBoundingClientRect();return m.style.cssText=`display:inline-block;width:${b.width}px;height:${b.height}px;visibility:hidden;`,m}else if(n.excludeMode==="remove")return null}}catch(m){console.warn(`Invalid selector in exclude option: ${u}`,m)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let u=document.createElement("div"),m=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(t.tagName==="IFRAME"){let u=!1;try{u=!!(t.contentDocument||(h=t.contentWindow)!=null&&h.document)}catch(m){u=!1}if(u)try{return yield Gn(t,e,n)}catch(m){console.warn("[SnapDOM] iframe rasterization failed, fallback:",m)}if(n.placeholders){let m=document.createElement("div");return m.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,Wt(t,m,e,n),m}else{let m=t.getBoundingClientRect(),b=document.createElement("div");return b.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,Wt(t,b,e,n),b}}if(t.getAttribute("data-capture")==="placeholder"){let u=t.cloneNode(!1);e.nodeMap.set(u,t),Wt(t,u,e,n);let m=document.createElement("div");return m.textContent=t.getAttribute("data-placeholder-text")||"",m.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(m),u}if(t.tagName==="CANVAS"){let u=t.toDataURL(),m=document.createElement("img");return m.src=u,m.width=t.width,m.height=t.height,e.nodeMap.set(m,t),Wt(t,m,e,n),m}let a;try{if(a=t.cloneNode(!1),e.nodeMap.set(a,t),t.tagName==="IMG"){Hn(t,a);try{let u=t.getBoundingClientRect(),m=Math.round(u.width||0),b=Math.round(u.height||0);if(!m||!b){let k=window.getComputedStyle(t),R=parseFloat(k.width)||0,$=parseFloat(k.height)||0,F=parseInt(t.getAttribute("width")||"",10)||0,M=parseInt(t.getAttribute("height")||"",10)||0,T=t.width||t.naturalWidth||0,A=t.height||t.naturalHeight||0;m=Math.round(m||R||F||T||0),b=Math.round(b||$||M||A||0)}m&&(a.dataset.snapdomWidth=String(m)),b&&(a.dataset.snapdomHeight=String(b))}catch(u){}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",t,u),u}if(t instanceof HTMLTextAreaElement){let u=t.getBoundingClientRect();a.style.width=`${u.width}px`,a.style.height=`${u.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),Wt(t,a,e,n),t.shadowRoot){let M=function(A,P){if(A.nodeType===Node.ELEMENT_NODE&&A.tagName==="STYLE")return P(null);qt(A,e,n).then(V=>{P(V||null)}).catch(V=>{P(null)})};try{let A=t.shadowRoot.querySelectorAll("slot");for(let P of A){let V=[];try{V=((f=P.assignedNodes)==null?void 0:f.call(P,{flatten:!0}))||((d=P.assignedNodes)==null?void 0:d.call(P))||[]}catch(rt){V=((g=P.assignedNodes)==null?void 0:g.call(P))||[]}for(let rt of V)o.add(rt)}}catch(A){}let u=Un(e),m=`[data-sd="${u}"]`;try{a.setAttribute("data-sd",u)}catch(A){}let b=Bn(t.shadowRoot),k=Pn(b,m),R=Dn(b),$=jn(t,R,m);On(a,$+k,u);let F=document.createDocumentFragment(),T=yield Se(Array.from(t.shadowRoot.childNodes),M,n.fast);F.append(...T.filter(A=>!!A)),a.appendChild(F)}if(t.tagName==="SLOT"){let k=function($,F){qt($,e,n).then(M=>{M&&zn(M),F(M||null)}).catch(M=>{F(null)})},u=((w=t.assignedNodes)==null?void 0:w.call(t,{flatten:!0}))||[],m=u.length>0?u:Array.from(t.childNodes),b=document.createDocumentFragment(),R=yield Se(Array.from(m),k,n.fast);return b.append(...R.filter($=>!!$)),b}function l(u,m){if(o.has(u))return m(null);qt(u,e,n).then(b=>{m(b||null)}).catch(b=>{m(null)})}let i=yield Se(Array.from(t.childNodes),l,n.fast);if(a.append(...i.filter(u=>!!u)),r!==null&&a instanceof HTMLSelectElement){a.value=r;for(let u of a.options)u.value===r?u.setAttribute("selected",""):u.removeAttribute("selected")}return s!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=s),a})}var Kn=[/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],Ce=[];function De(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Ce.push(n):typeof n=="string"?Ce.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function mt(t){let e=typeof t=="string"?t:"",n=[...Kn,...Ce];for(let o of n)if(o instanceof RegExp&&o.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 qe(t,e,n,o=32,r="#000"){return v(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;yield document.fonts.ready;let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let l=a.getBoundingClientRect(),i=Math.ceil(l.width),c=Math.ceil(l.height);document.body.removeChild(a);let h=document.createElement("canvas");h.width=i*s,h.height=c*s;let f=h.getContext("2d");return f.scale(s,s),f.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=r,f.fillText(t,0,0),{dataUrl:h.toDataURL(),width:i,height:c}})}var Jn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Qt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Jn.has(n.toLowerCase()))return n}return""}function Zt(t){let e=String(t!=null?t:"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ke(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Qn(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Zn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Zt(n[1]),s=Zt(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Zt(e);return{min:o,max:o}}function to(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function eo(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(s,a),max:Math.max(s,a)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function no(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>r.endsWith(l)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let l of e){let i=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-");if(a.includes(i)||a.includes(c))return!0}return!1}catch(n){return!1}}function oo(t){var n;let e=new Set;for(let o of t||[]){let r=(n=String(o).split("__")[0])==null?void 0:n.trim();r&&e.add(r)}return e}function te(){return v(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){var A,P,V,rt,et,ct,lt,ft,_t,q,yt,St,Et,wt,B,j,K,G;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let s=new Map;for(let p of t){let[x,C,N,S]=String(p).split("__");if(!x)continue;let E=s.get(x)||[];E.push({w:parseInt(C,10),s:N,st:parseInt(S,10)}),s.set(x,E)}let a=/@import\s+url\(["']?([^"')]+)["']?\)/g,l=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function c(p,x,C,N){if(!s.has(p))return!1;let S=s.get(p),E=Zn(C),L=to(x),_=eo(N),I=E.min!==E.max,U=E.min,W=D=>L.kind==="normal"&&D==="normal"||L.kind!=="normal"&&(D==="italic"||D==="oblique"),O=!1;for(let D of S){let nt=I?D.w>=E.min&&D.w<=E.max:D.w===U,ut=W(ke(D.s)),bt=D.st>=_.min&&D.st<=_.max;if(nt&&ut&&bt){O=!0;break}}if(O)return!0;if(!I)for(let D of S){let nt=W(ke(D.s)),ut=D.st>=_.min&&D.st<=_.max;if(Math.abs(U-D.w)<=300&&nt&&ut)return!0}return!1}function h(p){if(!p)return[];let x=[],C=p.split(",").map(N=>N.trim()).filter(Boolean);for(let N of C){let S=N.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!S)continue;let E=S[1],L=S[2],_=I=>{if(!I.includes("?"))return parseInt(I,16);let U=parseInt(I.replace(/\?/g,"0"),16),W=parseInt(I.replace(/\?/g,"F"),16);return[U,W]};if(L){let I=_(E),U=_(L),W=Array.isArray(I)?I[0]:I,O=Array.isArray(U)?U[1]:U;x.push([Math.min(W,O),Math.max(W,O)])}else{let I=_(E);Array.isArray(I)?x.push([I[0],I[1]]):x.push([I,I])}}return x}function f(p,x){if(!x.length||!p||p.size===0)return!0;for(let C of p)for(let[N,S]of x)if(C>=N&&C<=S)return!0;return!1}function d(p,x){let C=[];if(!p)return C;for(let N of p.matchAll(l)){let S=(N[2]||"").trim();if(!(!S||S.startsWith("data:"))){if(!/^https?:/i.test(S))try{S=new URL(S,x||location.href).href}catch(E){}C.push(S)}}return C}function g(p,x){return v(this,null,function*(){var N,S,E,L,_;let C=p;for(let I of p.matchAll(l)){let U=Nt(I[0]);if(!U)continue;let W=U;if(!W.startsWith("http")&&!W.startsWith("data:"))try{W=new URL(W,x||location.href).href}catch(O){}if(!mt(W)){if((N=y.resource)!=null&&N.has(W)){(S=y.font)==null||S.add(W),C=C.replace(I[0],`url(${y.resource.get(W)})`);continue}if(!((E=y.font)!=null&&E.has(W)))try{let O=yield Z(W,{as:"dataURL",useProxy:r,silent:!0});if(O.ok&&typeof O.data=="string"){let D=O.data;(L=y.resource)==null||L.set(W,D),(_=y.font)==null||_.add(W),C=C.replace(I[0],`url(${D})`)}}catch(O){console.warn("[snapDOM] Failed to fetch font resource:",W)}}}return C})}function w(p){if(!p.length)return null;let x=(_,I)=>p.some(([U,W])=>!(W<_||U>I)),C=x(0,255)||x(305,305),N=x(256,591)||x(7680,7935),S=x(880,1023),E=x(1024,1279);return x(7840,7929)||x(258,259)||x(416,417)||x(431,432)?"vietnamese":E?"cyrillic":S?"greek":N?"latin-ext":C?"latin":null}function u(p={}){let x=new Set((p.families||[]).map(S=>String(S).toLowerCase())),C=new Set((p.domains||[]).map(S=>String(S).toLowerCase())),N=new Set((p.subsets||[]).map(S=>String(S).toLowerCase()));return(S,E)=>{if(x.size&&x.has(S.family.toLowerCase()))return!0;if(C.size)for(let L of S.srcUrls)try{if(C.has(new URL(L).host.toLowerCase()))return!0}catch(_){}if(N.size){let L=w(E);if(L&&N.has(L))return!0}return!1}}let m=u(n);function b(p){var E,L,_,I,U,W;if(!p)return p;let x=/@font-face[^{}]*\{[^}]*\}/gi,C=new Set,N=[];for(let O of p.match(x)||[]){let D=((E=O.match(/font-family:\s*([^;]+);/i))==null?void 0:E[1])||"",nt=Qt(D),ut=(((L=O.match(/font-weight:\s*([^;]+);/i))==null?void 0:L[1])||"400").trim(),bt=(((_=O.match(/font-style:\s*([^;]+);/i))==null?void 0:_[1])||"normal").trim(),ce=(((I=O.match(/font-stretch:\s*([^;]+);/i))==null?void 0:I[1])||"100%").trim(),le=(((U=O.match(/unicode-range:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),fe=(((W=O.match(/src\s*:\s*([^;]+);/i))==null?void 0:W[1])||"").trim(),ue=d(fe,location.href),X=ue.length?ue.map(z=>String(z).toLowerCase()).sort().join("|"):fe.toLowerCase(),H=[String(nt||"").toLowerCase(),ut,bt,ce,le.toLowerCase(),X].join("|");C.has(H)||(C.add(H),N.push(O))}if(N.length===0)return p;let S=0;return p.replace(x,()=>N[S++]||"")}function k(){let p=Array.from(t||[]).sort().join("|"),x=n?JSON.stringify({families:(n.families||[]).map(S=>String(S).toLowerCase()).sort(),domains:(n.domains||[]).map(S=>String(S).toLowerCase()).sort(),subsets:(n.subsets||[]).map(S=>String(S).toLowerCase()).sort()}):"",C=(o||[]).map(S=>`${(S.family||"").toLowerCase()}::${S.weight||"normal"}::${S.style||"normal"}::${S.src||""}`).sort().join("|");return`fonts-embed-css::req=${p}::ex=${x}::lf=${C}::px=${r||""}`}let R=k();if((A=y.resource)!=null&&A.has(R))return y.resource.get(R);let $=oo(t),F=[];for(let p of document.querySelectorAll("style")){let x=p.textContent||"";for(let C of x.matchAll(a)){let N=C[1];if(!N||mt(N))continue;!!document.querySelector(`link[rel="stylesheet"][href="${N}"]`)||F.push(N)}}F.length&&(yield Promise.all(F.map(p=>new Promise(x=>{if(document.querySelector(`link[rel="stylesheet"][href="${p}"]`))return x(null);let C=document.createElement("link");C.rel="stylesheet",C.href=p,C.setAttribute("data-snapdom","injected-import"),C.onload=()=>x(C),C.onerror=()=>x(null),document.head.appendChild(C)}))));let M="",T=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(p=>!!p.href);for(let p of T)try{if(mt(p.href))continue;let x="",C=!1;try{C=new URL(p.href,location.href).origin===location.origin}catch(S){}if(!C&&!no(p.href,$))continue;if(C){let S=Array.from(document.styleSheets).find(E=>E.href===p.href);if(S)try{let E=S.cssRules||[];x=Array.from(E).map(L=>L.cssText).join("")}catch(E){}}if(!x&&(x=(yield Z(p.href,{as:"text",useProxy:r})).data,mt(p.href)))continue;let N="";for(let S of x.match(i)||[]){let E=(((P=S.match(/font-family:\s*([^;]+);/i))==null?void 0:P[1])||"").trim(),L=Qt(E);if(!L||mt(L))continue;let _=(((V=S.match(/font-weight:\s*([^;]+);/i))==null?void 0:V[1])||"400").trim(),I=(((rt=S.match(/font-style:\s*([^;]+);/i))==null?void 0:rt[1])||"normal").trim(),U=(((et=S.match(/font-stretch:\s*([^;]+);/i))==null?void 0:et[1])||"100%").trim(),W=(((ct=S.match(/unicode-range:\s*([^;]+);/i))==null?void 0:ct[1])||"").trim(),O=(((lt=S.match(/src\s*:\s*([^;]+);/i))==null?void 0:lt[1])||"").trim(),D=d(O,p.href);if(!c(L,I,_,U))continue;let nt=h(W);if(!f(e,nt))continue;let ut={family:L,weightSpec:_,styleSpec:I,stretchSpec:U,unicodeRange:W,srcRaw:O,srcUrls:D,href:p.href};if(n&&m(ut,nt))continue;let bt=/url\(/i.test(O)?yield g(S,p.href):S;N+=bt+""}N.trim()&&(M+=N+"")}catch(x){console.warn("[snapdom] Failed to process stylesheet:",p.href)}for(let p of document.styleSheets)try{if(p.href&&T.some(C=>C.href===p.href))continue;let x=p.cssRules||[];for(let C of x){if(C.type!==CSSRule.FONT_FACE_RULE)continue;let N=(C.style.getPropertyValue("font-family")||"").trim(),S=Qt(N);if(!S||mt(S))continue;let E=(C.style.getPropertyValue("font-weight")||"400").trim(),L=(C.style.getPropertyValue("font-style")||"normal").trim(),_=(C.style.getPropertyValue("font-stretch")||"100%").trim(),I=(C.style.getPropertyValue("src")||"").trim(),U=(C.style.getPropertyValue("unicode-range")||"").trim(),W=d(I,p.href||location.href);if(!c(S,L,E,_))continue;let O=h(U);if(!f(e,O))continue;let D={family:S,weightSpec:E,styleSpec:L,stretchSpec:_,unicodeRange:U,srcRaw:I,srcUrls:W,href:p.href||location.href};if(!(n&&m(D,O)))if(/url\(/i.test(I)){let nt=yield g(I,p.href||location.href);M+=`@font-face{font-family:${S};src:${nt};font-style:${L};font-weight:${E};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}else M+=`@font-face{font-family:${S};src:${I};font-style:${L};font-weight:${E};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}}catch(x){}try{for(let p of document.fonts||[]){if(!p||!p.family||p.status!=="loaded"||!p._snapdomSrc)continue;let x=String(p.family).replace(/^['"]+|['"]+$/g,"");if(mt(x)||!s.has(x)||n!=null&&n.families&&n.families.some(N=>String(N).toLowerCase()===x.toLowerCase()))continue;let C=p._snapdomSrc;if(!String(C).startsWith("data:")){if((ft=y.resource)!=null&&ft.has(p._snapdomSrc))C=y.resource.get(p._snapdomSrc),(_t=y.font)==null||_t.add(p._snapdomSrc);else if(!((q=y.font)!=null&&q.has(p._snapdomSrc)))try{let N=yield Z(p._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(N.ok&&typeof N.data=="string")C=N.data,(yt=y.resource)==null||yt.set(p._snapdomSrc,C),(St=y.font)==null||St.add(p._snapdomSrc);else continue}catch(N){console.warn("[snapdom] Failed to fetch dynamic font src:",p._snapdomSrc);continue}}M+=`@font-face{font-family:'${x}';src:url(${C});font-style:${p.style||"normal"};font-weight:${p.weight||"normal"};}`}}catch(p){}for(let p of o){if(!p||typeof p!="object")continue;let x=String(p.family||"").replace(/^['"]+|['"]+$/g,"");if(!x||mt(x)||!s.has(x)||n!=null&&n.families&&n.families.some(_=>String(_).toLowerCase()===x.toLowerCase()))continue;let C=p.weight!=null?String(p.weight):"normal",N=p.style!=null?String(p.style):"normal",S=p.stretchPct!=null?`${p.stretchPct}%`:"100%",E=String(p.src||""),L=E;if(!L.startsWith("data:")){if((Et=y.resource)!=null&&Et.has(E))L=y.resource.get(E),(wt=y.font)==null||wt.add(E);else if(!((B=y.font)!=null&&B.has(E)))try{let _=yield Z(E,{as:"dataURL",useProxy:r,silent:!0});if(_.ok&&typeof _.data=="string")L=_.data,(j=y.resource)==null||j.set(E,L),(K=y.font)==null||K.add(E);else continue}catch(_){console.warn("[snapdom] Failed to fetch localFonts src:",E);continue}}M+=`@font-face{font-family:'${x}';src:url(${L});font-style:${N};font-weight:${C};font-stretch:${S};}`}return M&&(M=b(M),(G=y.resource)==null||G.set(R,M)),M})}function ee(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=a=>{let l=Qt(a.fontFamily);if(!l)return;let i=(c,h,f)=>`${l}__${Zt(c)}__${ke(h)}__${Qn(f)}`;e.add(i(a.fontWeight,a.fontStyle,a.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let s=getComputedStyle(t,"::after");for(s&&s.content&&s.content!=="none"&&o(s);n.nextNode();){let a=n.currentNode,l=getComputedStyle(a);o(l);let i=getComputedStyle(a,"::before");i&&i.content&&i.content!=="none"&&o(i);let c=getComputedStyle(a,"::after");c&&c.content&&c.content!=="none"&&o(c)}return e}function ne(t){let e=new Set,n=r=>{if(r)for(let s of r)e.add(s.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let s=r;for(let a of["::before","::after"]){let l=getComputedStyle(s,a),i=l==null?void 0:l.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let c=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let h of c)try{e.add(parseInt(h.slice(1),16))}catch(f){}}}}}return e}function oe(t,e=2){return v(this,null,function*(){try{yield document.fonts.ready}catch(r){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let s of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",r.appendChild(a)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),yield new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s)))})}function Xe(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function ro(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function je(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function ze(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],o=Math.max(1,Math.min(3999,t)),r="";for(let[s,a]of n)for(;o>=s;)r+=a,o-=s;return e?r:r.toLowerCase()}function Ve(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return je(t,!1);case"upper-alpha":return je(t,!0);case"lower-roman":return ze(t,!1);case"upper-roman":return ze(t,!0);default:return String(Math.max(0,t))}}function Ye(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=c=>c&&c.tagName==="LI",r=c=>{let h=0,f=c==null?void 0:c.parentElement;if(!f)return 0;for(let d of f.children){if(d===c)break;d.tagName==="LI"&&h++}return h},s=c=>{let h=new Map;for(let[f,d]of c)h.set(f,d.slice());return h},a=(c,h,f)=>{var u,m;let d=s(c),g;try{g=((u=f.style)==null?void 0:u.counterReset)||getComputedStyle(f).counterReset}catch(b){}if(g&&g!=="none")for(let b of g.split(",")){let k=b.trim().split(/\s+/),R=k[0],$=Number.isFinite(Number(k[1]))?Number(k[1]):0;if(!R)continue;let F=h.get(R);if(F&&F.length){let M=F.slice();M.push($),d.set(R,M)}else d.set(R,[$])}let w;try{w=((m=f.style)==null?void 0:m.counterIncrement)||getComputedStyle(f).counterIncrement}catch(b){}if(w&&w!=="none")for(let b of w.split(",")){let k=b.trim().split(/\s+/),R=k[0],$=Number.isFinite(Number(k[1]))?Number(k[1]):1;if(!R)continue;let F=d.get(R)||[];F.length===0&&F.push(0),F[F.length-1]+=$,d.set(R,F)}try{if(getComputedStyle(f).display==="list-item"&&o(f)){let k=f.parentElement,R=1;if(k&&k.tagName==="OL"){let F=k.getAttribute("start"),M=Number.isFinite(Number(F))?Number(F):1,T=r(f),A=f.getAttribute("value");R=Number.isFinite(Number(A))?Number(A):M+T}else R=1+r(f);let $=d.get("list-item")||[];$.length===0&&$.push(0),$[$.length-1]=R,d.set("list-item",$)}}catch(b){}return d},l=(c,h,f)=>{let d=a(f,h,c);e.set(c,d);let g=d;for(let w of c.children)g=l(w,d,g);return d},i=new Map;return l(n,i,i),{get(c,h){var d;let f=(d=e.get(c))==null?void 0:d.get(h);return f&&f.length?f[f.length-1]:0},getStack(c,h){var d;let f=(d=e.get(c))==null?void 0:d.get(h);return f?f.slice():[]}}}function Ge(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,r=t.replace(o,(s,a,l)=>{var c,h,f,d;let i=String(l).split(",").map(g=>g.trim());if(a==="counter"){let g=(c=i[0])==null?void 0:c.replace(/^["']|["']$/g,""),w=(i[1]||"decimal").toLowerCase(),u=n.get(e,g);return Ve(u,w)}else{let g=(h=i[0])==null?void 0:h.replace(/^["']|["']$/g,""),w=(d=(f=i[1])==null?void 0:f.replace(/^["']|["']$/g,""))!=null?d:"",u=(i[2]||"decimal").toLowerCase(),m=n.getStack(e,g);return m.length?m.map(k=>Ve(k,u)).join(w):""}});return ro(r)}catch(o){return"- "}}var jt=null,zt=new WeakMap;function so(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function ao(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):so(t)}function Me(t,e){let n=t.parentElement,o=n?zt.get(n):null;return o?{get(r,s){let a=e.get(r,s),l=o.get(s);return typeof l=="number"?Math.max(a,l):a},getStack(r,s){let a=e.getStack(r,s);if(!a.length)return a;let l=o.get(s);if(typeof l=="number"){let i=a.slice();return i[i.length-1]=Math.max(i[i.length-1],l),i}return a}}:e}function Ae(t,e,n){let o=new Map;function r(i){let c=[];if(!i||i==="none")return c;for(let h of String(i).split(",")){let f=h.trim().split(/\s+/),d=f[0],g=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;d&&c.push({name:d,num:g})}return c}let s=r(e==null?void 0:e.counterReset),a=r(e==null?void 0:e.counterIncrement);function l(i){if(o.has(i))return o.get(i).slice();let c=n.getStack(t,i);c=c.length?c.slice():[];let h=s.find(d=>d.name===i);if(h){let d=Number.isFinite(h.num)?h.num:0;c=c.length?[...c,d]:[d]}let f=a.find(d=>d.name===i);if(f){let d=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=d}return o.set(i,c.slice()),c}return{get(i,c){let h=l(c);return h.length?h[h.length-1]:0},getStack(i,c){return l(c)},__incs:a}}function io(t,e,n){let o;try{o=getComputedStyle(t,e)}catch(c){}let r=o==null?void 0:o.content;if(!r||r==="none"||r==="normal")return{text:"",incs:[]};let s=Me(t,n),a=Ae(t,o,s),l=Xe(r)?Ge(r,t,a):r;return{text:ao(l),incs:a.__incs||[]}}function $e(t,e,n,o){return v(this,null,function*(){var a;if(!(t instanceof Element)||!(e instanceof Element))return;if(!jt)try{jt=Ye(t.ownerDocument||document)}catch(l){}for(let l of["::before","::after","::first-letter"])try{let i=It(t,l);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(l==="::first-letter"){let B=getComputedStyle(t);if(!(i.color!==B.color||i.fontSize!==B.fontSize||i.fontWeight!==B.fontWeight))continue;let K=Array.from(e.childNodes).find(_=>{var I;return _.nodeType===Node.TEXT_NODE&&((I=_.textContent)==null?void 0:I.trim().length)>0});if(!K)continue;let G=K.textContent,p=G.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),x=p==null?void 0:p[0],C=G.slice((x==null?void 0:x.length)||0);if(!x||/[\uD800-\uDFFF]/.test(x))continue;let N=document.createElement("span");N.textContent=x,N.dataset.snapdomPseudo="::first-letter";let S=Jt(i),E=Ht(S,"span");n.styleMap.set(N,E);let L=document.createTextNode(C);e.replaceChild(L,K),e.insertBefore(N,L);continue}let h=i.content,{text:f,incs:d}=io(t,l,jt),g=i.backgroundImage,w=i.backgroundColor,u=i.fontFamily,m=parseInt(i.fontSize)||32,b=parseInt(i.fontWeight)||!1,k=i.color||"#000",R=i.display,$=parseFloat(i.width),F=parseFloat(i.height),M=i.borderStyle,T=parseFloat(i.borderWidth),A=i.transform,P=mt(u),V=h!=="none"&&f!=="",rt=g&&g!=="none",et=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",ct=R!=="inline"&&($>0||F>0),lt=M&&M!=="none"&&T>0,ft=A&&A!=="none";if(!(V||rt||et||lt||ft)){if(d&&d.length&&t.parentElement){let B=zt.get(t.parentElement)||new Map;for(let{name:j,num:K}of d){if(!j)continue;let G=Me(t,jt),x=Ae(t,getComputedStyle(t,l),G).get(t,j);B.set(j,x)}zt.set(t.parentElement,B)}continue}let q=document.createElement("span");q.dataset.snapdomPseudo=l,q.style.verticalAlign="middle",q.style.pointerEvents="none";let yt=Jt(i),St=Ht(yt,"span");if(n.styleMap.set(q,St),P&&f&&f.length===1){let{dataUrl:B,width:j,height:K}=yield qe(f,u,b,m,k),G=document.createElement("img");G.src=B,G.style=`height:${m}px;width:${j/K*m}px;object-fit:contain;`,q.appendChild(G),e.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let B=Nt(f);if(B!=null&&B.trim())try{let j=document.createElement("img"),K=yield Z(At(B),{as:"dataURL",useProxy:o.useProxy});j.src=K.data,j.style=`width:${m}px;height:auto;object-fit:contain;`,q.appendChild(j)}catch(j){console.error(`[snapdom] Error in pseudo ${l} for`,t,j)}}else!P&&V&&(q.textContent=f);if(q.style.background="none","mask"in q.style&&(q.style.mask="none"),rt)try{let B=Tt(g),j=yield Promise.all(B.map(Rt));q.style.backgroundImage=j.join(", ")}catch(B){console.warn(`[snapdom] Failed to inline background-image for ${l}`,B)}et&&(q.style.backgroundColor=w);let wt=q.childNodes.length>0||((a=q.textContent)==null?void 0:a.trim())!==""||rt||et||lt||ft;if(d&&d.length&&t.parentElement){let B=zt.get(t.parentElement)||new Map,j=Me(t,jt),K=Ae(t,getComputedStyle(t,l),j);for(let{name:G}of d){if(!G)continue;let p=K.get(t,G);B.set(G,p)}zt.set(t.parentElement,B)}if(!wt)continue;l==="::before"?e.insertBefore(q,e.firstChild):e.appendChild(q)}catch(i){console.warn(`[snapdom] Failed to capture ${l} for`,t,i)}let r=Array.from(t.children),s=Array.from(e.children).filter(l=>!l.dataset.snapdomPseudo);for(let l=0;l<Math.min(r.length,s.length);l++)yield $e(r[l],s[l],n,o)})}function Ke(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(l=>{let i=l.getAttribute("xlink:href")||l.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(l=>l.tagName.toLowerCase()==="symbol"),r=n.filter(l=>l.tagName.toLowerCase()==="defs"),s=t.querySelector("svg.inline-defs-container");s||(s=document.createElementNS("http://www.w3.org/2000/svg","svg"),s.setAttribute("aria-hidden","true"),s.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),s.classList.add("inline-defs-container"),t.insertBefore(s,t.firstChild));let a=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(l=>{a.add(l.id)}),e.forEach(l=>{if(a.has(l))return;let i=o.find(c=>c.id===l);if(i){s.appendChild(i.cloneNode(!0)),a.add(l);return}for(let c of r){let h=c.querySelector(`#${CSS.escape(l)}`);if(h){let f=s.querySelector("defs");f||(f=document.createElementNS("http://www.w3.org/2000/svg","defs"),s.appendChild(f)),f.appendChild(h.cloneNode(!0)),a.add(l);break}}})}function Qe(t,e){var l;if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),r=t.clientHeight,s="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let i=a.currentNode,c=getComputedStyle(i),h=c.position;if(h!=="sticky"&&h!=="-webkit-sticky")continue;let f=Je(c.top),d=Je(c.bottom);if(f==null&&d==null)continue;let g=co(i,t),w=lo(e,g,s);if(!w)continue;let u=i.getBoundingClientRect(),m=u.width,b=u.height,k=u.left-o.left;if(!(m>0&&b>0)||!Number.isFinite(k))continue;let R=f!=null?f+n:n+(r-b-d);if(!Number.isFinite(R))continue;let $=Number.parseInt(c.zIndex,10),F=Number.isFinite($),M=F?Math.max($,1)+1:2,T=F?$-1:0,A=w.cloneNode(!1);A.setAttribute(s,"1"),A.style.position="sticky",A.style.left=`${k}px`,A.style.top=`${R}px`,A.style.width=`${m}px`,A.style.height=`${b}px`,A.style.visibility="hidden",A.style.zIndex=String(T),A.style.overflow="hidden",A.style.background="transparent",A.style.boxShadow="none",A.style.filter="none",(l=w.parentElement)==null||l.insertBefore(A,w),w.style.position="absolute",w.style.left=`${k}px`,w.style.top=`${R}px`,w.style.bottom="auto",w.style.zIndex=String(M),w.style.pointerEvents="none"}}function Je(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function co(t,e){let n=[];for(let o=t;o&&o!==e;){let r=o.parentElement;if(!r)break;n.push(Array.prototype.indexOf.call(r.children,o)),o=r}return n.reverse()}function lo(t,e,n){let o=t;for(let r=0;r<e.length;r++)if(o=fo(o,n)[e[r]],!o)return null;return o instanceof HTMLElement?o:null}function fo(t,e){let n=[],o=t.children;for(let r=0;r<o.length;r++){let s=o[r];s.hasAttribute(e)||n.push(s)}return n}function tn(n){return v(this,arguments,function*(t,e={}){var c,h;let o={styleMap:y.session.styleMap,styleCache:y.session.styleCache,nodeMap:y.session.nodeMap},r,s="",a="";uo(t);try{Ke(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{r=yield qt(t,o,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield $e(t,r,o,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield go(r);try{let f=r.querySelectorAll("style[data-sd]");for(let d of f)a+=d.textContent||"",d.remove()}catch(f){}let l=we(o.styleMap);s=Array.from(l.entries()).map(([f,d])=>`.${d}{${f}}`).join(""),s=a+s;for(let[f,d]of o.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",d.replace(/;/g,"; "));continue}let g=l.get(d);g&&f.classList.add(g);let w=(c=f.style)==null?void 0:c.backgroundImage,u=(h=f.dataset)==null?void 0:h.snapdomHasIcon;w&&w!=="none"&&(f.style.backgroundImage=w),u&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,d]of o.nodeMap.entries()){let g=d.scrollLeft,w=d.scrollTop;if((g||w)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-g}px, ${-w}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";f.firstChild;)m.appendChild(f.firstChild);f.appendChild(m)}}let i=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Qe(t,i),t===o.nodeMap.get(r)){let f=o.styleCache.get(t)||window.getComputedStyle(t);o.styleCache.set(t,f);let d=de(f.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=d||""}for(let[f,d]of o.nodeMap.entries())d.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:r,classCSS:s,styleCache:o.styleCache}})}function uo(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,a=n!=="none"&&parseFloat(o)>0,l=r==="none"||parseFloat(s)===0;a&&l&&(t.style.border=`${o} solid transparent`)}var Vt=new Map;function Xt(t){return v(this,null,function*(){var n;if((n=y.resource)!=null&&n.has(t))return y.resource.get(t);if(Vt.has(t))return Vt.get(t);let e=v(null,null,function*(){var r;let o=yield Z(t,{as:"dataURL",silent:!0});if(!o.ok||typeof o.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(r=y.resource)==null||r.set(t,o.data),o.data});Vt.set(t,e);try{let o=yield e;return Vt.set(t,o),o}catch(o){throw Vt.delete(t),o}})}var mo=/\bblob:[^)"'\s]+/g;function Ze(t){return v(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(mo)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=yield Xt(o);n=n.split(o).join(r)}catch(r){}return n})}function re(t){return typeof t=="string"&&t.startsWith("blob:")}function ho(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function po(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function go(t){return v(this,null,function*(){var a,l;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let h=i.getAttribute("src")||i.currentSrc||"";if(re(h)){let d=yield Xt(h);i.setAttribute("src",d)}let f=i.getAttribute("srcset");if(f&&f.includes("blob:")){let d=ho(f),g=!1;for(let w of d)if(re(w.url))try{w.url=yield Xt(w.url),g=!0}catch(u){}g&&i.setAttribute("srcset",po(d))}}catch(c){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let c="http://www.w3.org/1999/xlink",h=i.getAttribute("href")||((a=i.getAttributeNS)==null?void 0:a.call(i,c,"href"));if(re(h)){let f=yield Xt(h);i.setAttribute("href",f),(l=i.removeAttributeNS)==null||l.call(i,c,"href")}}catch(c){}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of o)try{let c=i.getAttribute("style");if(c&&c.includes("blob:")){let h=yield Ze(c);i.setAttribute("style",h)}}catch(c){}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of r)try{let c=i.textContent||"";c.includes("blob:")&&(i.textContent=yield Ze(c))}catch(c){}let s=["poster"];for(let i of s){let c=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let h of c)try{let f=h.getAttribute(i);re(f)&&h.setAttribute(i,yield Xt(f))}catch(f){}}})}function en(n){return v(this,arguments,function*(t,e={}){let o=Array.from(t.querySelectorAll("img")),r=s=>v(null,null,function*(){var f,d,g,w;if(!s.getAttribute("src")){let u=s.currentSrc||s.src||"";u&&s.setAttribute("src",u)}s.removeAttribute("srcset"),s.removeAttribute("sizes");let a=s.src||"";if(!a)return;let l=yield Z(a,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){s.src=l.data,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let u=parseInt(((f=s.dataset)==null?void 0:f.snapdomWidth)||"",10)||0,m=parseInt(((d=s.dataset)==null?void 0:d.snapdomHeight)||"",10)||0,b=parseInt(s.getAttribute("width")||"",10)||0,k=parseInt(s.getAttribute("height")||"",10)||0,R=parseFloat(((g=s.style)==null?void 0:g.width)||"")||0,$=parseFloat(((w=s.style)==null?void 0:w.height)||"")||0,F=u||R||b||s.width||void 0,M=m||$||k||s.height||void 0,T=typeof i=="function"?yield i({width:F,height:M,src:a,element:s}):i;if(T){let A=yield Z(T,{as:"dataURL",useProxy:e.useProxy});s.src=A.data,!s.width&&F&&(s.width=F),!s.height&&M&&(s.height=M),s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}}catch(u){}let c=s.width||s.naturalWidth||100,h=s.height||s.naturalHeight||100;if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${c}px`,`height:${h}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${h}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",s.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${c}px;height:${h}px;visibility:hidden;`,s.replaceWith(u)}});for(let s=0;s<o.length;s+=4){let a=o.slice(s,s+4).map(r);yield Promise.allSettled(a)}})}function se(r,s,a){return v(this,arguments,function*(t,e,n,o={}){let l=[[t,e]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],c=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],h=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;l.length;){let[f,d]=l.shift(),g=n.get(f)||It(f);n.has(f)||n.set(f,g);let w=(()=>{let b=g.getPropertyValue("border-image"),k=g.getPropertyValue("border-image-source");return b&&b!=="none"||k&&k!=="none"})();for(let b of i){let k=g.getPropertyValue(b);if(!k||k==="none")continue;let R=Tt(k),$=yield Promise.all(R.map(F=>Rt(F,o)));$.some(F=>F&&F!=="none"&&!/^url\(undefined/.test(F))&&d.style.setProperty(b,$.join(", "))}for(let b of c){let k=g.getPropertyValue(b);!k||k==="initial"||d.style.setProperty(b,k)}if(w)for(let b of h){let k=g.getPropertyValue(b);!k||k==="initial"||d.style.setProperty(b,k)}let u=Array.from(f.children),m=Array.from(d.children);for(let b=0;b<Math.min(u.length,m.length);b++)l.push([u[b],m[b]])}})}function nn(t){var c;if(!t)return()=>{};let e=yo(t);if(e<=0)return()=>{};if(!xo(t))return()=>{};let n=getComputedStyle(t),o=Math.round(wo(n)*e+bo(n)),r=(c=t.textContent)!=null?c:"",s=r;if(t.scrollHeight<=o+.5)return()=>{};let a=0,l=r.length,i=-1;for(;a<=l;){let h=a+l>>1;t.textContent=r.slice(0,h)+"\u2026",t.scrollHeight<=o+.5?(i=h,a=h+1):l=h-1}return t.textContent=(i>=0?r.slice(0,i):"")+"\u2026",()=>{t.textContent=s}}function yo(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function wo(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function bo(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function xo(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function Fe(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Yt(e.cache);let n=e.fast,o,r,s,a="",l="",i,c,h=nn(t);try{({clone:o,classCSS:r,styleCache:s}=yield tn(t,e))}finally{h()}yield new Promise(w=>{xt(()=>v(null,null,function*(){yield en(o,e),w()}),{fast:n})}),yield new Promise(w=>{xt(()=>v(null,null,function*(){yield se(t,o,s,e),w()}),{fast:n})}),e.embedFonts&&(yield new Promise(w=>{xt(()=>v(null,null,function*(){let u=ee(t),m=ne(t);if(tt()){let b=new Set(Array.from(u).map(k=>String(k).split("__")[0]).filter(Boolean));yield oe(b,2)}a=yield te({required:u,usedCodepoints:m,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),w()}),{fast:n})}));let f=ge(o).sort(),d=f.join(",");y.baseStyle.has(d)?l=y.baseStyle.get(d):yield new Promise(w=>{xt(()=>{l=ye(f),y.baseStyle.set(d,l),w()},{fast:n})}),yield new Promise(w=>{xt(()=>{let u=getComputedStyle(t);function m(X){var Ct;let H=`${X.filter||""} ${X.webkitFilter||""}`.trim();if(!H||H==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let z=H.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],st=0,at=0,dt=0,ot=0,Ft=!1;for(let Pt of z){Ft=!0;let vt=((Ct=Pt.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:Ct.map(Mt=>parseFloat(Mt)))||[],[it=0,kt=0,ht=0]=vt,pt=Math.abs(it)+ht,gt=Math.abs(kt)+ht;at=Math.max(at,pt+Math.max(it,0)),ot=Math.max(ot,pt+Math.max(-it,0)),dt=Math.max(dt,gt+Math.max(kt,0)),st=Math.max(st,gt+Math.max(-kt,0))}return{bleed:{top:Math.ceil(st),right:Math.ceil(at),bottom:Math.ceil(dt),left:Math.ceil(ot)},has:Ft}}function b(X){var Ft;let H=X.boxShadow||"";if(!H||H==="none")return{top:0,right:0,bottom:0,left:0};let z=H.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(Ct=>Ct.trim()),st=0,at=0,dt=0,ot=0;for(let Ct of z){let Pt=((Ft=Ct.match(/-?\d+(\.\d+)?px/g))==null?void 0:Ft.map(Mt=>parseFloat(Mt)))||[];if(Pt.length<2)continue;let[vt,it,kt=0,ht=0]=Pt,pt=Math.abs(vt)+kt+ht,gt=Math.abs(it)+kt+ht;at=Math.max(at,pt+Math.max(vt,0)),ot=Math.max(ot,pt+Math.max(-vt,0)),dt=Math.max(dt,gt+Math.max(it,0)),st=Math.max(st,gt+Math.max(-it,0))}return{top:Math.ceil(st),right:Math.ceil(at),bottom:Math.ceil(dt),left:Math.ceil(ot)}}function k(X){let H=(X.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),z=H?Math.ceil(parseFloat(H[1])||0):0;return{top:z,right:z,bottom:z,left:z}}function R(X){if((X.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let H=Math.ceil(parseFloat(X.outlineWidth||"0")||0);return{top:H,right:H,bottom:H,left:H}}function $(X,H,z,st,at){let dt=z.a,ot=z.b,Ft=z.c,Ct=z.d,Pt=z.e||0,vt=z.f||0;function it(Ut,Bt){let Ne=Ut-st,Le=Bt-at,Re=dt*Ne+Ft*Le,Ie=ot*Ne+Ct*Le;return Re+=st+Pt,Ie+=at+vt,[Re,Ie]}let kt=[it(0,0),it(X,0),it(0,H),it(X,H)],ht=1/0,pt=1/0,gt=-1/0,Mt=-1/0;for(let[Ut,Bt]of kt)Ut<ht&&(ht=Ut),Bt<pt&&(pt=Bt),Ut>gt&&(gt=Ut),Bt>Mt&&(Mt=Bt);return{minX:ht,minY:pt,maxX:gt,maxY:Mt,width:gt-ht,height:Mt-pt}}function F(X){return ko(X)}let M=t.getBoundingClientRect(),T=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(u.width)||M.width||1)),A=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(u.height)||M.height||1)),P=(X,H=NaN)=>{let z=typeof X=="string"?parseFloat(X):X;return Number.isFinite(z)?z:H},V=P(e.width),rt=P(e.height),et=T,ct=A,lt=Number.isFinite(V),ft=Number.isFinite(rt),_t=A>0?T/A:1;lt&&ft?(et=Math.max(1,Math.ceil(V)),ct=Math.max(1,Math.ceil(rt))):lt?(et=Math.max(1,Math.ceil(V)),ct=Math.max(1,Math.ceil(et/(_t||1)))):ft?(ct=Math.max(1,Math.ceil(rt)),et=Math.max(1,Math.ceil(ct*(_t||1)))):(et=T,ct=A);let q=0,yt=0,St=T,Et=A;if(F(t)){let X=u.transform&&u.transform!=="none"?u.transform:"",H=Co(t),z=$o({baseTransform:X,rotate:H.rotate||"0deg",scale:H.scale,translate:H.translate}),{ox:st,oy:at}=Mo(u,T,A),dt=z.is2D?z:new DOMMatrix(z.toString()),ot=$(T,A,dt,st,at);q=ot.minX,yt=ot.minY,St=ot.maxX,Et=ot.maxY}let wt=b(u),B=k(u),j=R(u),K=m(u),G={top:wt.top+B.top+j.top+K.bleed.top,right:wt.right+B.right+j.right+K.bleed.right,bottom:wt.bottom+B.bottom+j.bottom+K.bleed.bottom,left:wt.left+B.left+j.left+K.bleed.left};q-=G.left,yt-=G.top,St+=G.right,Et+=G.bottom;let p=Math.max(1,Math.ceil(St-q)),x=Math.max(1,Math.ceil(Et-yt)),C=Math.max(1,Math.round(p*(lt||ft?et/T:1))),N=Math.max(1,Math.round(x*(ft||lt?ct/A:1))),S="http://www.w3.org/2000/svg",E=tt()?1:0,L=document.createElementNS(S,"foreignObject"),_=Math.floor(q),I=Math.floor(yt);L.setAttribute("x",String(-(_-E))),L.setAttribute("y",String(-(I-E))),L.setAttribute("width",String(Math.ceil(T+E*2))),L.setAttribute("height",String(Math.ceil(A+E*2))),L.style.overflow="visible";let U=document.createElement("style");U.textContent=l+a+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r,L.appendChild(U);let W=document.createElement("div");W.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),W.style.width=`${T}px`,W.style.height=`${A}px`,W.style.overflow="visible",o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),W.appendChild(o),L.appendChild(W);let D=new XMLSerializer().serializeToString(L),nt=p+E*2,ut=x+E*2,bt=lt||ft;e.meta={w0:T,h0:A,vbW:nt,vbH:ut,targetW:et,targetH:ct};let ce=tt()&&bt?nt:C+E*2,le=tt()&&bt?ut:N+E*2;c=`<svg xmlns="${S}" width="${ce}" height="${le}" viewBox="0 0 ${nt} ${ut}">`+D+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,w()},{fast:n})});let g=document.getElementById("snapdom-sandbox");return g&&g.style.position==="absolute"&&g.remove(),i})}function So(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function Co(t){var r,s,a,l,i,c,h,f;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let d=m=>{try{return typeof n.has=="function"&&!n.has(m)||typeof n.get!="function"?null:n.get(m)}catch(b){return null}},g=d("rotate");if(g)if(g.angle){let m=g.angle;e.rotate=m.unit==="rad"?m.value*180/Math.PI+"deg":m.value+m.unit}else g.unit?e.rotate=g.unit==="rad"?g.value*180/Math.PI+"deg":g.value+g.unit:e.rotate=String(g);else{let m=getComputedStyle(t);e.rotate=m.rotate&&m.rotate!=="none"?m.rotate:"0deg"}let w=d("scale");if(w){let m="x"in w&&((r=w.x)==null?void 0:r.value)!=null?w.x.value:Array.isArray(w)?(s=w[0])==null?void 0:s.value:Number(w)||1,b="y"in w&&((a=w.y)==null?void 0:a.value)!=null?w.y.value:Array.isArray(w)?(l=w[1])==null?void 0:l.value:m;e.scale=`${m} ${b}`}else{let m=getComputedStyle(t);e.scale=m.scale&&m.scale!=="none"?m.scale:null}let u=d("translate");if(u){let m="x"in u&&"value"in u.x?u.x.value:Array.isArray(u)?(i=u[0])==null?void 0:i.value:0,b="y"in u&&"value"in u.y?u.y.value:Array.isArray(u)?(c=u[1])==null?void 0:c.value:0,k="x"in u&&((h=u.x)!=null&&h.unit)?u.x.unit:"px",R="y"in u&&((f=u.y)!=null&&f.unit)?u.y.unit:"px";e.translate=`${m}${k} ${b}${R}`}else{let m=getComputedStyle(t);e.translate=m.translate&&m.translate!=="none"?m.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function ko(t){let e=getComputedStyle(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",s=e.scale&&e.scale!=="none"&&e.scale!=="1",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||a)}function Mo(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],a=(l,i)=>{let c=l.toLowerCase();return c==="left"||c==="top"?0:c==="center"?i/2:c==="right"||c==="bottom"?i:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*i/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:a(r,e),oy:a(s,n)}}var Ee=null;function Ao(){if(Ee)return Ee;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),Ee=t,t}function $o(t){let e=Ao(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=So(n);return e.removeChild(n),o}function Eo(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function on(t={}){var o,r,s,a,l,i,c,h,f,d,g,w,u,m,b,k,R,$;let e=(o=t.format)!=null?o:"png",n=Eo(t.cache);return{debug:(r=t.debug)!=null?r:!1,fast:(s=t.fast)!=null?s:!0,scale:(a=t.scale)!=null?a:1,exclude:(l=t.exclude)!=null?l:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(c=t.filter)!=null?c:null,filterMode:(h=t.filterMode)!=null?h:"hide",placeholders:t.placeholders!==!1,embedFonts:(f=t.embedFonts)!=null?f:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(d=t.excludeFonts)!=null?d:void 0,fallbackURL:(g=t.fallbackURL)!=null?g:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(w=t.width)!=null?w:null,height:(u=t.height)!=null?u:null,format:e,type:(m=t.type)!=null?m:"svg",quality:(b=t.quality)!=null?b:.92,dpr:(k=t.dpr)!=null?k:window.devicePixelRatio||1,backgroundColor:(R=t.backgroundColor)!=null?R:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:($=t.filename)!=null?$:"snapDOM"}}function Fo(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function vo(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function No(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Lo(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&o++,s===")"&&(o=Math.max(0,o-1)),s===";"&&o===0?(e.push(n),n=""):n+=s}return n.trim()&&e.push(n),e.map(r=>r.trim()).filter(Boolean)}function Ro(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let a=t[s];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===","&&o===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let a=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",i="0px",c="0px"]=a,h=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!h&&h!==",";r.push(`drop-shadow(${l} ${i} ${c}${f?` ${h}`:""})`)}return r.join(" ")}function rn(t){let e=Lo(t),n=null,o=null,r=null,s=[];for(let l of e){let i=l.indexOf(":");if(i<0)continue;let c=l.slice(0,i).trim().toLowerCase(),h=l.slice(i+1).trim();c==="box-shadow"?r=h:c==="filter"?n=h:c==="-webkit-filter"?o=h:s.push([c,h])}if(r){let l=Ro(r);l&&(n=n?`${n} ${l}`:l,o=o?`${o} ${l}`:l)}let a=[...s];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([l,i])=>`${l}:${i}`).join(";")}function Io(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${rn(o)}}`)}function To(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Io(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${rn(o)}${n}`),t}function Wo(t){if(!tt()||!Fo(t))return t;try{let e=vo(t),n=To(e);return No(n)}catch(e){return t}}function $t(t,e){return v(this,null,function*(){let{width:n,height:o,scale:r=1,dpr:s=1,meta:a={}}=e;t=Wo(t);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,yield l.decode();let i=l.naturalWidth,c=l.naturalHeight,h=Number.isFinite(a.w0)?a.w0:i,f=Number.isFinite(a.h0)?a.h0:c,d,g,w=Number.isFinite(n),u=Number.isFinite(o);if(w&&u)d=Math.max(1,n),g=Math.max(1,o);else if(w){let k=n/Math.max(1,h);d=n,g=Math.round(f*k)}else if(u){let k=o/Math.max(1,f);g=o,d=Math.round(h*k)}else d=i,g=c;d=Math.round(d*r),g=Math.round(g*r);let m=document.createElement("canvas");m.width=Math.ceil(d*s),m.height=Math.ceil(g*s),m.style.width=`${d}px`,m.style.height=`${g}px`;let b=m.getContext("2d");return s!==1&&b.scale(s,s),b.drawImage(l,0,0,d,g),m})}function ae(t,e){return v(this,null,function*(){let n=yield $t(t,e),o=e.backgroundColor?Lt(n,e.backgroundColor):n,r=new Image;return r.src=o.toDataURL(`image/${e.format}`,e.quality),yield r.decode(),r.style.width=`${o.width/e.dpr}px`,r.style.height=`${o.height/e.dpr}px`,r})}function sn(t,e){return v(this,null,function*(){let{scale:n=1,width:o,height:r,meta:s={}}=e,a=Number.isFinite(o),l=Number.isFinite(r),i=Number.isFinite(n)&&n!==1||a||l;if(tt()&&i)return yield ae(t,Q(J({},e),{format:"png",quality:1,meta:s}));let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,yield c.decode(),a&&l)c.style.width=`${o}px`,c.style.height=`${r}px`;else if(a){let h=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,d=o/Math.max(1,h);c.style.width=`${o}px`,c.style.height=`${Math.round(f*d)}px`}else if(l){let h=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,d=r/Math.max(1,f);c.style.height=`${r}px`,c.style.width=`${Math.round(h*d)}px`}else n!==1&&(c.style.width=`${Math.round(c.naturalWidth*n)}px`,c.style.height=`${Math.round(c.naturalHeight*n)}px`);return c})}function ie(t,e){return v(this,null,function*(){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=yield $t(t,e),r=e.backgroundColor?Lt(o,e.backgroundColor):o;return new Promise(s=>r.toBlob(a=>s(a),`image/${n}`,e.quality))})}function an(t,e){return v(this,null,function*(){if(e.dpr=1,e.format==="svg"){let s=yield ie(t,Q(J({},e),{type:"svg"})),a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e.filename,l.click(),URL.revokeObjectURL(a);return}let n=yield $t(t,e),o=e.backgroundColor?Lt(n,e.backgroundColor):n,r=document.createElement("a");r.href=o.toDataURL(`image/${e.format}`,e.quality),r.download=e.filename,r.click()})}var cn=Symbol("snapdom.internal"),ve=!1;function Y(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=on(e);if(tt()&&(n.embedFonts===!0||Po(t)))for(let o=0;o<3;o++)try{yield _o(t,e),console.log("Iteraci\xF3n n\xFAmero:",o),ve=!1}catch(r){}return n.iconFonts&&n.iconFonts.length>0&&De(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>Y.toPng(o,r),toImg:(o,r)=>Y.toImg(o,r)}),Y.capture(t,n,cn)})}Y.capture=(t,e,n)=>v(null,null,function*(){if(n!==cn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=yield Fe(t,e),r=a=>J(J({},e),a||{}),s=a=>l=>{let i=r(Q(J({},l||{}),{format:a})),c=a==="jpeg"||a==="jpg",h=i.backgroundColor==null||i.backgroundColor==="transparent";return c&&h&&(i.backgroundColor="#ffffff"),ae(o,i)};return{url:o,toRaw:()=>o,toImg:a=>sn(o,r(a)),toCanvas:a=>$t(o,r(a)),toBlob:a=>ie(o,r(a)),toPng:s("png"),toJpg:s("jpeg"),toWebp:s("webp"),download:a=>an(o,r(a))}});Y.toRaw=(t,e)=>Y(t,e).then(n=>n.toRaw());Y.toImg=(t,e)=>Y(t,e).then(n=>n.toImg());Y.toCanvas=(t,e)=>Y(t,e).then(n=>n.toCanvas());Y.toBlob=(t,e)=>Y(t,e).then(n=>n.toBlob());Y.toPng=(t,e)=>Y(t,Q(J({},e),{format:"png"})).then(n=>n.toPng());Y.toJpg=(t,e)=>Y(t,Q(J({},e),{format:"jpeg"})).then(n=>n.toJpg());Y.toWebp=(t,e)=>Y(t,Q(J({},e),{format:"webp"})).then(n=>n.toWebp());Y.download=(t,e)=>Y(t,e).then(n=>n.download());function _o(t,e){return v(this,null,function*(){if(ve)return;let n=Q(J({},e),{fast:!0,embedFonts:!0,scale:.2}),o;try{o=yield Fe(t,n)}catch(r){return}yield new Promise(r=>{let s=new Image;s.decoding="sync",s.loading="eager",s.style.position="fixed",s.style.left=0,s.style.top=0,s.style.width="10px",s.style.height="10px",s.style.opacity="0.01",s.style.transform="translateZ(10px)",s.style.willChange="transform,opacity;",s.src=o;let a=()=>v(null,null,function*(){yield new Promise(l=>setTimeout(l,100)),s&&s.parentNode&&s.parentNode.removeChild(s),ve=!0,r()});document.body.appendChild(s),a()})})}function Po(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),r=o.backgroundImage&&o.backgroundImage!=="none",s=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(r||s)return!0}return!1}function ln(){return v(this,arguments,function*(t=document,e={}){var i,c,h,f;let{embedFonts:n=!0,useProxy:o=""}=e,r=(c=(i=e.cache)!=null?i:e.cacheOpt)!=null?c:"full";Yt(r);try{yield(h=document.fonts)==null?void 0:h.ready}catch(d){}try{he()}catch(d){}y.session=y.session||{},y.session.styleCache||(y.session.styleCache=new WeakMap),y.image=y.image||new Map;try{yield se(t,void 0,y.session.styleCache,{useProxy:o})}catch(d){}let s=[],a=[];try{t!=null&&t.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch(d){}let l=[];for(let d of s){let g=(d==null?void 0:d.currentSrc)||(d==null?void 0:d.src);if(g&&!y.image.has(g)){let w=Promise.resolve().then(()=>v(null,null,function*(){let u=yield Z(g,{as:"dataURL",useProxy:o});u!=null&&u.ok&&typeof u.data=="string"&&y.image.set(g,u.data)})).catch(()=>{});l.push(w)}}for(let d of a){let g="";try{g=It(d).backgroundImage}catch(w){}if(g&&g!=="none"){let w=Tt(g);for(let u of w)if(u.startsWith("url(")){let m=Promise.resolve().then(()=>Rt(u,Q(J({},e),{useProxy:o}))).catch(()=>{});l.push(m)}}}if(n)try{let d=ee(t),g=ne(t);if(typeof tt=="function"?tt():!!tt){let u=new Set(Array.from(d).map(m=>String(m).split("__")[0]).filter(Boolean));yield oe(u,2)}yield te({required:d,usedCodepoints:g,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(f=e.useProxy)!=null?f:o})}catch(d){}yield Promise.allSettled(l)})}typeof window!="undefined"&&(window.snapdom=Y,window.preCache=ln);})();