@zumer/snapdom 1.9.12-dev.4 → 1.9.13

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