pk-annotator 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overlay.mjs +3 -3
- package/dist/{pka-mcp-server-BPtb4Kn8.mjs → pka-mcp-server-DJ7A2u68.mjs} +1 -1
- package/dist/pka-mcp.mjs +1 -1
- package/dist/pka-overlay-agent-art-BKBtrWqF.mjs +1 -0
- package/dist/pka-overlay-agent-theme-CfCyg5Gv.mjs +399 -0
- package/dist/{pka-overlay-app-8vOHqTu0.mjs → pka-overlay-app-CsIxnRqJ.mjs} +47 -47
- package/dist/{pka-overlay-channel-z4oIRzcB.mjs → pka-overlay-channel-D5Ghnvgb.mjs} +1 -1
- package/dist/{pka-overlay-composer-Cg4L5obR.mjs → pka-overlay-composer-CT2x7vgj.mjs} +25 -25
- package/dist/{pka-overlay-copy-DcEIUgrX.mjs → pka-overlay-copy-CvKjfQl1.mjs} +1 -1
- package/dist/pka-overlay-gifenc-BGK0llcr.mjs +1 -0
- package/dist/{pka-overlay-perf-panel-C4rxt4tB.mjs → pka-overlay-perf-panel-gQYSZ0gA.mjs} +2 -2
- package/dist/{pka-overlay-send-A6i2GZG0.mjs → pka-overlay-send-BZyT4xuW.mjs} +3 -3
- package/dist/pka-overlay-snapdom-djDPjHu_.mjs +34 -0
- package/dist/{pka-overlay-thread-store-zl2wNG0R.mjs → pka-overlay-thread-store-DOxLXsAv.mjs} +1 -1
- package/dist/pka-overlay-untracked-fetch-BCn3eft5.mjs +1 -0
- package/package.json +21 -15
- package/dist/pka-overlay-agent-art-3b6Y-lJN.mjs +0 -1
- package/dist/pka-overlay-agent-theme-By8py_yl.mjs +0 -399
- package/dist/pka-overlay-gifenc-Cx3exeY6.mjs +0 -1
- package/dist/pka-overlay-rolldown-runtime-hePW80VL.mjs +0 -1
- package/dist/pka-overlay-snapdom-Dn2JAZkv.mjs +0 -34
- package/dist/pka-overlay-untracked-fetch-Bin99U-o.mjs +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./pka-overlay-untracked-fetch-Bin99U-o.mjs";var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})};function i(e){return e===!1||typeof e==`string`&&e.toLowerCase().trim()===`disabled`?`disabled`:`soft`}function a(e=`soft`){e===`disabled`&&(s.computedStyle=/* @__PURE__ */ new WeakMap,s.measureHints=/* @__PURE__ */ new WeakMap,s.baseStyle=new o(50),s.defaultStyle=new o(64),s.image=new o(100),s.background=new o(100),s.resource=new o(150),s.compress=new o(50))}var o,s,c=n(()=>{o=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;e!==void 0&&this.delete(e)}return super.set(e,t)}},s={image:new o(100),background:new o(100),resource:new o(150),defaultStyle:new o(64),baseStyle:new o(50),compress:new o(50),computedStyle:/* @__PURE__ */ new WeakMap,measureHints:/* @__PURE__ */ new WeakMap,warnedReconcile:!1}});function l(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function u(e){let t=[],n=0,r=0,i=``;for(let a=0;a<e.length;a++){let o=e[a];if(o===`\\`){a++;continue}i?o===i&&(i=``):o===`"`||o===`'`?i=o:o===`(`?r++:o===`)`?r--:o===`,`&&r===0&&(t.push(e.slice(n,a)),n=a+1)}return t.push(e.slice(n)),t}function d(e,t=1){let n=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let e of u(n[1])){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!C.test(n[1].trim()))continue;let i=e.replace(/url\((['"]?)[\s\S]*?\1\)/,` `).match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),a=1;if(i){let e=parseFloat(i[1]);a=/dpi/i.test(i[2])?e/96:e}r.push({url:t[2].trim(),dppx:a})}return r.length?(r.sort((e,t)=>e.dppx-t.dppx),(r.find(e=>e.dppx>=t)||r[r.length-1]).url):null}function f(e){if(!e||e===`none`)return``;let t=e.replace(/translate[XY]?\([^)]*\)/g,``);return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===6?(n[4]=`0`,n[5]=`0`,`matrix(${n.join(`, `)})`):`matrix(${t})`}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===16?(n[12]=`0`,n[13]=`0`,`matrix3d(${n.join(`, `)})`):`matrix3d(${t})`}),t.trim().replace(/\s{2,}/g,` `)}function p(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function m(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<`u`&&(document.baseURI||document.location?.href)||`http://localhost/`;return new URL(e,n).href}catch{return e}}function h(e){return!!e&&e.tagName===`INPUT`&&(e.getAttribute(`type`)||``).toLowerCase()===`password`}function g(e){return`•`.repeat(String(e??``).length)}function _(e,t){return e?.nodeType===1&&e.localName===t}function v(e){return e?.nodeType===1&&e.namespaceURI===w}function y(e){return e?.nodeType===1&&e.namespaceURI===T}function b(e){return e?.nodeType===11&&!!e.host}function x(e){return e?.nodeType===9}var S,C,w,T,E=n(()=>{S=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,C=S,w=`http://www.w3.org/1999/xhtml`,T=`http://www.w3.org/2000/svg`});function D(e=`[snapDOM]`,{ttlMs:t=3e5,maxEntries:n=12}={}){let r=/* @__PURE__ */ new Map,i=0;function a(a,o,s){if(i>=n)return;let c=Date.now();(r.get(o)||0)>c||(r.set(o,c+t),i++,a===`warn`&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){a(`warn`,e,t)},errorOnce(e,t){a(`error`,e,t)},reset(){r.clear(),i=0}}}function O(e,t,n){if(P.size>=oe){let e=Date.now();for(let[t,n]of P)n.until<=e&&P.delete(t);for(;P.size>=oe;)P.delete(P.keys().next().value)}P.set(e,{until:Date.now()+n,result:t})}function k(e){return/^data:|^blob:|^about:blank$/i.test(e)}function A(e,t){try{let n=typeof location<`u`&&location.href?location.href:`http://localhost/`,r=t.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||`.`,n);if(new URL(e,n).origin===i.origin)return!0}catch{}return!1}function ee(e,t){if(!t||k(e)||A(e,t))return!1;try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);return typeof location<`u`?n.origin!==location.origin:!0}catch{return!!t}}function j(e,t){return t?/\{url(?:Raw)?\}/.test(t)?t.replace(`{urlRaw}`,()=>p(e)).replace(`{url}`,()=>encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${p(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function te(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(/* @__PURE__ */ Error(`read_failed`)),r.readAsDataURL(e)})}function ne(e,t){return new Headers(t.headers||{}).keys().next().done?JSON.stringify([t.as||`blob`,t.timeout??3e3,t.useProxy||``,t.errorTTL??8e3,t.credentials||``,e]):null}function M(e){try{return new URL(e,globalThis.location?.href||`http://localhost/`).origin}catch{return`invalid-url`}}function re(e,t){try{e.onError?.(t)}catch{}}async function N(t,n={}){let r=n.as??`blob`,i=n.timeout??3e3,a=n.useProxy||``,o=n.errorTTL??8e3,s=n.headers||{},c=!!n.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[,e=``,n=``]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(n):decodeURIComponent(n),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(e||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:t,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(t))try{let n=await e(t);if(!n.ok)return{ok:!1,data:null,status:n.status,url:t,fromCache:!1,reason:`http_error`};let i=await n.blob(),a=i.type||n.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(i),blob:i,status:n.status,url:t,fromCache:!1,mime:a}:r===`text`?{ok:!0,data:await i.text(),status:n.status,url:t,fromCache:!1,mime:a}:{ok:!0,data:i,status:n.status,url:t,fromCache:!1,mime:a}}catch{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;try{l=ne(t,{as:r,timeout:i,useProxy:a,errorTTL:o,credentials:n.credentials,headers:s})}catch{let e={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`network`};return re(n,e),e}let u=P.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&P.delete(l);let d=ae.get(l);if(d)return d;let f=ee(t,a)?j(t,a):t,p=n.credentials;if(!p)try{let e=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(t,e);p=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{p=`omit`}let m=new AbortController,h=setTimeout(()=>m.abort(`timeout`),i),g=(async()=>{try{let i=await e(f,{signal:m.signal,credentials:p,headers:s});if(!i.ok){let e={ok:!1,data:null,status:i.status,url:f,fromCache:!1,reason:`http_error`};if(l!==null&&o>0&&O(l,e,o),!c){let e=`${i.status} ${i.statusText||``}`.trim();ie.warnOnce(`http:${i.status}:${r}:${M(t)}`,`HTTP ${e} fetching ${r}: ${t}`)}return re(n,e),e}if(r===`text`)return{ok:!0,data:await i.text(),status:i.status,url:f,fromCache:!1};let a=await i.blob(),u=a.type||i.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(a),blob:a,status:i.status,url:f,fromCache:!1,mime:u}:{ok:!0,data:a,status:i.status,url:f,fromCache:!1,mime:u}}catch(e){let a=m.signal.aborted?m.signal.reason===`timeout`?`timeout`:`abort`:e&&typeof e==`object`&&e.name===`AbortError`?`abort`:`network`,s={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:a};if(l!==null&&!/^blob:/i.test(t)&&o>0&&O(l,s,o),!c){let e=`${a}:${r}:${M(t)}`,n=a===`timeout`?`Timeout (${i}ms): ${t}. Increase timeout or use a proxy`:a===`abort`?`Aborted fetching ${r}: ${t}`:`Network/CORS fetching ${r}: ${t}. Try useProxy`;ie.errorOnce(e,n)}return re(n,s),s}finally{clearTimeout(h),ae.delete(l)}})();return l!==null&&ae.set(l,g),g}var ie,ae,oe,P,F=n(()=>{E(),ie=D(`[snapDOM]`,{ttlMs:18e4,maxEntries:10}),ae=/* @__PURE__ */ new Map,oe=50,P=/* @__PURE__ */ new Map});async function se(e,t={}){if(/^\s*url\(\s*['"]?data:/i.test(e)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()===`none`)return e;let n=d(e,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??l(e);if(!n)return e;let r=p(m(n)),i=(t.useProxy||``)+`|`+r;if(s.background.has(i)){let e=s.background.get(i);return e?`url("${e}")`:`none`}try{let e=await N(r,{as:`dataURL`,useProxy:t.useProxy});return e.ok?(s.background.set(i,e.data),`url("${e.data}")`):(s.background.set(i,null),`none`)}catch{return s.background.set(i,null),`none`}}var ce=n(()=>{c(),E(),F()});function le(e){let t=e.replace(Ce,``).trim();return t?t.replace(/(^|,)(\s*)(?=,|$)/g,`$1$2*`):`*`}function ue(e,t,n,r){for(let i=0;i<e.length;i++){if(--r.budget<0)return!1;let a=e[i],o=a.style;if(o){let e=!!a.selectorText&&be.test(a.selectorText);for(let n=0;n<o.length;n++){let i=o[n];if(t.add(i),e&&r.pseudoProps.add(i),o.getPropertyPriority(i)&&r.importantProps.add(i),i.length>5&&(i[0]===`m`||i[0]===`p`)){let e=i.startsWith(`margin`)?`marginUnstable`:i.startsWith(`padding`)?`paddingUnstable`:null;e&&!r[e]&&xe.test(o.getPropertyValue(i))&&(r[e]=!0)}}}let s=a.selectorText;if(s&&s.includes(`:has(`)&&(r.usesHas=!0),s&&s.includes(`&`))for(let e=a.parentRule;e&&s.includes(`&`);e=e.parentRule)e.selectorText&&(s=s.replace(/&/g,`:is(${e.selectorText})`));if(s&&(r.inContainer||we.test(s)||s.includes(`+`)||s.includes(`~`)))for(let e of me(s,`,`)){let t=e.trim();t&&(r.inContainer||we.test(t)||t.includes(`+`)||t.includes(`~`))&&r.shareUnsafeSels.add(t)}if(s&&s.includes(`:`))for(let e in Se)Se[e].test(s)&&n[e].push(le(s));if(a.styleSheet){if(!de(a.styleSheet,t,n,r))return!1}else if(a.cssRules&&a.cssRules.length){let e=a.constructor?.name===`CSSContainerRule`;e&&r.inContainer++;let i=ue(a.cssRules,t,n,r);if(e&&r.inContainer--,!i)return!1}}return!0}function de(e,t,n,r){let i;try{i=e.cssRules}catch{return!1}return i?ue(i,t,n,r):!1}function fe(e,t){for(let n of e){let e=n.effect?.getKeyframes?.()||[];for(let n of e)for(let e of Object.keys(n))e===`offset`||e===`easing`||e===`composite`||e===`computedOffset`||t.add(e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()))}}function pe(e){let t=/* @__PURE__ */ new Set;return de(e,t,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set})?t:null}function me(e,t){if(!e.includes(t))return[e];let n=[],r=0,i=null,a=0;for(let o=0;o<e.length;o++){let s=e[o];if(s===`\\`){o++;continue}if(i){s===i&&(i=null);continue}s===`"`||s===`'`?i=s:s===`(`||s===`[`?r++:s===`)`||s===`]`?r--:r===0&&s===t&&(n.push(e.slice(a,o)),a=o+1)}return n.push(e.slice(a)),n}function he(e){let t=0,n=null,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(n){a===n&&e[i-1]!==`\\`&&(n=null);continue}a===`"`||a===`'`?n=a:a===`(`||a===`[`?t++:a===`)`||a===`]`?t--:t===0&&(a===` `||a===`>`||a===`+`||a===`~`)&&(r=i+1)}let i=``,a=0;for(let t of e.slice(r))t===`(`||t===`[`?a++:t===`)`||t===`]`?a--:a===0&&(i+=t);let o=e=>!e||/\\[0-9a-fA-F]/.test(e)?null:e.replace(/\\(.)/g,`$1`),s=o((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(s)return`c`+s;let c=o((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return`i`+c;let l=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return l?`t`+l.toLowerCase():null}function I(e,t){if(!t.length)return``;if(t.some(e=>e.includes(`&`)))return null;let n=t.join(`,`);try{return e.matches(n),n}catch{return null}}function L(e,t){let n=e.createElement(`div`),r={};for(let e in t){let i=t[e];(e===`before`||e===`after`)&&i.push(`q`),r[e]=I(n,i)}return r}function ge(e){let t={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(_e),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set};for(let a of e.styleSheets)if(!de(a,n,r,i))return t;let a=e.adoptedStyleSheets;if(Array.isArray(a)){for(let e of a)if(!de(e,n,r,i))return t}typeof e.getAnimations==`function`&&fe(e.getAnimations(),n);let o=Array.from(i.shareUnsafeSels),s=I(e.createElement(`div`),o)===null?null:o.map(e=>({sel:e,key:he(e)})),c=new Set(ye);for(let e of ve)n.has(e)&&c.add(e);for(let e of i.pseudoProps)c.add(e);return{universe:n,pseudoUniverse:c,pseudoGates:L(e,r),usesHas:i.usesHas,shareGate:s,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return t}}var _e,ve,ye,be,xe,Se,Ce,we,Te=n(()=>{_e=/* @__PURE__ */ `display.position.top.right.bottom.left.float.clear.z-index.box-sizing.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.overflow-x.overflow-y.visibility.opacity.content-visibility.vertical-align.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.flex-direction.flex-wrap.flex-grow.flex-shrink.flex-basis.order.align-items.align-self.align-content.justify-content.justify-items.justify-self.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-auto-flow.grid-auto-columns.grid-auto-rows.grid-column-start.grid-column-end.grid-row-start.grid-row-end.color.font-family.font-size.font-weight.font-style.font-stretch.line-height.letter-spacing.word-spacing.white-space.text-align.text-transform.text-indent.text-overflow.text-shadow.direction.unicode-bidi.writing-mode.text-orientation.word-break.overflow-wrap.tab-size.list-style-type.list-style-position.list-style-image.counter-reset.counter-increment.counter-set.background-color.background-image.background-size.background-position.background-repeat.background-clip.background-origin.background-attachment.box-shadow.outline-width.outline-style.outline-color.outline-offset.transform.transform-origin.rotate.scale.translate.filter.mix-blend-mode.clip-path.object-fit.object-position.border-collapse.border-spacing.table-layout.caption-side.empty-cells`.split(`.`),ve=/* @__PURE__ */ `color.font-family.font-size.font-weight.font-style.font-stretch.font-variant.font-kerning.font-feature-settings.font-variation-settings.line-height.letter-spacing.word-spacing.white-space.text-align.text-align-last.text-indent.text-transform.text-shadow.text-rendering.direction.unicode-bidi.word-break.overflow-wrap.writing-mode.text-orientation.hyphens.tab-size.visibility.list-style-type.list-style-position.list-style-image.border-collapse.border-spacing.caption-side.empty-cells.quotes.color-scheme.-webkit-text-fill-color.-webkit-font-smoothing.image-rendering`.split(`.`),ye=[`display`,`width`,`height`,`min-width`,`min-height`],be=/::?(?:before|after|first-letter|first-line|marker)/,xe=/%|\bauto\b|calc\(|var\(/i,Se={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ce=/::?(?:before|after|first-letter|first-line|marker)\b/g,we=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function R(e){return De.add(e),e.setAttribute(`data-snapdom-internal`,``),e}function Ee(e){return De.has(e)}var De,z=n(()=>{De=/* @__PURE__ */ new WeakSet});function Oe(e){if(e=String(e).toLowerCase(),Ve.has(e)){let t={};return s.defaultStyle.set(e,t),t}if(s.defaultStyle.has(e))return s.defaultStyle.get(e);let t=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Ee);t||(t=document.createElement(`div`),R(t),t.id=`snapdom-sandbox`,t.setAttribute(`data-snapdom-sandbox`,`true`),t.setAttribute(`aria-hidden`,`true`),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.top=`-9999px`,t.style.width=`0px`,t.style.height=`0px`,t.style.overflow=`hidden`,document.body.appendChild(t));let n=document.createElement(e.includes(`-`)?`span`:e);n.style.all=`initial`,t.appendChild(n);let r=getComputedStyle(n),i={};for(let e of r)ke(e)||(i[e]=r.getPropertyValue(e));for(let e of _e)!(e in i)&&!ke(e)&&(i[e]=r.getPropertyValue(e));return t.removeChild(n),s.defaultStyle.set(e,i),i}function ke(e){let t=Ge.get(e);if(t===void 0){let n=String(e).toLowerCase();t=We.has(n)||Ue.test(n)||He.test(n),Ge.set(e,t)}return t}function Ae(e,t){let n=Ze.get(e);if(n===void 0||t[n]!==t[e])return!1;let r=t[`writing-mode`];if(r&&r!==`horizontal-tb`)return!1;let i=t.direction;return!(i&&i!==`ltr`)}function je(e,t){return!Je.has(e)&&(t===`inline`||Ke.has(e)||qe.has(e))}function Me(e,t,n){let r=(t.display||``).toLowerCase();if(r===`inline`||qe.has(e))return!1;if(n)return!0;if((t.float||`none`).toLowerCase()!==`none`)return!1;let i=(t.position||`static`).toLowerCase();return i===`absolute`||i===`fixed`?!1:!$e.has(r)}function Ne(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),Ve.has(t))return``;let i=[],a=Oe(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=je(t,o),l=e[`text-wrap-mode`]||e[`white-space`]||``,u=l===`nowrap`||l===`pre`,d=c&&n&&!(c&&n&&!s&&u),f=!1;for(let t in e){if(ke(t)||Ae(t,e))continue;let n=e[t];if(d){if(Ye.has(t))continue;if(Xe.has(t)){n&&n!==a[t]&&(i.push(`${t}:${n}`),n!==`auto`&&(f=!0));continue}}if(n&&n!==a[t]){if(!u&&(t===`width`||t===`inline-size`)&&n.endsWith(`px`)&&n.includes(`.`)){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${(e+Qe).toFixed(3)}px`);continue}}i.push(`${t}:${n}`)}}if(d&&!s&&!r&&!f){let t=e.width;t&&t!==`auto`&&t!==a.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(`;`)}function Pe(e){let t=/* @__PURE__ */ new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll==`function`&&e.querySelectorAll(`*`).forEach(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}function Fe(e,t=null){let n=/* @__PURE__ */ new Map;for(let r of e){let e=Oe(r);if(!e)continue;let i=(t?Object.entries(e).filter(([e])=>t.has(e)):Object.entries(e)).filter(([t])=>!Ae(t,e)).map(([e,t])=>`${e}:${t};`).sort(),a=i.join(``);a&&(n.has(a)||n.set(a,{tagList:[],declarations:i}),n.get(a).tagList.push(r))}let r=[...n.values()],i=null;for(let{declarations:e}of r){let t=new Set(e);if(!i){i=t;continue}for(let e of i)t.has(e)||i.delete(e)}i??=/* @__PURE__ */ new Set;let a=``;if(i.size&&r.length>1){let e=r.flatMap(e=>e.tagList);a+=`${e.join(`,`)} { ${[...i].join(``)} }
|
|
2
|
-
`}for(let{tagList:e,declarations:t}of r){let n=r.length>1?t.filter(e=>!i.has(e)):t;if(!n.length)continue;let o=n.join(``);a+=`${e.join(`,`)} { ${o} }
|
|
3
|
-
`}return a}function Ie(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=/* @__PURE__ */ new Map,r=1;for(let e of t)n.set(e,`c${r++}`);return n}function Le(e){try{let t=e?.ownerDocument;if(!t)return typeof window<`u`?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle==`function`)return n;if(typeof window<`u`&&window.frames)for(let e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<`u`?window:null}function B(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>``,item:()=>``};return e[Symbol.iterator]=function*(){},e};if(e?.nodeType!==1){let r=typeof window<`u`?window:null;if(r&&typeof r.getComputedStyle==`function`)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=s.computedStyle.get(e);r||(r=/* @__PURE__ */ new Map,s.computedStyle.set(e,r));let i=r.get(t);if(!i){let a=Le(e),o=null;try{o=a&&typeof a.getComputedStyle==`function`?a.getComputedStyle(e,t):null}catch{}if(!o&&typeof window<`u`&&typeof window.getComputedStyle==`function`)try{e.ownerDocument===document&&(o=window.getComputedStyle(e,t))}catch{}i=o||n(),r.set(t,i)}return i}function Re(e,t=null){let n={};for(let r of t||e){let t=e.getPropertyValue(r);t&&(n[r]=t)}for(let e of et){let t=n[`border-${e}-style`],r=n[`border-${e}-width`];(t===`none`||t===`hidden`||r===`0px`)&&(delete n[`border-${e}-style`],delete n[`border-${e}-width`],delete n[`border-${e}-color`])}return n}function ze(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&n++,a===`)`&&n--,a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt=n(()=>{c(),Te(),z(),Be=/* @__PURE__ */ new Set([`meta`,`script`,`noscript`,`title`,`link`,`template`]),Ve=/* @__PURE__ */ new Set(/* @__PURE__ */ `meta.link.style.title.noscript.script.template.g.defs.use.marker.mask.clipPath.pattern.symbol.path.polygon.polyline.line.circle.ellipse.rect.filter.lineargradient.radialgradient.stop`.split(`.`)),He=/(?:^|-)(animation|transition)(?:-|$)/i,Ue=/^(--.+|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,We=/* @__PURE__ */ new Set([`cursor`,`pointer-events`,`touch-action`,`user-select`,`print-color-adjust`,`speak`,`reading-flow`,`reading-order`,`anchor-name`,`anchor-scope`,`container-name`,`container-type`,`timeline-scope`,`zoom`,`stroke-color`]),Ge=/* @__PURE__ */ new Map,Ke=/* @__PURE__ */ new Set([`span`,`small`,`em`,`strong`,`b`,`i`,`u`,`s`,`code`,`cite`,`mark`,`sub`,`sup`]),qe=/* @__PURE__ */ new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`]),Je=/* @__PURE__ */ new Set([`img`,`video`,`canvas`,`svg`,`iframe`,`embed`,`object`,`input`,`textarea`,`select`]),Ye=/* @__PURE__ */ new Set([`width`,`max-width`,`inline-size`,`max-inline-size`]),Xe=/* @__PURE__ */ new Set([`min-width`,`min-inline-size`]),Ze=new Map(Object.entries({"block-size":`height`,"inline-size":`width`,"min-block-size":`min-height`,"min-inline-size":`min-width`,"max-block-size":`max-height`,"max-inline-size":`max-width`,"margin-block-start":`margin-top`,"margin-block-end":`margin-bottom`,"margin-inline-start":`margin-left`,"margin-inline-end":`margin-right`,"padding-block-start":`padding-top`,"padding-block-end":`padding-bottom`,"padding-inline-start":`padding-left`,"padding-inline-end":`padding-right`,"inset-block-start":`top`,"inset-block-end":`bottom`,"inset-inline-start":`left`,"inset-inline-end":`right`,"border-block-start-width":`border-top-width`,"border-block-start-style":`border-top-style`,"border-block-start-color":`border-top-color`,"border-block-end-width":`border-bottom-width`,"border-block-end-style":`border-bottom-style`,"border-block-end-color":`border-bottom-color`,"border-inline-start-width":`border-left-width`,"border-inline-start-style":`border-left-style`,"border-inline-start-color":`border-left-color`,"border-inline-end-width":`border-right-width`,"border-inline-end-style":`border-right-style`,"border-inline-end-color":`border-right-color`,"border-start-start-radius":`border-top-left-radius`,"border-start-end-radius":`border-top-right-radius`,"border-end-start-radius":`border-bottom-left-radius`,"border-end-end-radius":`border-bottom-right-radius`,"overflow-block":`overflow-y`,"overflow-inline":`overflow-x`,"overscroll-behavior-block":`overscroll-behavior-y`,"overscroll-behavior-inline":`overscroll-behavior-x`,"contain-intrinsic-block-size":`contain-intrinsic-height`,"contain-intrinsic-inline-size":`contain-intrinsic-width`})),Qe=.001,$e=/* @__PURE__ */ new Set([`inline-block`,`inline-flex`,`inline-grid`,`inline-table`,`inline-flow-root`,`table`]),et=[`top`,`right`,`bottom`,`left`]});function nt(e=1e3){return typeof requestAnimationFrame!=`function`||typeof document<`u`&&document.visibilityState===`hidden`?Promise.resolve():new Promise(t=>{let n=!1,r=()=>{n||(n=!0,t())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,e)})}function rt(e){if(e!==!1&&e!==`auto`)return null;let t=performance.now()+(e===`auto`?st:ot),n=null,r={yielded:!1,due:()=>performance.now()>=t,pause:()=>n||=new Promise(e=>{let i=()=>{n=null,r.yielded=!0,t=performance.now()+ot,e()},a=new MessageChannel;a.port1.onmessage=i,a.port2.postMessage(0)})};return r}function it(){if(typeof navigator>`u`)return!1;if(navigator.userAgentData)return navigator.userAgentData.platform===`iOS`;let e=navigator.userAgent||``,t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function V(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent||``,t=e.toLowerCase(),n=t.includes(`safari`)&&!t.includes(`chrome`)&&!t.includes(`crios`)&&!t.includes(`fxios`)&&!t.includes(`android`),r=/applewebkit/i.test(e),i=/mobile/i.test(e),a=!/safari/i.test(e),o=r&&i&&a,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||o||s||c||l}function at(){return typeof navigator>`u`?!1:(navigator.userAgent||``).toLowerCase().includes(`firefox`)}var ot,st,H=n(()=>{ot=16,st=40});function U(e,t,n){let r=e&&typeof e==`object`&&(e.options||e);r&&r.debug&&(n===void 0?console.warn(`[snapdom]`,t):console.warn(`[snapdom]`,t,n))}function ct(e,t,n,r){let i=e&&e.warnings;i&&i.length<lt&&i.push(r===void 0?{code:t,message:n}:{code:t,message:n,detail:r})}var lt,ut=n(()=>{lt=50}),W=n(()=>{ce(),tt(),H(),E(),ut()}),dt={};r(dt,{MAX_RASTER_AREA:()=>It,MAX_RASTER_SIDE:()=>Ft,cropSvgText:()=>pt,decodeSvgFromDataURL:()=>ht,encodeSvgToDataURL:()=>_t,fixSafariShadows:()=>Et,peekSvgHeader:()=>gt,toCanvas:()=>Pt});function ft(e,t){try{let n=e.match(/<svg\b[^>]*>/i);if(!n)return e;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),a=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(a)||i<=0||a<=0)return e;let o=Math.min(1,Ft/i,Ft/a,Math.sqrt(It/(i*a)));if(o>=1)return e;let s=Math.max(1,Math.floor(i*o)),c=Math.max(1,Math.floor(a*o));return ct(t,`raster-clamp`,`capture ${Math.round(i)}x${Math.round(a)}px exceeds decode limits; downscaled to ${s}x${c}px`),console.warn(`[snapdom] Decode limit: ${Math.round(i)}\xD7${Math.round(a)} \u2192 ${s}\xD7${c}. Use ${typeof CompressionStream==`function`?`PNG Blob, `:``}SVG or crop.`),e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${s}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return e}}function pt(e,t){let n=[`x`,`y`,`width`,`height`].map(e=>Number(t?.[e]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw RangeError(`[snapdom] canvas crop requires finite x/y and positive width/height`);let r=e.match(/<svg\b[^>]*>/i);if(!r)throw Error(`[snapdom] cannot crop a non-SVG capture`);let i=r[0],a=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],o=String(a||``).trim().split(/[\s,]+/).map(Number);if(o.length!==4||!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw Error(`[snapdom] cannot crop an SVG without a finite viewBox`);let[s,c,l,u]=o,d=Math.max(s,n[0]),f=Math.max(c,n[1]),p=Math.min(s+l,n[0]+n[2]),m=Math.min(c+u,n[1]+n[3]);if(!(p>d)||!(m>f))throw RangeError(`[snapdom] canvas crop does not intersect the SVG viewBox`);let h=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),_=Number.isFinite(h)&&h>0?h/l:1,v=Number.isFinite(g)&&g>0?g/u:1,y=Math.max(1,(p-d)*_),b=Math.max(1,(m-f)*v),x=i.replace(/(\bwidth=")[^"]*/i,`$1${y}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${d} ${f} ${p-d} ${m-f}`);return e.replace(i,x)}function mt(e){return typeof e==`string`&&/^data:image\/svg\+xml/i.test(e)}function ht(e){let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``}function gt(e){let t=e.indexOf(`,`);if(t<0)return``;let n=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,``);try{return decodeURIComponent(n)}catch{return``}}function _t(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function vt(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`;`&&r===0?(t.push(n),n=``):n+=a}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function yt(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n.trim()),n=``):n+=a}n.trim()&&t.push(n.trim());let i=[];for(let e of t){if(/\binset\b/i.test(e))continue;let[t=`0px`,n=`0px`,r=`0px`]=e.match(/-?\d+(?:\.\d+)?px/gi)||[];r=`${parseFloat(r)/2}px`;let a=e.replace(/-?\d+(?:\.\d+)?px/gi,``).replace(/\binset\b/gi,``).trim().replace(/\s{2,}/g,` `),o=!!a&&a!==`,`;i.push(`drop-shadow(${t} ${n} ${r}${o?` ${a}`:``})`)}return i.join(` `)}function bt(e){let t=vt(e),n=null,r=null,i=null,a=[];for(let e of t){let t=e.indexOf(`:`);if(t<0)continue;let o=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();o===`box-shadow`?i=s:o===`filter`?n=s:o===`-webkit-filter`?r=s:a.push([o,s])}if(i){let e=yt(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let o=[...a];return n&&o.push([`filter`,n]),r&&o.push([`-webkit-filter`,r]),o.map(([e,t])=>`${e}:${t}`).join(`;`)}function xt(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${bt(n)}}`)}function St(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,xt(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${bt(n)}${t}`),e}function Ct(){return Lt||(Lt=(async()=>{try{let e=new Image;e.decoding=`sync`,e.src=`data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%2220%22%3E%3CforeignObject%20width%3D%228%22%20height%3D%2220%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22width%3A4px%3Bheight%3A4px%3Bmargin-top%3A8px%3Bbackground%3A%23000%3Bbox-shadow%3A0%208px%200%200%20%23000%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3C%2Fsvg%3E`,await e.decode();let t=document.createElement(`canvas`);t.width=8,t.height=20;let n=t.getContext(`2d`,{willReadFrequently:!0});n.drawImage(e,0,0);let r=n.getImageData(2,18,1,1).data[3]>128,i=n.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),Lt)}function wt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n=Math.max(0,n-1):a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.map(e=>{let t=0,n=0,r=``,i=0;for(;i<e.length;){let a=e[i];if(a===`(`?t++:a===`)`&&(t=Math.max(0,t-1)),t===0&&(i===0||e[i-1]===` `)){let t=/^-?\d*\.?\d+px/.exec(e.slice(i));if(t){n++,r+=n===2?`${-parseFloat(t[0])}px`:t[0],i+=t[0].length;continue}}r+=a,i++}return r}).join(`,`)}function Tt(e,t){let n=e=>vt(e).map(e=>{let n=e.indexOf(`:`);if(n<0)return e;let r=e.slice(0,n).trim().toLowerCase();return r===`text-shadow`||t&&r===`box-shadow`?`${r}:${wt(e.slice(n+1))}`:e}).join(`;`);return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,t.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,r)=>`${t}{${n(r)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,r)=>`style=${t}${n(r)}${t}`),e}async function Et(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await Ct();try{let r=e;return t||(r=St(r)),n&&(r=Tt(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}function Dt(){let e=document.createElement(`canvas`);e.width=16,e.height=16;let t=e.getContext(`2d`,{willReadFrequently:!0});return t?e=>{t.clearRect(0,0,16,16),t.drawImage(e,0,0,16,16);let n=t.getImageData(0,0,16,16).data;for(let e=3;e<n.length;e+=4)if(n[e]>0)return!0;return!1}:null}async function Ot(e,t,n){R(e),e.style.cssText=`position:fixed;left:-99999px;top:-99999px;pointer-events:none`,document.body.appendChild(e);try{if(!n)return await Rt(),await Rt(),!1;let r=performance.now()+(t?600:150);for(;;){let t;try{t=n(e)}catch{return!1}if(t)return!0;if(performance.now()>r)return!1;await Rt()}}finally{try{e.remove()}catch{}}}function kt(e){if(typeof document>`u`||!document.body)return new Image;if(G&&!G.contentDocument){try{G.remove()}catch{}G=null}if(G&&Bt>zt&&Vt===0){try{G.remove()}catch{}G=null}if(!G){let e=document.createElement(`iframe`);R(e),e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none`;try{document.body.appendChild(e)}catch{}if(e.contentDocument)G=e,Bt=0;else{try{e.remove()}catch{}return new Image}}Bt+=e.length,Vt+=1;let t=G.contentDocument.createElement(`img`);return t.__snapdomDecodeFrame=!0,t}function At(e,t=!1){!e||!e.__snapdomDecodeFrame||(e.__snapdomDecodeFrame=!1,Vt=Math.max(0,Vt-1),t&&(Ht=!0),Ht&&Vt===0&&(G?.remove(),G=null,Bt=0,Ht=!1))}function jt(e,t){return e.loading=`eager`,e.decoding=`sync`,e.crossOrigin=`anonymous`,e.src=t,e.decode()}function Mt(e){if(typeof e!=`string`)return!1;let t=e.indexOf(`,`)+1,n=Math.max(48,Math.floor((e.length-t)/200)),r=0,i=0;for(let a=t;a+48<=e.length;a+=n){let t=e.slice(a,a+48);r++,Kt.some(e=>t.includes(e))||i++}return i*2>r}function Nt(e,t,n,r,i){if(!t.naturalWidth){e.drawImage(t,0,0,n,r);return}let a=n*r,o=a>Ut&&!Mt(i)?Math.min(Gt,Math.ceil(a/Wt)):1;if(o===1){e.drawImage(t,0,0,n,r);return}let s=t.naturalWidth,c=t.naturalHeight/r;for(let i=0;i<o;i++){let a=Math.round(i*r/o),l=i===o-1?r:Math.round((i+1)*r/o);e.drawImage(t,0,a*c,s,(l-a)*c,0,a,n,l-a)}}async function Pt(e,t){let{width:n,height:r,scale:i=1,dpr:a=1,meta:o={},backgroundColor:s,crop:c=null}=t,l=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement?e:null,u=e,d=!1,f=!1;if(c&&!mt(e))throw RangeError(`[snapdom] canvas crop requires an SVG capture payload`);if(mt(e)){let n=(gt(e).match(/<svg\b[^>]*>/i)||[])[0]||``,r=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]),a=Number.isFinite(r)&&Number.isFinite(i)&&r>0&&i>0&&Math.min(1,Ft/r,Ft/i,Math.sqrt(It/(r*i)))<1;if(c||a||V())try{let n=ht(e);if(c&&(n=pt(n,c)),V()){let e=await Et(n);n=e.svg,d=e.naturalOnly,f=/@font-face|data:image\//i.test(n)}(a||c)&&(n=ft(n,t.__session)),u=_t(n)}catch(t){if(c)throw t;u=e}}let p=l||kt(u);try{l||await jt(p,u)}catch(e){if(!p.__snapdomDecodeFrame)throw e;let n=p;p=kt(u),At(n);try{await jt(p,u)}catch(e){throw At(p,t.__releaseDecodeFrame),e}}try{!l&&!V()&&!at()&&mt(u)&&/(?:%40|@)font-face/i.test(u)&&await new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),t.port2.close(),e()},t.port2.postMessage(0)});let e=V()&&!l?Dt():null,m=!1;e&&(m=await Ot(p,f,e));let h=l?l.width:p.naturalWidth,g=l?l.height:p.naturalHeight,y=c?h:Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:h,b=c?g:Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:g,x,S,C=Number.isFinite(n),w=Number.isFinite(r);if(C&&w)x=Math.max(1,n),S=Math.max(1,r);else if(C){let e=n/Math.max(1,y);x=n,S=b*e}else if(w){let e=r/Math.max(1,b);S=r,x=y*e}else{let e=l&&Number.isFinite(o.vbW)&&Number.isFinite(o.vbH);x=e?o.vbW:h,S=e?o.vbH:g}!C&&!w&&(x*=i,S*=i);let T=x*a,E=S*a,D=Math.max(T/Ft,E/Ft,Math.sqrt(T*E/It));D>1&&(ct(t.__session,`canvas-clamp`,`output ${Math.round(T)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[snapdom] Canvas limit: reducing ${Math.round(T)}\xD7${Math.round(E)}. Use ${typeof CompressionStream==`function`?`PNG Blob, `:``}SVG or crop.`),x/=D,S/=D);let O=v(t.canvas)&&_(t.canvas,`canvas`)?t.canvas:document.createElement(`canvas`);O.width=Math.max(1,x*a),O.height=Math.max(1,S*a),O.style.width=`${x}px`,O.style.height=`${S}px`;let k=O.getContext(`2d`);if(!k)throw Error(`[snapdom] toCanvas: the target canvas has no 2d context`);let A=()=>{if(a!==1&&k.scale(a,a),s&&(k.save(),k.fillStyle=s,k.fillRect(0,0,x,S),k.restore()),d&&(Math.round(x*a)!==h||Math.round(S*a)!==g)){let e=document.createElement(`canvas`);e.width=h,e.height=g,Nt(e.getContext(`2d`),p,h,g,u),k.drawImage(e,0,0,x,S)}else k.save(),k.setTransform(1,0,0,1,0,0),Nt(k,p,x*a,S*a,u),k.restore()};if(A(),e&&m&&f){let t=!0;try{t=e(p)}catch{}if(!t){let n=performance.now()+600;do{await Rt();try{t=e(p)}catch{break}}while(!t&&performance.now()<n);O.width=O.width,A()}}return O}finally{At(p,t.__releaseDecodeFrame)}}var Ft,It,Lt,Rt,zt,G,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt=n(()=>{H(),ut(),E(),z(),Ft=V()?16384:32767,It=268435456,Lt=null,Rt=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),zt=25165824,G=null,Bt=0,Vt=0,Ht=!1,Ut=4e6,Wt=2e6,Gt=8,Kt=[`%3C`,`%3E`,`%20`,`%7B`,`%7D`,`%3B`]}),Jt={};r(Jt,{rasterize:()=>Yt});async function Yt(e,t){let n=await Pt(e,t),r=n.width*n.height<=2e6?n.toDataURL(`image/${t.format}`,t.quality):await new Promise(e=>{let r=()=>e(n.toDataURL(`image/${t.format}`,t.quality));try{n.toBlob(t=>{if(!t)return r();let n=new FileReader;n.onload=()=>e(String(n.result||``)),n.onerror=r,n.readAsDataURL(t)},`image/${t.format}`,t.quality)}catch{r()}}),i=new Image;return i.src=r,V()?await i.decode():await new Promise((e,t)=>{if(i.complete&&i.naturalWidth)return e();i.onload=e,i.onerror=t}),i.style.width=`${n.width/t.dpr}px`,i.style.height=`${n.height/t.dpr}px`,i}var Xt=n(()=>{qt(),H()}),Zt={};r(Zt,{toImg:()=>Qt,toSvg:()=>Qt});async function Qt(e,t){let{scale:n=1,width:r,height:i,meta:a={}}=t,o=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||o||s;if(V()&&c)try{let{svg:t}=await Et(ht(e)),c=(t.match(/<svg\b[^>]*>/i)||[])[0]||``,l=parseFloat((c.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((c.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(l)||!Number.isFinite(u))throw Error(`svg without dimensions`);let d=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:u,p,m;o&&s?(p=r,m=i):o?(p=r,m=Math.max(1,Math.round(r/Math.max(1,d)*f))):s?(m=i,p=Math.max(1,Math.round(i/Math.max(1,f)*d))):(p=Math.max(1,Math.round(l*n)),m=Math.max(1,Math.round(u*n)));let h=t.replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${m}"`),g=new Image;return g.decoding=`sync`,g.loading=`eager`,g.src=_t(h),await g.decode(),g.style.width=`${p}px`,g.style.height=`${m}px`,g}catch(n){return ct(t.__session,`safari-png-fallback`,`Safari vector toImg failed; using PNG`,n),U(t,`Safari vector toImg failed; using PNG`,n),Yt(e,{...t,format:`png`,quality:1,meta:a})}let l=e,u=!1;if(!o&&!s&&n!==1&&typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=ht(e),r=(t.match(/<svg\b[^>]*>/i)||[])[0]||``,i=Number((r.match(/\bwidth="([\d.]+)"/i)||[])[1]),a=Number((r.match(/\bheight="([\d.]+)"/i)||[])[1]);if(i>0&&a>0){let e=r.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(i*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(a*n))}"`);l=_t(t.replace(r,e)),u=!0}}catch{}let d=new Image;d.decoding=`sync`,d.loading=`eager`,d.src=l;try{await d.decode()}catch(t){if(!u)throw t;d.src=e,u=!1,await d.decode()}if(o&&s)d.style.width=`${r}px`,d.style.height=`${i}px`;else if(o){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,n=r/Math.max(1,e);d.style.width=`${r}px`,d.style.height=`${Math.max(1,Math.round(t*n))}px`}else if(s){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,n=i/Math.max(1,t);d.style.height=`${i}px`,d.style.width=`${Math.max(1,Math.round(e*n))}px`}else{let r=Math.max(1,Math.round(d.naturalWidth*(u?1:n))),i=Math.max(1,Math.round(d.naturalHeight*(u?1:n)));if(d.style.width=`${r}px`,d.style.height=`${i}px`,!u&&n!==1&&typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=decodeURIComponent(e.split(`,`)[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);d.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await d.decode()}catch(n){U(t,`toImg SVG sizing failed`,n),d.src!==e&&(d.src=e,await d.decode().catch(()=>{}))}}return d}var $t=n(()=>{W(),ut(),Xt(),qt()}),en={};r(en,{encodePng:()=>nn});function tn(e,t=/* @__PURE__ */ new Uint8Array){let n=new Uint8Array(t.length+12),r=new DataView(n.buffer);r.setUint32(0,t.length);for(let t=0;t<4;t++)n[t+4]=e.charCodeAt(t);n.set(t,8);let i=4294967295;for(let e=4;e<n.length-4;e++)i=rn[(i^n[e])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function nn(e,t,n){if(![e,t].every(e=>Number.isInteger(e)&&e>0&&e<=2147483647))throw RangeError(`[snapdom] PNG dimensions must be integers from 1 to 2147483647`);let r=/* @__PURE__ */ new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6;let a=[new Uint8Array([137,80,78,71,13,10,26,10]),tn(`IHDR`,r),tn(`sRGB`,new Uint8Array([0]))],o=e*4,s=Math.max(1,Math.floor(65536/(o+1))),c=new Uint8Array(o),l=0,u=new CompressionStream(`deflate`),d=u.writable.getWriter(),f=u.readable.getReader(),p,m=(async()=>{try{for(;;){let{done:e,value:t}=await f.read();if(e)return;a.push(tn(`IDAT`,t))}}catch(e){p=e,await d.abort(e).catch(()=>{})}})();try{for await(let e of n){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)||!e.length||e.length%o)throw RangeError(`[snapdom] PNG input must contain complete RGBA rows`);let n=e.length/o;if(l+n>t)throw RangeError(`[snapdom] PNG input exceeds the declared height`);for(let t=0;t<n;t+=s){let r=Math.min(n,t+s),i=new Uint8Array((r-t)*(o+1));for(let n=t;n<r;n++){let r=e.subarray(n*o,(n+1)*o),a=(n-t)*(o+1),s=0,l=0;for(let e=0;e<o;e++){let t=r[e]-(e<4?0:r[e-4])&255,n=r[e]-c[e]&255;s+=Math.min(t,256-t),l+=Math.min(n,256-n),i[a+e+1]=n}if(i[a]=l<=s?2:1,s<l)for(let e=0;e<o;e++)i[a+e+1]=r[e]-(e<4?0:r[e-4]);c=r}await d.write(i)}c=c.slice(),l+=n}if(l!==t)throw RangeError(`[snapdom] PNG input does not match the declared height`);if(await d.close(),await m,p)throw p;return a.push(tn(`IEND`)),new Blob(a,{type:`image/png`})}catch(e){throw await Promise.allSettled([d.abort(e),f.cancel(e)]),await m,e}finally{d.releaseLock(),f.releaseLock()}}var rn,an=n(()=>{rn=/* @__PURE__ */ new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;rn[e]=t}});function on(e,t){if(typeof e!=`string`||!e.startsWith(`data:image/svg+xml`))return null;let n=gt(e).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=t.crop?pt(n,t.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),a=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),o=(r.match(/\bviewBox="([^"]+)/i)?.[1]||``).trim().split(/[\s,]+/).map(Number);if(!(i>0&&a>0)||o.length!==4||!o.every(Number.isFinite)||!(o[2]>0&&o[3]>0))return null;let s=Number.isFinite(t.width),c=Number.isFinite(t.height),l=t.meta||{},u=Math.max(1,Math.floor(i)),d=Math.max(1,Math.floor(a)),f=t.crop?u:Number.isFinite(l.vbW)?l.vbW:Number.isFinite(l.w0)?l.w0:u,p=t.crop?d:Number.isFinite(l.vbH)?l.vbH:Number.isFinite(l.h0)?l.h0:d,m=t.dpr??1,h=t.scale??1,g=(s&&c?Math.max(1,t.width):s?t.width:c?t.height*f/Math.max(1,p):u*h)*m,_=(s&&c?Math.max(1,t.height):c?t.height:s?t.width*p/Math.max(1,f):d*h)*m;return Math.max(i,a,g,_)<=Ft&&i*a<=It&&g*_<=It||typeof CompressionStream!=`function`?null:v();async function v(){let{encodePng:s}=await Promise.resolve().then(()=>(an(),en)),c=Math.max(1,Math.floor(g)),l=Math.max(1,Math.floor(_)),f=ht(e),p=f.slice(f.indexOf(n)+n.length,f.lastIndexOf(`</svg>`)),m=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||`xMidYMid meet`,h=i/o[2],v=a/o[3],y=0,b=0;/\bnone\b/.test(m)||(h=v=/\bslice\b/.test(m)?Math.max(h,v):Math.min(h,v),y=(i-o[2]*h)*(/xMin/.test(m)?0:/xMax/.test(m)?1:.5),b=(a-o[3]*v)*(/YMin/.test(m)?0:/YMax/.test(m)?1:.5)),y-=o[0]*h,b-=o[1]*v;let x=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,``).slice(0,-1),S=V()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(f),C=i/g,w=a/_,T=Math.max(1,Math.min(8192,Math.floor(4194304/c),S?Math.floor(2046/w):8192)),E=Math.max(1,Math.min(8192,c,S?Math.floor(2046/C):8192));async function*D(){for(let e=0;e<l;e+=T){let n=Math.min(T,l-e),r=new Uint8Array(c*n*4);for(let i=0;i<c;i+=E){let a=Math.min(E,c-i),s=S?Math.max(0,Math.floor(i*C)-1):i*C,l=S?Math.max(0,Math.floor(e*w)-1):e*w,f=S?Math.min(u,Math.ceil((i+a)*C)+1)-s:a,m=S?Math.min(d,Math.ceil((e+n)*w)+1)-l:n,g=f/o[2],_=m/o[3],T=S?1:1/C,D=S?1:1/w,O=`matrix(${h*T/g},0,0,${v*D/_},${(y-s)*T/g+o[0]},${(b-l)*D/_+o[1]})`,k=await Pt(_t(`${x} width="${f}" height="${m}" preserveAspectRatio="none"><g style="all:unset!important;transform:${O}!important;transform-origin:0 0!important">${p}</g></svg>`),{width:f,height:m,dpr:1,backgroundColor:S?null:t.backgroundColor,__session:t.__session,__releaseDecodeFrame:!0}),A=k;try{if(S){A=document.createElement(`canvas`),A.width=a,A.height=n;let r=A.getContext(`2d`);t.backgroundColor&&(r.fillStyle=t.backgroundColor,r.fillRect(0,0,a,n)),r.drawImage(k,i*C-s,e*w-l,a*C,n*w,0,0,a,n)}let o=A.getContext(`2d`).getImageData(0,0,a,n).data;for(let e=0;e<n;e++)r.set(o.subarray(e*a*4,(e+1)*a*4),(e*c+i)*4)}finally{k.width=k.height=0,A!==k&&(A.width=A.height=0)}}yield r}}return s(c,l,D())}}var sn=n(()=>{qt(),H()}),cn={};r(cn,{toBlob:()=>ln});async function ln(e,t){let n=t.format||t.type||`svg`;if(n===`svg`){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement)throw Error(`[snapdom] toBlob: engine:'html-in-canvas' produces a raster capture; ask for png/jpeg/webp`);let t=decodeURIComponent(e.split(`,`)[1]);return new Blob([t],{type:`image/svg+xml`})}let r=n===`png`&&on(e,t);if(r)return r;let i=await Pt(e,t);return new Promise(e=>i.toBlob(t=>e(t),`image/${n===`jpg`?`jpeg`:n}`,t.quality))}var un=n(()=>{qt(),sn()}),dn={};r(dn,{download:()=>pn});async function fn(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(e){if(e.name!==`AbortError`)return!1}return!0}async function pn(e,t){let n=/* @__PURE__ */ new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]),r=(t?.type||``).toLowerCase(),i=n.has(r)?r:``,a=(t?.format||i||``).toLowerCase(),o=a===`jpg`?`jpeg`:a||`png`,s=t?.filename||`snapdom`,c=/\.(png|jpe?g|webp|svg)$/i.test(s)?s:`${s}.${o}`,l={...t||{},format:o,type:o};l.dpr=1;let u=it(),d=o===`png`&&on(e,l);if(o===`svg`||d){let t=d?await d:await ln(e,{...l,type:`svg`});if(u&&await fn(t,c))return;let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=c,document.body.appendChild(r),r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3),r.remove();return}let f=await Pt(e,l);if(u){let e=`image/${o}`,n=await new Promise(n=>f.toBlob(n,e,t?.quality));if(n&&await fn(n,c))return}let p=document.createElement(`a`);p.href=f.toDataURL(`image/${o}`,t?.quality),p.download=c,document.body.appendChild(p),p.click(),p.remove()}var mn=n(()=>{un(),qt(),sn(),H()});W(),W(),H(),c(),Te(),z();var hn=/* @__PURE__ */ new WeakMap,gn=[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`],_n=/* @__PURE__ */ new Map,vn=2e3,yn=0;function K(){yn++}function bn(e){let t=e&&(e.nodeType===1?e:e.parentElement);for(;t;){if(Ee(t))return!0;if(t.parentElement)t=t.parentElement;else{let e=t.getRootNode?.();t=e&&e.host?e.host:null}}return!1}function xn(e){for(let t of e)if(Sn(t))return!0;return!1}function Sn(e){if(bn(e.target))return!1;if(e.type===`childList`){let t=!0;for(let n of e.addedNodes)if(!bn(n)){t=!1;break}if(t){for(let n of e.removedNodes)if(!bn(n)){t=!1;break}}if(t)return!1}return!0}var Cn=/* @__PURE__ */ new WeakMap;function wn(e){for(let t of e){if(!Sn(t))continue;let e=t.target.ownerDocument||document;Cn.set(e,(Cn.get(e)||0)+1);let n=t.target.nodeType===1?t.target:t.target.parentElement||t.target.host;for(;n;n=n.parentElement||n.getRootNode?.()?.host)Cn.set(n,(Cn.get(n)||0)+1)}}function Tn(e){let t=e.ownerDocument||document;return Yn(t),(Cn.get(t)||0)-(Cn.get(e)||0)}var q=0;function En(e=document){return Yn(e),q}function Dn(){return Yn(),yn}function On(e){return e?(Yn(e.ownerDocument||document),In(e,Ln(e))):0}function kn(){K(),q++}var An=/* @__PURE__ */ new WeakMap,jn=0,Mn=0;function Nn(e){An.set(e,++jn)}function Pn(e){if(!e||e.nodeType!==1)return;jn++,An.set(e,jn);let t=e.querySelectorAll(`*`);for(let e=0;e<t.length;e++)An.set(t[e],jn)}function Fn(e){Pn(e.parentElement||e);for(let t=e.parentElement;t;t=t.parentElement)Nn(t)}function In(e,t=null){let n=An.get(e)||0;if(t)for(let e of t)n=Math.max(n,An.get(e)||0);return Mn*1e9+n}function Ln(e){let t=e.getRootNode?.();if(!t?.host)return null;let n=[];for(;t?.host;)t.mode===`open`&&Wn(t),n.push(t.host),t=t.host.getRootNode?.();return n}var Rn=/* @__PURE__ */ new WeakMap;function zn(e){e||=document;let t=Rn.get(e);if(!t||t.env!==q){let n=!0;try{n=ar(e).usesHas}catch{}t={env:q,usesHas:n},Rn.set(e,t)}return!t.usesHas}function Bn(e){let t=e=>e?.nodeType===1&&(e.matches?.(`style,link`)||e.querySelector?.(`style,link`));for(let n of e){let e=n.target,r=e&&(e.nodeType===1?e:e.parentElement);if(r&&(r.tagName===`STYLE`||r.tagName===`LINK`))return r.ownerDocument||document;for(let e of n.addedNodes)if(t(e))return e.ownerDocument||document;for(let r of n.removedNodes)if(t(r))return r.ownerDocument||e&&e.ownerDocument||document}return null}var Vn=/* @__PURE__ */ new WeakSet,Hn=[];function Un(e){if(!xn(e))return;wn(e),K();let t=/* @__PURE__ */ new Set;for(let n of e){if(!Sn(n))continue;let e=n.target.getRootNode&&n.target.getRootNode();if(!e||e.nodeType!==11||t.has(e))continue;t.add(e),e.host?Pn(e.host):jn++;let r=e.querySelectorAll(`*`);for(let e=0;e<r.length;e++)An.set(r[e],jn)}}function Wn(e){if(e&&!Vn.has(e)){Vn.add(e);try{let t=new MutationObserver(Un);t.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Hn.push({o:t,root:e})}catch{}}}function Gn(e){if(!xn(e))return;wn(e),K();let t=Bn(e);if(t){Rn.delete(t),q++,Mn++;return}let n=/* @__PURE__ */ new Set;for(let t of e){if(!Sn(t))continue;let e=t.target.nodeType===1?t.target:t.target.parentElement;if(!e)continue;let r=e.ownerDocument||document;if(!zn(r)){Mn++;return}if(e===r.documentElement||e===r.body){Mn++;return}let i=e.parentElement||e;n.has(i)||(n.add(i),Fn(e))}}var Kn=/* @__PURE__ */ new WeakSet,qn=null,Jn=[];function Yn(e=document){if(e===qn||!e||e.nodeType!==9)return;if(Kn.has(e)){qn=e;return}Kn.add(e),qn=e;let t=e.defaultView,n=e=>{xn(e)&&(K(),q++)},r=()=>{K(),q++};try{let t=new MutationObserver(Gn);t.observe(e.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Jn.push({o:t,env:!1,doc:e})}catch{}try{let t=new MutationObserver(n);t.observe(e.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Jn.push({o:t,env:!0,doc:e})}catch{}try{t?.addEventListener(`resize`,r,{passive:!0})}catch{}try{let n=t=>{K();let n=t.composedPath?.()[0]||t.target;n&&n.nodeType===1&&!bn(n)&&zn(n.ownerDocument||e)?Fn(n):Mn++};e.addEventListener(`focusin`,n,{capture:!0,passive:!0}),e.addEventListener(`focusout`,n,{capture:!0,passive:!0}),e.addEventListener(`change`,n,{capture:!0,passive:!0}),e.addEventListener(`pointerdown`,n,{capture:!0,passive:!0}),e.addEventListener(`pointerup`,n,{capture:!0,passive:!0}),e.addEventListener(`pointercancel`,n,{capture:!0,passive:!0}),e.addEventListener(`keydown`,n,{capture:!0,passive:!0}),e.addEventListener(`keyup`,n,{capture:!0,passive:!0}),e.addEventListener(`beforetoggle`,n,{capture:!0,passive:!0}),e.addEventListener(`toggle`,n,{capture:!0,passive:!0}),t?.addEventListener(`hashchange`,()=>{K(),Mn++},{passive:!0})}catch{}try{let t=e.fonts;t&&(t.addEventListener?.(`loadingdone`,r),t.status===`loading`&&t.ready?.then(r).catch(()=>{}))}catch{}}var Xn=/* @__PURE__ */ new WeakMap;function Zn(e,t){if(!e?.querySelectorAll)return;let n;try{n=Array.from(e.querySelectorAll(`:hover`))}catch{return}let r=Xn.get(e)||[];if(r.length===n.length&&r.every((e,t)=>e===n[t]))return;if(Xn.set(e,n),K(),e.nodeType===11){e.host?Pn(e.host):jn++;for(let t of e.querySelectorAll(`*`))An.set(t,jn);return}let i=r.filter(e=>!n.includes(e)).concat(n.filter(e=>!r.includes(e)));for(let e of i)if(e.isConnected){if(zn(t))Fn(e);else{Mn++;return}}}function Qn(e,t=null){if(!e)return;Zn(e,e);let n=t||Hn.filter(({root:e})=>e.host?.isConnected).map(({root:e})=>e);for(let t of n)Zn(t,e)}function $n(){Yn();try{for(let e=Jn.length-1;e>=0;e--){let{o:t,env:n,doc:r}=Jn[e];if(r!==document&&!r.defaultView){try{t.disconnect()}catch{}Kn.delete(r),qn===r&&(qn=null),Jn.splice(e,1);continue}let i=t.takeRecords();i.length&&(n?xn(i)&&(K(),q++):Gn(i))}for(let e=Hn.length-1;e>=0;e--){let{o:t,root:n}=Hn[e];if(!n.host||!n.host.isConnected){try{t.disconnect()}catch{}Vn.delete(n),Hn.splice(e,1);continue}let r=t.takeRecords();r.length&&Un(r)}}catch{}}function er(e){if(e&&e.nodeType===1){hn.delete(e);try{let t=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();)hn.delete(t.currentNode)}catch{}}}var tr=[`mask`,`mask-image`,`-webkit-mask`,`-webkit-mask-image`,`mask-source`,`mask-box-image-source`,`mask-border-source`,`-webkit-mask-box-image-source`,`border-image`,`border-image-source`];function nr(e){let t=hn.get(e);if(t&&Er(t,e)){let e=t.snapshot&&t.snapshot.__needsBgInline;if(e!==void 0)return e}return!0}function rr(e){let t=hn.get(e);if(!t||!Er(t,e))return null;let n=t.snapshot;return!n||n.__bgClipTextFix?null:n}var ir=/* @__PURE__ */ new WeakMap;function ar(e){let t=ir.get(e);if(!t||t.epoch!==yn){let n=t&&t.universe;t={epoch:yn,...ge(e)};let r=t.universe;if(n&&r&&n.size===r.size){let e=!0;for(let t of r)if(!n.has(t)){e=!1;break}e&&(t.universe=n)}ir.set(e,t)}return t}function or(e){try{let t=ar(e.ownerDocument||document).shareGate;if(t===null)return!1;if(!t.length)return!0;let n=/* @__PURE__ */ new Set,r=e=>{n.add(`t`+e.localName),e.id&&n.add(`i`+e.id);let t=e.classList;for(let e=0;e<t.length;e++)n.add(`c`+t[e])};r(e);for(let t of e.querySelectorAll(`*`))r(t);let i=[];for(let{sel:e,key:r}of t)(r===null||n.has(r))&&i.push(e);if(!i.length)return!0;let a=i.join(`,`);return!e.matches(a)&&e.querySelector(a)===null}catch{return!1}}function sr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:ar(t).importantProps}function cr(e,t){let n=e.ownerDocument||document,r=e.getRootNode?e.getRootNode():n;return r===n?ar(n).universe:t&&b(r)?ur(e,r,n,t):null}var lr=/* @__PURE__ */ new WeakMap;function ur(e,t,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let e=ar(n).universe;if(!e)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(e),roots:/* @__PURE__ */ new Set}}let a=e=>{for(;b(e)&&!i.roots.has(e);e=e.host.getRootNode()){i.roots.add(e);for(let t of[...e.styleSheets,...e.adoptedStyleSheets||[]]){let e=lr.get(t);if((!e||e.epoch!==yn)&&lr.set(t,e={epoch:yn,props:pe(t)}),!e.props)return!1;for(let t of e.props)i.universe.add(t)}fe(e.getAnimations(),i.universe)}return!0},o=a(t)&&(!e.shadowRoot||a(e.shadowRoot));for(let t=e.assignedSlot;o&&t;t=t.assignedSlot)o=a(t.getRootNode());return o?i.universe:r.__shadowUniverse=null}function dr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:ar(t).pseudoUniverse}var fr={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function pr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?fr:ar(t).pseudoGates}function mr(e,t={},n=null,r=null){let i={},a=t.excludeStyleProps,o=t=>{if(i[t]!==void 0||ke(t)||a&&(a instanceof RegExp&&a.test(t)||typeof a==`function`&&a(t)))return;let n=e.getPropertyValue(t);n&&((t===`background-image`||t===`content`)&&n.includes(`url(`)&&!n.includes(`data:`)&&(n=`none`),i[t]=n)};if(r){for(let e of r)o(e);let e=n&&n.style;if(e&&e.length)for(let t=0;t<e.length;t++)o(e[t])}else for(let t=0;t<e.length;t++)o(e[t]);for(let t of[`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`text-decoration-thickness`,`text-underline-offset`,`text-decoration-skip-ink`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}for(let t of[`-webkit-text-stroke`,`-webkit-text-stroke-width`,`-webkit-text-stroke-color`,`paint-order`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}if(t.embedFonts){for(let t of[`font-feature-settings`,`font-variation-settings`,`font-kerning`,`font-variant`,`font-variant-ligatures`,`font-optical-sizing`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}}try{(i[`content-visibility`]||e.getPropertyValue(`content-visibility`))===`hidden`&&(i[`content-visibility`]=`hidden`)}catch{}Object.defineProperty(i,"__needsBgInline",{value:_r(e),enumerable:!1});let s=parseFloat(e.getPropertyValue(`border-top-width`)||0)||0,c=parseFloat(e.getPropertyValue(`border-right-width`)||0)||0,l=parseFloat(e.getPropertyValue(`border-bottom-width`)||0)||0,u=parseFloat(e.getPropertyValue(`border-left-width`)||0)||0;if(s===0&&c===0&&l===0&&u===0){let t=(e.getPropertyValue(`border-image-source`)||``).trim(),n=t&&t!==`none`;for(let e of/* @__PURE__ */ `border.border-top.border-right.border-bottom.border-left.border-width.border-style.border-color.border-top-width.border-top-style.border-top-color.border-right-width.border-right-style.border-right-color.border-bottom-width.border-bottom-style.border-bottom-color.border-left-width.border-left-style.border-left-color.border-block.border-block-width.border-block-style.border-block-color.border-inline.border-inline-width.border-inline-style.border-inline-color.border-block-start.border-block-start-width.border-block-start-style.border-block-start-color.border-block-end.border-block-end-width.border-block-end-style.border-block-end-color.border-inline-start.border-inline-start-width.border-inline-start-style.border-inline-start-color.border-inline-end.border-inline-end-width.border-inline-end-style.border-inline-end-color`.split(`.`))delete i[e];n||(i.border=`none`)}return hr(i),i}function hr(e){if(!at())return;let t=e[`background-clip`]||e[`-webkit-background-clip`];if(!t||!t.includes(`text`))return;let n=e=>e===`transparent`||e===`rgba(0, 0, 0, 0)`,r=e[`-webkit-text-fill-color`];if(!n(r===void 0?e.color:r))return;let i=gr(e[`background-image`],e[`background-color`]);i&&(n(e.color)&&(e.color=i),r!==void 0&&(e[`-webkit-text-fill-color`]=i),e[`background-image`]=`none`,e[`background-color`]=`transparent`,delete e[`background-clip`],delete e[`-webkit-background-clip`],Object.defineProperty(e,"__bgClipTextFix",{value:i,enumerable:!1}))}function gr(e,t){let n=e=>{let t=[],n=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,r;for(;r=n.exec(e||``);){let e=r[4];(e===void 0?1:parseFloat(e)/(e.endsWith(`%`)?100:1))>.05&&t.push([+r[1],+r[2],+r[3]])}return t},r=n(e);if(r.length||(r=n(t)),!r.length)return null;let i=[0,0,0];for(let[e,t,n]of r)i[0]+=e,i[1]+=t,i[2]+=n;return`rgb(${i.map(e=>Math.round(e/r.length)).join(`, `)})`}function _r(e){let t=e.getPropertyValue(`background-image`);if(t&&t!==`none`)return!0;let n=e.getPropertyValue(`background-color`);if(n&&n!==`rgba(0, 0, 0, 0)`&&n!==`transparent`)return!0;for(let t of tr){let n=e.getPropertyValue(t);if(n&&n!==`none`)return!0}let r=e.getPropertyValue(`background`);return!!(r&&/url\s*\(/i.test(r))}function vr(e){for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3&&/\S/.test(t.nodeValue||``))return!0;if(t.nodeType===1){let e=B(t).position;if(e!==`absolute`&&e!==`fixed`)return!0}}return!1}function yr(e,t,n){try{if(typeof e.computedStyleMap==`function`){let t=e.computedStyleMap().get(`width`);if(t!=null)return!xr(String(t).trim().toLowerCase())}}catch{}let r=e.style&&(e.style.width||e.style.inlineSize);return r&&!xr(String(r).trim().toLowerCase())?!0:Sr(e,t)?n||Cr(e,t):!1}var br=/* @__PURE__ */ new Set([`auto`,`min-content`,`max-content`,`stretch`,`fill-available`,`-webkit-fill-available`]);function xr(e){return br.has(e)||e.startsWith(`fit-content`)}function Sr(e,t){let n=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,a=null;for(let t=e.firstChild;t;t=t.nextSibling){let e;if(t.nodeType===3){if(!/\S/.test(t.nodeValue||``)||(a||=document.createRange(),a.selectNode(t),e=a.getBoundingClientRect(),!e.width&&!e.height))continue}else if(t.nodeType===1){let n=B(t);if(n.display===`none`||n.position===`absolute`||n.position===`fixed`)continue;e=t.getBoundingClientRect()}else continue;e.left<r&&(r=e.left),e.right>i&&(i=e.right)}return i!==-1/0&&i-r<n-.5}function Cr(e,t){let n=e.parentElement;if(!n)return!1;let r=B(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return i>0&&Math.abs(e.getBoundingClientRect().width-i)>.5}var wr=/* @__PURE__ */ new WeakMap;function Tr(e,t){let n=wr.get(e);if(n)return n;let r=[t];for(let t in e)r.push(t,e[t]);return n=r.join(``),wr.set(e,n),n}function Er(e,t){return e.env===q&&e.stamp===In(t,e.hosts)}var Dr=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Or=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,kr=/* @__PURE__ */ new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`,`OPTGROUP`,`PROGRESS`,`METER`,`BUTTON`,`DATALIST`]);function Ar(e){let t=e.__styleShare;return t||=e.__styleShare={ids:/* @__PURE__ */ new WeakMap,intern:/* @__PURE__ */ new Map,snaps:/* @__PURE__ */ new Map,rootSeen:!1},t}function jr(e,t){let n=t.ids.get(e);if(n!==void 0)return n;let r=e.parentElement,i;if(!r)i=`R`;else if(i=t.ids.get(r),i===void 0){if(t.rootSeen)return t.ids.set(e,-1),-1;i=`R`}if(t.rootSeen=!0,i===-1)return t.ids.set(e,-1),-1;let a=``,o=e.attributes;if(o&&o.length){if(o.length===1)a=o[0].name+`=`+o[0].value;else{let e=[];for(let t=0;t<o.length;t++)e.push(o[t].name+`=`+o[t].value);e.sort(),a=e.join(``)}}let s=i+`|`+e.tagName+`|`+a;return n=t.intern.get(s),n===void 0&&(n=t.intern.size,t.intern.set(s,n)),t.ids.set(e,n),n}function Mr(e,t){let n=e.snap,r=e.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=ar(t.ownerDocument||document),a=t.getAttribute&&t.getAttribute(`style`)||``,o=a&&Or.test(a),s=!!i.marginUnstable||o&&/margin/i.test(a),c=!!i.paddingUnstable||o&&/padding/i.test(a),l=r.display!==void 0&&r.display.includes(`grid`),u=r.transform!==void 0&&r.transform!==`none`,d=[];for(let e in r)(Dr.test(e)||l&&(e===`grid-template-columns`||e===`grid-template-rows`)||u&&e===`transform`||s&&e.charCodeAt(0)===109&&e.startsWith(`margin-`)||c&&e.charCodeAt(0)===112&&e.startsWith(`padding-`))&&d.push(e);e.h&&!(`height`in r)&&d.push(`height`),e.b&&!(`block-size`in r)&&d.push(`block-size`);let f=new Set(d),p=[t.tagName.toLowerCase()];for(let e in r)f.has(e)||p.push(e,r[e]);return e.rr=d,e.sig=p.join(``)+``+d.join(``),d}function Nr(e,t,n,r,i){let a=i&&i.__styleShare?r&&r.__styleShare:null,o=a?a.ids.get(e):void 0;if(o===void 0||o===-1||e.shadowRoot||e.assignedSlot)return Re(n,dr(e));let s=o+t,c=a.pseudo||=/* @__PURE__ */ new Map,l=c.get(s);if(l){let t={...l.snap},r=l.rr||Mr(l,e);for(let e=0;e<r.length;e++){let i=n.getPropertyValue(r[e]);i?t[r[e]]=i:delete t[r[e]]}return t}let u=Re(n,dr(e));return c.set(s,{snap:u,rr:null,sig:null,h:`height`in u,b:`block-size`in u}),u}function Pr(e,t=null,n={},r=null,i=null){let a=hn.get(e),o=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(typeof s!=`function`&&a&&Er(a,e)&&a.embedFonts===o&&a.excludeStyleProps===s)return a.snapshot;let c=t||getComputedStyle(e),l,u=null,d=r&&r.st.snaps.get(r.id);if(d){l={...d.snap};let t=d.rr||Mr(d,e);u=[];for(let e=0;e<t.length;e++){let n=t[e],r=c.getPropertyValue(n);r?l[n]=r:delete l[n],u.push(r)}Object.defineProperty(l,"__needsBgInline",{value:d.snap.__needsBgInline,enumerable:!1}),d.snap.__bgClipTextFix!==void 0&&Object.defineProperty(l,"__bgClipTextFix",{value:d.snap.__bgClipTextFix,enumerable:!1})}else l=mr(c,n,e,cr(e,i)),r&&r.st.snaps.set(r.id,{snap:l,rr:null,sig:null,h:`height`in l,b:`block-size`in l});let f=!1;if(typeof e.computedStyleMap==`function`){let t;for(let n of gn)if(l[n]===`0px`)try{t||=e.computedStyleMap(),t.get(n)?.toString()===`auto`&&(l[n]=`auto`,f=!0)}catch{}}Xr(e,c,l);let p=Hr(e,c,l);u!==null&&(f&&u.push(``,...gn.map(e=>l[e])),p&&u.push(``+p),wr.set(l,d.sig+``+u.join(``)+(`height`in l?``:``)+(`block-size`in l?``:``)));let m=Ln(e);return hn.set(e,{env:q,stamp:In(e,m),hosts:m,snapshot:l,embedFonts:o,excludeStyleProps:s}),l}function Fr(e,t){if(e&&e.session&&e.persist)return e;if(e&&(e.styleMap||e.styleCache||e.nodeMap)){let n=e.__ctx;return(!n||e.__ctxOpts!==t)&&(n={session:e,persist:{snapshotKeyCache:_n,defaultStyle:s.defaultStyle,baseStyle:s.baseStyle,image:s.image,resource:s.resource,background:s.background},options:t||{}},e.__ctx=n,e.__ctxOpts=t),n}return{session:{styleMap:/* @__PURE__ */ new Map,styleCache:/* @__PURE__ */ new WeakMap,nodeMap:/* @__PURE__ */ new Map},persist:{snapshotKeyCache:_n,defaultStyle:s.defaultStyle,baseStyle:s.baseStyle,image:s.image,resource:s.resource,background:s.background},options:e||t||{}}}var Ir=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Lr=e=>e.tagName===`INPUT`||e.tagName===`TEXTAREA`;function Rr(e,t,n){if(!e.style||e.style.length===0)return;let r=sr(e),i=r!=null&&!Ir.test(e.getAttribute(`style`)||``);for(let a=0;a<e.style.length;a++){let o=e.style[a];if(i&&!r.has(o)&&!(o.startsWith(`background`)&&Lr(e)))continue;let s=n.getPropertyValue(o);s&&t.style.setProperty(o,s,e.style.getPropertyPriority(o))}}function J(e,t,n,r){if(e.tagName===`STYLE`)return;let i=Fr(n,r),a=i.options&&i.options.cache||`soft`;a!==`disabled`&&Yn(e.ownerDocument),a===`disabled`&&!i.session.__bumpedForDisabled&&(K(),_n.clear(),i.session.__bumpedForDisabled=!0);let{session:o,persist:s}=i;if(!o.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}o.styleCache.set(e,t||getComputedStyle((e.ownerDocument||document).documentElement))}let c=o.styleCache.get(e);e.getAttribute?.(`style`)&&Rr(e,t,c);let l=c.getPropertyValue(`animation-name`);t&&t.style&&l&&l!==`none`&&t.style.setProperty(`animation`,`none`,`important`);let u=e.tagName?.toLowerCase()||`div`;if(Ve.has(u)){let n={};Object.defineProperty(n,"__needsBgInline",{value:_r(c),enumerable:!1});let r=Ln(e);hn.set(e,{env:q,stamp:In(e,r),hosts:r,snapshot:n,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),o.styleMap.set(t,``);return}let d=null;if(i.options&&i.options.__styleShare&&o.styleMap){let t=Ar(o),n=jr(e,t),r=e.ownerDocument||document,i=r.activeElement;n!==-1&&!kr.has(e.tagName)&&!(i&&i!==r.body&&i!==r.documentElement&&i===e)&&(!e.getRootNode||e.getRootNode()===r)&&!e.shadowRoot&&!e.assignedSlot&&(d={st:t,id:n})}let f=Pr(e,c,i.options,d,o);if(e.getAttribute?.(`style`))for(let e of[`top`,`right`,`bottom`,`left`]){let n=`margin-${e}`;f[n]===`auto`&&t.style.setProperty(n,`auto`,`important`)}f.__bgClipTextFix&&t&&t.style&&(t.style.setProperty(`background-image`,`none`,`important`),t.style.setProperty(`background-color`,`transparent`,`important`),t.style.setProperty(`color`,f.__bgClipTextFix,`important`),t.style.setProperty(`-webkit-text-fill-color`,f.__bgClipTextFix,`important`)),zr(e,c,f),t.style?.length&&f[`box-sizing`]===`border-box`&&c.getPropertyValue(`box-sizing`)!==`border-box`&&Gr(e,t,f);let p=qr(e);if(p){let e=c.getPropertyValue(`min-width`);(!e||e===`auto`||e===`0px`)&&(f[`min-width`]=`0px`)}let m=Tr(f,u),h=!0;if(je(u,(f.display||``).toLowerCase())){h=vr(e),h&&Me(u,f,p)&&yr(e,c,p)&&(h=!1),m=`${m}${h?`|c`:``}${p?`|f`:``}`;let t=f[`text-wrap-mode`]||f[`white-space`]||``;h&&t!==`nowrap`&&t!==`pre`&&(o.reconcileRisk=(o.reconcileRisk||0)+1)}let g=s.snapshotKeyCache.get(m);g===void 0&&(g=Ne(f,u,h,p),s.snapshotKeyCache.size>=vn&&s.snapshotKeyCache.delete(s.snapshotKeyCache.keys().next().value),s.snapshotKeyCache.set(m,g)),o.styleMap.set(t,g)}function zr(e,t,n){let r=t.getPropertyValue(`overflow-x`),i=t.getPropertyValue(`overflow-y`);if((r===`visible`||!r)&&(i===`visible`||!i)||t.getPropertyValue(`box-sizing`)===`border-box`||typeof e.clientWidth!=`number`||!e.offsetWidth)return;let a=e=>parseFloat(e)||0,o=e.offsetWidth-e.clientWidth-a(t.getPropertyValue(`border-left-width`))-a(t.getPropertyValue(`border-right-width`)),s=e.offsetHeight-e.clientHeight-a(t.getPropertyValue(`border-top-width`))-a(t.getPropertyValue(`border-bottom-width`)),c=(e,t)=>{let r=n[e];if(!r||!r.endsWith(`px`))return;let i=parseFloat(r);Number.isFinite(i)&&(n[e]=`${Math.round((i+t)*1e3)/1e3}px`)};o>=2&&(c(`width`,o),c(`inline-size`,o)),s>=2&&(c(`height`,s),c(`block-size`,s))}var Br=[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`],Vr=[`width`,`inline-size`,`height`,`block-size`];function Hr(e,t,n){if(!Br.some(e=>n[e]?.includes(`.`))||t.getPropertyValue(`box-sizing`)===`border-box`||n.display===`inline`)return``;for(let e of[`width`,`height`]){let t=n[`min-${e}`],r=n[`max-${e}`];if(t&&t!==`0px`&&t!==`auto`||r&&r!==`none`)return``}let r=e=>parseFloat(n[e])||0,i=r(`padding-left`)+r(`padding-right`)+r(`border-left-width`)+r(`border-right-width`),a=r(`padding-top`)+r(`padding-bottom`)+r(`border-top-width`)+r(`border-bottom-width`),o=(n[`writing-mode`]||`horizontal-tb`)!==`horizontal-tb`;for(let e of Vr){let t=n[e];t&&t.endsWith(`px`)&&(n[e]=`${Math.round((parseFloat(t)+(e===`width`||e===`inline-size`&&!o||e===`block-size`&&o?i:a))*1e3)/1e3}px`)}n[`box-sizing`]=`border-box`;let s=``;if(t.getPropertyValue(`overflow-x`)===`auto`){let t=e.scrollWidth<=e.clientWidth;n[`overflow-x`]=t?`hidden`:`auto`,t&&(s+=`x`)}if(t.getPropertyValue(`overflow-y`)===`auto`){let t=e.scrollHeight<=e.clientHeight;n[`overflow-y`]=t?`hidden`:`auto`,t&&(s+=`y`)}return s}var Ur=[`box-sizing`,...Vr,`overflow-x`,`overflow-y`],Wr=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function Gr(e,t,n){if(Wr.test(e.getAttribute(`style`)))for(let e of Ur)t.style.getPropertyValue(e)&&n[e]&&t.style.setProperty(e,n[e],t.style.getPropertyPriority(e))}function Kr(e){return e.backgroundImage&&e.backgroundImage!==`none`||e.backgroundColor&&e.backgroundColor!==`rgba(0, 0, 0, 0)`&&e.backgroundColor!==`transparent`||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||`visible`)!==`visible`}function qr(e){let t=e.parentElement;if(!t)return!1;let n=B(t).display||``;return n.includes(`flex`)||n.includes(`grid`)}function Jr(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===3&&/\S/.test(t.nodeValue))return!0;let t=e.firstElementChild,n=e.lastElementChild;if(t&&t.tagName===`BR`||n&&n.tagName===`BR`)return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=B(t);if(e.display===`none`)continue;let n=e.position;if(n!==`absolute`&&n!==`fixed`)return!0}return!1}function Yr(e){let t=e.getBoundingClientRect().top,n=-1/0,r=null;for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3){if(!/\S/.test(t.nodeValue||``))continue;r||=document.createRange(),r.selectNode(t);let e=r.getBoundingClientRect();(e.width||e.height)&&(n=Math.max(n,e.bottom));continue}if(t.nodeType!==1)continue;let e=B(t);if(e.display===`none`)continue;let i=e.position;i===`absolute`||i===`fixed`||e.float&&e.float!==`none`||(n=Math.max(n,t.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-t}function Xr(e,t,n){if(v(e)&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||![`div`,`section`,`article`,`main`,`aside`,`header`,`footer`,`nav`].includes(r)||t.aspectRatio&&t.aspectRatio!==`none`&&t.aspectRatio!==`auto`)return;let i=t.display||``;if(i.includes(`flex`)||i.includes(`grid`))return;let a=t.position;if(a===`absolute`||a===`fixed`||a===`sticky`||t.transform!==`none`||Kr(t)||qr(e))return;let o=t.overflowX||t.overflow||`visible`,s=t.overflowY||t.overflow||`visible`;if(o!==`visible`||s!==`visible`)return;let c=t.clip;if(c&&c!==`auto`&&c!==`rect(auto, auto, auto, auto)`||t.visibility===`hidden`||t.opacity===`0`||!Jr(e))return;let l=parseFloat(t.height),u=Yr(e);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n[`block-size`])}tt();var Zr=/* @__PURE__ */ new Set([`symbol`,`defs`,`pattern`,`marker`,`linearGradient`,`radialGradient`,`filter`]),Qr=/* @__PURE__ */ new WeakMap,$r=-1;function ei(e){let t=Dn();return t!==$r&&(Qr=/* @__PURE__ */ new WeakMap,$r=t),ti(e)}function ti(e){let t=Qr.get(e);if(t!==void 0)return t;let n;if(e.namespaceURI===`http://www.w3.org/2000/svg`&&(e.localName===`mask`||e.localName===`clipPath`?n=!1:Zr.has(e.localName)&&(n=!0)),n===void 0){let t=e.parentNode;n=!!(t&&t.nodeType===1)&&ti(t)}return Qr.set(e,n),n}function ni(e,t){if(e?.nodeType!==1||t?.nodeType!==1||ei(e))return;let n=e.getAttribute?.(`style`),r=!!(n&&n.includes(`var(`));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&typeof n.value==`string`&&!n.value.startsWith(`data:`)&&n.value.includes(`var(`)){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=/* @__PURE__ */ new Set;for(let r=0;r<n.length;r++){let a=n[r];if(e.has(a))continue;e.add(a);let o=n.getPropertyValue(a);if(!o||!o.includes(`var(`))continue;let s=i&&i.getPropertyValue(a);if(s)try{t.style.setProperty(a,s.trim(),n.getPropertyPriority(a))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||typeof r.value!=`string`||r.value.startsWith(`data:`)||!r.value.includes(`var(`))continue;let a=r.name,o=i&&i.getPropertyValue(a);if(o)try{t.style.setProperty(a,o.trim())}catch{}}}}W(),W(),c(),F(),Te(),E();function ri(e){return!!(!e||e.startsWith(`data:`)||e.startsWith(`blob:`))}function ii(e,t){if(!e)return null;let n=0;try{n=t?t.getBoundingClientRect().width||t.width:0}catch{}n||=window.innerWidth||1e3;let r=[];for(let t of e.split(`,`)){let e=t.trim().split(/\s+/);if(!e[0])continue;let i=e[1]||``,a=1;/^\d*\.?\d+x$/i.test(i)?a=parseFloat(i):/^\d+w$/i.test(i)&&(a=parseInt(i,10)/n),r.push({url:e[0],d:a})}if(!r.length)return null;r.sort((e,t)=>e.d-t.d);let i=window.devicePixelRatio||1;return(r.find(e=>e.d>=i)||r[r.length-1]).url}function ai(e,t){let n=e.currentSrc||``;if(n&&!ri(n))return n;let r=t.querySelectorAll(`source[srcset]`),i=null;for(let t of r){let n=t.getAttribute(`srcset`);if(!n||ri(n))continue;let r=t.getAttribute(`type`);if(r&&!S.test(r.trim()))continue;let a=t.getAttribute(`media`);if(a)try{if(window.matchMedia(a).matches)return ii(n,e)}catch{}i||=ii(n,e)}return i}function oi(e){let t=[e.getAttribute(`data-src`),e.getAttribute(`data-lazy-src`),e.getAttribute(`data-original`),e.getAttribute(`data-hi-res-src`)];for(let e of t)if(e&&!ri(e))return e;let n=e.getAttribute(`data-srcset`)||e.getAttribute(`data-lazy-srcset`);if(n){let e=n.split(`,`)[0].trim().split(/\s+/)[0];if(e&&!ri(e))return e}return null}z();function si(e,t){if(e=e.trim(),!e)return e;let n=t?`[data-sd-slotted~="${t}"]`:`[data-sd-slotted]`;return e.endsWith(`:not([data-sd-slotted])`)||e.endsWith(`:not(${n})`)?e:`${e}:not(${n})`}var ci=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,li=/^::?(?:before|after|first-letter)$/;function ui(e,t,n=!0,r){return me(e,`,`).map(e=>e.trim()).filter(Boolean).map(e=>{if(e.startsWith(`:where(`)&&e.includes(`data-sd`)||e.startsWith(`@`))return e;let i=e.match(ci);if(i&&li.test(i[0]))return`:not(*)`;let a=i?e.slice(0,i.index).trim():e;return`:where(${t} ${n?si(a,r):a})${i?i[0]:``}`}).join(`, `)}function di(e,t,n){return e?(e=e.replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(e,r,i,a)=>`${r}${i}${ui(a,t,!0,n)}{`),e):``}function fi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function pi(e){let t=``;for(let n of e)if(n.media&&n.cssRules){let e=!1;try{e=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}e&&(t+=pi(n.cssRules))}else if(n.constructor?.name===`CSSSupportsRule`)t+=`@supports ${n.conditionText}{${pi(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let e=n.cssText.slice(0,n.cssText.indexOf(`{`)+1);t+=e+(n.style?n.style.cssText:``)+pi(n.cssRules)+`}`}else t+=n.cssText+`
|
|
4
|
-
`;return t}function mi(e){let t=``;try{e.querySelectorAll(`style`).forEach(e=>{let n=null;try{n=e.sheet&&e.sheet.cssRules}catch{}t+=(n?pi(n):e.textContent||``)+`
|
|
5
|
-
`});let n=e.adoptedStyleSheets||[];for(let e of n)try{e&&e.cssRules&&(t+=pi(e.cssRules))}catch{}}catch{}return t}function hi(e,t,n){if(!t)return;let r=document.createElement(`style`);r.setAttribute(`data-sd`,n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function gi(e,t,n={}){try{let r=null,i=B(e).content;if(i&&i.includes(`url(`)){let e=i.match(/url\(["']?([^"')]+)["']?\)/);e&&(r=e[1])}let a=e.closest?.(`picture`),o=e.getAttribute(`src`)||``,s=e.getAttribute(`srcset`)||``,c=r||(a?ai(e,a):!s.trim()&&o.startsWith(`data:`)?o:e.currentSrc)||ii(s,e)||e.src||``;if((!c||ri(c))&&n.resolvePicturePlaceholders!==!1){let t=oi(e);t&&(c=t)}if(!c)return;t.getAttribute(`src`)!==c&&t.setAttribute(`src`,c),t.removeAttribute(`srcset`),t.removeAttribute(`sizes`),t.loading=`eager`,t.decoding=`sync`}catch{}}function _i(e){let t=/* @__PURE__ */ new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function vi(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return``}function yi(e,t,n){let r=[];for(let n of t){let t=vi(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join(``)}}
|
|
6
|
-
`:``}function bi(e,t){if(!e)return;let n=e=>{let n=e.getAttribute(`data-sd-slotted`)||``;t?` ${n} `.includes(` ${t} `)||e.setAttribute(`data-sd-slotted`,n?`${n} ${t}`:t):e.setAttribute(`data-sd-slotted`,n)};e.nodeType===Node.ELEMENT_NODE&&n(e),e.querySelectorAll?.(`*`).forEach(n)}async function xi(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Si(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,a=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,a=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+a))),rect:t}}function Y(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(n===0){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(t===0||n===0)try{if(t===0){let n=parseFloat(e.getAttribute(`width`));!isNaN(n)&&n>0&&(t=n)}if(n===0){let t=parseFloat(e.getAttribute(`height`));!isNaN(t)&&t>0&&(n=t)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function Ci(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,a=r?r.scrollY:0,o=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,c=e.documentElement?e.documentElement.scrollLeft:0,l=e.documentElement?e.documentElement.scrollTop:0,u=0,d=0,f=0,p=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),d=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),f=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),p=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}let m=e.createElement(`style`);if(m.setAttribute(`data-sd-iframe-pin`,``),R(m),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${d}px ${f}px ${p}px !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(m),er(e.documentElement),i||a)try{e.body&&(e.body.scrollLeft=i,e.body.scrollTop=a),e.documentElement&&(e.documentElement.scrollLeft||(e.documentElement.scrollLeft=i),e.documentElement.scrollTop||(e.documentElement.scrollTop=a))}catch{}return()=>{try{m.remove()}catch{}try{r&&typeof r.scrollTo==`function`&&r.scrollTo(i,a),e.body&&(e.body.scrollLeft=o,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=c,e.documentElement.scrollTop=l)}catch{}er(e.documentElement)}}async function wi(e,t,n){let r=await xi(e,3);if(!r)throw Error(`iframe document not accessible/ready`);let{contentWidth:i,contentHeight:a,rect:o}=Si(e),s=n?.snap;if(!s||typeof s.toPng!=`function`)throw Error(`[snapdom] iframe capture requires the snapdom entrypoints on options.snap — capture through snapdom(el) (set automatically) or pass options.snap.`);let c={...n,scale:1,clip:null,__pinned:!0},l=Ci(r,i,a),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display=`block`,u.style.width=`${i}px`,u.style.height=`${a}px`;let d=document.createElement(`div`);return t.nodeMap.set(d,e),J(e,d,t,n),d.style.overflow=`hidden`,d.style.display=`block`,d.style.width||(d.style.width=`${Math.round(o.width)}px`),d.style.height||(d.style.height=`${Math.round(o.height)}px`),d.appendChild(u),d}function Ti(e){try{let t=e&&e.accentColor;if(t&&t!==`auto`&&t!==`none`)return t;let n=e&&e.color;if(n)return n}catch{}return`#0a6ed1`}function Ei(e){let{width:t,height:n}=Y(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Number.isFinite(a)&&a>0?a:t||r.width||128,c=Number.isFinite(o)&&o>0?o:n||r.height||16,l=Number.parseFloat(e.min)||0,u=Number.isFinite(Number.parseFloat(e.max))?Number.parseFloat(e.max):100,d=Number.parseFloat(e.value),f=u-l,p=f>0&&Number.isFinite(d)?Math.min(1,Math.max(0,(d-l)/f)):.5,m=`middle`;try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let h=document.createElement(`div`);h.setAttribute(`data-snapdom-input-replacement`,`range`),h.style.cssText=`display:inline-block;width:${s}px;height:${c}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);g.setAttribute(`width`,String(s)),g.setAttribute(`height`,String(c)),g.setAttribute(`viewBox`,`0 0 ${s} ${c}`),g.style.overflow=`visible`,h.appendChild(g);function _(){let t=Ti(i),n=!!e.disabled,r=Math.max(2,Math.min(4,c)),a=(c-r)/2,o=Math.max(10,Math.min(14,Math.max(c,10))),l=o/2,u=l+p*Math.max(0,s-o);g.innerHTML=``;let d=(e,t,n,i)=>{let o=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);o.setAttribute(`x`,String(e)),o.setAttribute(`y`,String(a)),o.setAttribute(`width`,String(Math.max(0,t))),o.setAttribute(`height`,String(r)),o.setAttribute(`rx`,String(r/2)),o.setAttribute(`fill`,n),i&&o.setAttribute(`fill-opacity`,i),g.appendChild(o)};d(0,s,`#808080`,`0.4`),d(0,u,t);let f=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);f.setAttribute(`cx`,String(u)),f.setAttribute(`cy`,String(c/2)),f.setAttribute(`r`,String(l)),f.setAttribute(`fill`,t),g.appendChild(f),n&&g.setAttribute(`opacity`,`0.5`),h.style.setProperty(`width`,`${s}px`,`important`),h.style.setProperty(`height`,`${c}px`,`important`),h.style.setProperty(`min-width`,`${s}px`,`important`),h.style.setProperty(`min-height`,`${c}px`,`important`)}return _(),{el:h,applyVisual:_}}function Di(e){let{width:t,height:n}=Y(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,s||16),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),d=(e.type||`text`).toLowerCase()===`checkbox`,f=!!e.checked,p=!!e.indeterminate,m=Math.max(Math.min(l,u),12),h=`middle`;try{i&&i.verticalAlign&&(h=i.verticalAlign)}catch{}let g=document.createElement(`div`);g.setAttribute(`data-snapdom-input-replacement`,e.type||`checkbox`),g.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${h};flex-shrink:0;line-height:0;`;let _=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);_.setAttribute(`width`,String(m)),_.setAttribute(`height`,String(m)),_.setAttribute(`viewBox`,`0 0 ${m} ${m}`),g.appendChild(_);function v(){let e=Ti(i),t=m-2;if(_.innerHTML=``,d){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);if(n.setAttribute(`x`,`1`),n.setAttribute(`y`,`1`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`rx`,`2`),n.setAttribute(`ry`,`2`),n.setAttribute(`fill`,f?e:`none`),n.setAttribute(`stroke`,e),n.setAttribute(`stroke-width`,`2`),_.appendChild(n),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);e.setAttribute(`d`,`M 3 ${m/2} L ${m/2-1} ${m-1-2} L ${m-1-2} 3`),e.setAttribute(`stroke`,`white`),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`fill`,`none`),e.setAttribute(`stroke-linecap`,`round`),e.setAttribute(`stroke-linejoin`,`round`),_.appendChild(e)}else if(p){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),r=Math.max(6,t-4);n.setAttribute(`x`,String((m-r)/2)),n.setAttribute(`y`,String((m-2)/2)),n.setAttribute(`width`,String(r)),n.setAttribute(`height`,`2`),n.setAttribute(`fill`,e),n.setAttribute(`rx`,`1`),_.appendChild(n)}}else{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);if(t.setAttribute(`cx`,String(m/2)),t.setAttribute(`cy`,String(m/2)),t.setAttribute(`r`,String((m-2)/2)),t.setAttribute(`fill`,f?e:`none`),t.setAttribute(`stroke`,e),t.setAttribute(`stroke-width`,`2`),_.appendChild(t),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),t=Math.max(2,(m-4)*.35);e.setAttribute(`cx`,String(m/2)),e.setAttribute(`cy`,String(m/2)),e.setAttribute(`r`,String(t)),e.setAttribute(`fill`,`white`),_.appendChild(e)}}g.style.setProperty(`width`,`${m}px`,`important`),g.style.setProperty(`height`,`${m}px`,`important`),g.style.setProperty(`min-width`,`${m}px`,`important`),g.style.setProperty(`min-height`,`${m}px`,`important`)}return v(),{el:g,applyVisual:v}}var Oi=new o(80);async function ki(e){if(s.resource?.has(e))return s.resource.get(e);if(Oi.has(e))return Oi.get(e);let t=(async()=>{let t=await N(e,{as:`dataURL`,silent:!0});if(!t.ok||typeof t.data!=`string`)throw Error(`[snapDOM] Failed to read blob URL: ${e}`);return s.resource?.set(e,t.data),t.data})();Oi.set(e,t);try{let n=await t;return Oi.set(e,n),n}catch(t){throw Oi.delete(e),t}}var Ai=/\bblob:[^)"'\s]+/g;function ji(e){return typeof e==`string`&&e.startsWith(`blob:`)}function Mi(e){return(e||``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||``}:null}).filter(Boolean)}function Ni(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(`, `)}function Pi(e,t){let n=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&n.unshift(e),n}async function Fi(e,t=null){if(!e)return;let n=t,r=/* @__PURE__ */ new Set,i=[],a=/* @__PURE__ */ new Map,o=(e,t,n,o)=>{r.add(n),i.push(()=>{a.has(n)&&(e.setAttribute(t,a.get(n)),o?.())})},s=(e,t)=>{if(!e||!e.includes(`blob:`))return;let n=e.match(Ai)||[];if(n.length){for(let e of n)r.add(e);i.push(()=>{let n=e.replace(Ai,e=>a.get(e)||e);n!==e&&t(n)})}},c=Pi(e,`img`);for(let e of c)try{let t=e.getAttribute(`src`)||e.currentSrc||``;ji(t)&&o(e,`src`,t);let n=e.getAttribute(`srcset`);if(n&&n.includes(`blob:`)){let t=Mi(n);for(let e of t)ji(e.url)&&r.add(e.url);i.push(()=>{let n=!1;for(let e of t)a.has(e.url)&&(e.url=a.get(e.url),n=!0);n&&e.setAttribute(`srcset`,Ni(t))})}}catch(e){U(n,`resolveBlobUrls for img failed`,e)}let l=Pi(e,`image`);for(let e of l)try{let t=`http://www.w3.org/1999/xlink`,n=e.getAttribute(`href`)||e.getAttributeNS?.(t,`href`);ji(n)&&o(e,`href`,n,()=>e.removeAttributeNS?.(t,`href`))}catch(e){U(n,`resolveBlobUrls for SVG image href failed`,e)}let u=Pi(e,`[style*='blob:']`);for(let e of u)try{s(e.getAttribute(`style`),t=>e.setAttribute(`style`,t))}catch(e){U(n,`replaceBlobUrls in inline style failed`,e)}let d=Pi(e,`style`);for(let e of d)try{s(e.textContent||``,t=>{e.textContent=t})}catch(e){U(n,`replaceBlobUrls in style tag failed`,e)}for(let t of[`poster`]){let r=Pi(e,`[${t}^='blob:']`);for(let e of r)try{let n=e.getAttribute(t);ji(n)&&o(e,t,n)}catch(e){U(n,`resolveBlobUrls for ${t} failed`,e)}}if(!r.size)return;let f=[...r],p=0;await Promise.all(Array.from({length:Math.min(4,f.length)},async()=>{for(;p<f.length;){let e=f[p++];try{a.set(e,await ki(e))}catch(e){U(n,`blobUrlToDataUrl failed; keeping original URL`,e)}}}));for(let e of i)try{e()}catch(e){U(n,`resolved blob URL write failed`,e)}}H();var Ii=/* @__PURE__ */ new Set([`rgba(0, 0, 0, 0)`,`transparent`]),Li=`Highlight`;function Ri(e){let t=(e.ownerDocument||document).getSelection?.();if(!t||t.isCollapsed||t.rangeCount===0)return null;let n=[];for(let r=0;r<t.rangeCount;r+=1){let i=t.getRangeAt(r);if(!i.collapsed)try{i.intersectsNode(e)&&n.push(i)}catch{}}return n.length?{ranges:n,styles:/* @__PURE__ */ new Map}:null}function zi(e,t){if(t.styles.has(e))return t.styles.get(e);let n;try{let r=getComputedStyle(e);if(r.userSelect===`none`||r.webkitUserSelect===`none`||r.getPropertyValue(`-webkit-user-select`)===`none`)return t.styles.set(e,null),null;let i=getComputedStyle(e,`::selection`),a=[],o=i.backgroundColor,s=o&&!Ii.has(o)&&o!==r.backgroundColor;a.push(`background-color:${s?o:Li}`),i.color&&i.color!==r.color&&a.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&a.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!==`none`&&i.textDecorationLine!==r.textDecorationLine&&a.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||`solid`} ${i.textDecorationColor||`currentcolor`}`),n=a.join(`;`)}catch{n=`background-color:${Li}`}return t.styles.set(e,n),n}function Bi(e,t){let n=e.data;if(!n)return null;let r=e.parentElement;if(!r)return null;let i=[];for(let r of t.ranges){let t=!1;try{t=r.intersectsNode(e)}catch{}if(!t)continue;let a=r.startContainer===e?r.startOffset:0,o=r.endContainer===e?r.endOffset:n.length;o>a&&i.push([a,o])}if(i.length===0)return null;let a=zi(r,t);if(!a)return null;i.sort((e,t)=>e[0]-t[0]);let o=e.ownerDocument||document,s=o.createDocumentFragment(),c=0;for(let[e,t]of i){e>c&&s.append(o.createTextNode(n.slice(c,e)));let r=o.createElement(`span`);r.setAttribute(`data-snapdom-selection`,``),r.setAttribute(`style`,`all:unset;${a}`),r.textContent=n.slice(e,t),s.append(r),c=t}return c<n.length&&s.append(o.createTextNode(n.slice(c))),s}var Vi=e=>Number.parseFloat(e)||0,Hi=[`font-family`,`font-size`,`font-weight`,`font-style`,`font-variant`,`font-stretch`,`letter-spacing`,`word-spacing`,`text-transform`,`text-indent`,`text-align`,`line-height`,`tab-size`,`direction`];function Ui(e,t){try{let n=getComputedStyle(e,`::selection`).backgroundColor;if(n&&!Ii.has(n)&&n!==t.backgroundColor)return n}catch{}return Li}function Wi(e,t){let n=e.ownerDocument||document;if(n.activeElement!==e)return;let r=null,i=null;try{r=e.selectionStart,i=e.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let a=e.value||``;if(e.localName===`input`&&e.type===`password`&&(a=`•`.repeat(a.length)),!a)return;let o=getComputedStyle(e),s=e.localName===`textarea`,c=Vi(o.paddingLeft),l=Vi(o.paddingTop),u=e.clientWidth-c-Vi(o.paddingRight),d=e.clientHeight-l-Vi(o.paddingBottom),f=n.createElement(`div`);f.style.cssText=`position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;`;for(let e of Hi)f.style.setProperty(e,o.getPropertyValue(e));s?(f.style.whiteSpace=`pre-wrap`,f.style.overflowWrap=`break-word`,f.style.width=`${Math.max(0,u)}px`):f.style.whiteSpace=`pre`;let p=n.createElement(`span`);p.textContent=a.slice(r,i),f.append(n.createTextNode(a.slice(0,r)),p,n.createTextNode(a.slice(i))),n.body.appendChild(f);let m=[];try{let t=f.getBoundingClientRect(),n=-e.scrollLeft,r=-e.scrollTop;if(!s){r+=Math.max(0,(d-t.height)/2);let e=o.direction===`rtl`,i=o.textAlign;i===`start`?i=e?`right`:`left`:i===`end`&&(i=e?`left`:`right`);let a=u-t.width;a>0&&(i===`right`?n+=a:i===`center`&&(n+=a/2))}for(let e of p.getClientRects())e.width<=0||e.height<=0||m.push({x:c+(e.left-t.left)+n,y:l+(e.top-t.top)+r,width:e.width,height:e.height})}finally{f.remove()}if(m.length===0)return;let h=Ui(e,o);t.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${h},${h})`),positions:m.map(e=>`${e.x}px ${e.y}px`),sizes:m.map(e=>`${e.width}px ${e.height}px`),repeats:m.map(()=>`no-repeat`),origins:m.map(()=>`padding-box`),clips:m.map(()=>`padding-box`),base:{image:o.backgroundImage,position:o.backgroundPosition,size:o.backgroundSize,repeat:o.backgroundRepeat,origin:o.backgroundOrigin,clip:o.backgroundClip}}}function Gi(e){for(let t of e.keys()){let e=t.__snapdomFieldSelection;if(!e)continue;delete t.__snapdomFieldSelection;let{images:n,positions:r,sizes:i,repeats:a,origins:o,clips:s,base:c}=e,l=t.style.backgroundImage||c.image;l&&l!==`none`?(n.push(l),r.push(t.style.backgroundPosition||c.position),i.push(t.style.backgroundSize||c.size),a.push(t.style.backgroundRepeat||c.repeat),o.push(t.style.backgroundOrigin||c.origin),s.push(t.style.backgroundClip||c.clip)):(n.push(`linear-gradient(transparent,transparent)`),r.push(`0% 0%`),i.push(`auto`),a.push(`repeat`),o.push(c.origin||`padding-box`),s.push(c.clip||`border-box`)),t.style.backgroundImage=n.join(`,`),t.style.backgroundPosition=r.join(`,`),t.style.backgroundSize=i.join(`,`),t.style.backgroundRepeat=a.join(`,`),t.style.backgroundOrigin=o.join(`,`),t.style.backgroundClip=s.join(`,`)}}z();var Ki=/* @__PURE__ */ new Map,qi=/* @__PURE__ */ new Set([`IFRAME`]);function Ji(e,t){Ki.set(String(e).toUpperCase(),t)}function Yi(e){let t=B(e),n=t.display;if(n===`none`)return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=e=>parseFloat(e)||0,a=(e,n,i,a,o)=>{if(!r||!e?.endsWith(`px`))return null;let s=parseFloat(e);if(!Number.isFinite(s)||s<0)return null;if(t.boxSizing===`border-box`)return s;let c=a-o-i;return s+n+i+(c>0&&s+n<o+c/2?c:0)},[o,s,c,l]=/scroll|auto/.test(t.overflow)?[e.offsetWidth,e.clientWidth,e.offsetHeight,e.clientHeight]:[0,0,0,0],u=a(t.width,i(t.paddingLeft)+i(t.paddingRight),i(t.borderLeftWidth)+i(t.borderRightWidth),o,s),d=a(t.height,i(t.paddingTop)+i(t.paddingBottom),i(t.borderTopWidth)+i(t.borderBottomWidth),c,l);if(u===null||d===null){let{width:t,height:n}=Y(e),r=t,i=n;if(u===null&&!r||d===null&&!i){let t=e.getBoundingClientRect();r||=t.width||0,i||=t.height||0}u??=r,d??=i}let f=document.createElement(`div`);return f.style.cssText=`display:${n===`inline`?`inline-block`:n};box-sizing:border-box;width:${u}px;height:${d}px;visibility:hidden;`,f}var Xi=/* @__PURE__ */ new Set([`style`,`option`,`optgroup`]),Zi=200,Qi=/* @__PURE__ */ new Set([`img`,`canvas`,`video`,`iframe`,`object`,`embed`]);function $i(e,t){return e.right>=t.left-Zi&&e.left<=t.right+Zi&&e.bottom>=t.top-Zi&&e.top<=t.bottom+Zi}function ea(e,t){if(e===t.root)return!1;let n;try{n=e.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=B(e);if(r.display===`inline`&&!Qi.has((e.localName||``).toLowerCase()))return!1;let i=t.rect,a=e.scrollWidth||0,o=e.scrollHeight||0,s={left:r.direction===`rtl`?Math.min(n.left,n.right-a):n.left,top:n.top,right:Math.max(n.right,n.left+a),bottom:Math.max(n.bottom,n.top+o)},c=r.writingMode||``;if((c.startsWith(`vertical`)||c.startsWith(`sideways`))&&(s.top=Math.min(n.top,n.bottom-o),s.left=Math.min(s.left,n.right-a)),$i(s,i))return!1;let l=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;l.nextNode();){let e=l.currentNode.getBoundingClientRect();if((e.width>0||e.height>0)&&$i(e,i))return!1}return!0}function ta(e,t,n){let r=e.cloneNode(!1);e.tagName===`IMG`&&(r.removeAttribute(`src`),r.removeAttribute(`srcset`),r.removeAttribute(`sizes`)),J(e,r,t,n);let{width:i,height:a}=Y(e);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),a>0&&(r.style.height=`${a}px`,r.style.minHeight=`${a}px`,r.style.maxHeight=`${a}px`),r.style.visibility=`hidden`;let o=e.parentElement?B(e.parentElement).display:``,s=B(e).position;if(!/flex|grid|table/.test(o)&&(s===`static`||s===`relative`)){let t=e=>{let t=B(e);return t.display!==`none`&&t.position!==`absolute`&&t.position!==`fixed`},n=e.getBoundingClientRect(),i=e.previousElementSibling;for(;i&&!t(i);)i=i.previousElementSibling;if(i){let e=n.top-i.getBoundingClientRect().bottom;e>=0&&(r.style.marginTop=`${e}px`)}let a=e.nextElementSibling;for(;a&&!t(a);)a=a.nextElementSibling;if(a){let e=a.getBoundingClientRect().top-n.bottom;e>=0&&(r.style.marginBottom=`${e}px`)}}return r.style.boxSizing=`border-box`,r}async function na(e,t,n){if(!e)throw Error(`Invalid node`);t.slicer?.due()&&await t.slicer.pause();let r=/* @__PURE__ */ new Set,i=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let r=(e.localName||e.tagName||``).toLowerCase(),i=Ee(e);if(i&&(e.id===`snapdom-sandbox`||e.hasAttribute(`data-snapdom-sandbox`))||e!==n.element&&i||Be.has(r))return null;if(r===`foreignobject`&&e.parentElement?.closest?.(`foreignObject`))return U(t,`Nested <foreignObject> unsupported; skipped`),null;if(r===`source`&&e.parentElement?.localName===`picture`)return null}if(e.nodeType===Node.TEXT_NODE){if(t.selection){let n=Bi(e,t.selection);if(n)return n}return e.cloneNode(!0)}if(e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute(`data-capture`)===`exclude`){if(n.excludeMode===`hide`)return Yi(e);if(n.excludeMode===`remove`)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if(n.excludeMode===`hide`)return Yi(e);if(n.excludeMode===`remove`)return null}}catch(e){console.warn(`Invalid exclude selector: ${t}`,e)}if(n.excludePredicates)for(let t of n.excludePredicates)try{if(t(e))return n.excludeMode===`remove`?null:Yi(e)}catch(e){console.warn(`Error in exclude predicate:`,e)}if(typeof n.filter==`function`)try{if(!n.filter(e)){if(n.filterMode===`hide`)return Yi(e);if(n.filterMode===`remove`)return null}}catch(e){console.warn(`Error in filter function:`,e)}if(e!==n.element&&!Xi.has(e.localName)&&!y(e)&&B(e).display===`none`){let r=e.cloneNode(!1);e.tagName===`IMG`&&(r.removeAttribute(`src`),r.removeAttribute(`srcset`)),r.style.setProperty(`display`,`none`,`important`);for(let i of e.querySelectorAll(`style`)){let e=await na(i,t,n);e&&r.appendChild(e)}return r}if(t.clip&&ea(e,t.clip))return ta(e,t,n);if(n.__resolveNodeHooks)for(let r of n.__resolveNodeHooks){let i;try{i=await r(e,n)}catch(e){U(t,`resolveNode plugin hook failed`,e)}if(i===null)return null;if(i?.nodeType)return i.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(i,e),J(e,i,t,n)),i}{let r=qi.has(e.tagName)&&Ki.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}if(e.getAttribute(`data-capture`)===`placeholder`){let r=e.cloneNode(!1);t.nodeMap.set(r,e),J(e,r,t,n);let i=document.createElement(`div`);return i.textContent=e.getAttribute(`data-placeholder-text`)||``,i.style.cssText=`color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;`,r.appendChild(i),r}{let r=!qi.has(e.tagName)&&Ki.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}let o;try{if(o=e.cloneNode(!1),ni(e,o),t.nodeMap.set(o,e),e.tagName===`IMG`){gi(e,o,n);try{let t=window.getComputedStyle(e),n=parseFloat(t.width),r=parseFloat(t.height);if(!(n>0)||!(r>0)){let i=Y(e),a=e=>parseFloat(t.getPropertyValue(e))||0,o=t.getPropertyValue(`box-sizing`)===`border-box`;n>0||(n=i.width-(o?0:a(`padding-left`)+a(`padding-right`)+a(`border-left-width`)+a(`border-right-width`))),r>0||(r=i.height-(o?0:a(`padding-top`)+a(`padding-bottom`)+a(`border-top-width`)+a(`border-bottom-width`)))}let i=Math.round((n||0)*1e3)/1e3,a=Math.round((r||0)*1e3)/1e3;i&&(o.dataset.snapdomWidth=String(i)),a&&(o.dataset.snapdomHeight=String(a))}catch(e){U(t,`IMG measurement failed`,e)}try{let t=e.getAttribute(`style`)||``,n=window.getComputedStyle(e),r=e=>{let r=t.match(RegExp(`${e}\\s*:\\s*([^;]+)`,`i`)),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||``))},i=parseFloat(o.dataset.snapdomWidth||`0`)||0,a=parseFloat(o.dataset.snapdomHeight||`0`)||0,s=r(`width`)||!(i>0),c=r(`height`)||!(a>0);s&&i>0&&(o.style.width=`${i}px`),c&&a>0&&(o.style.height=`${a}px`);let l=n.getPropertyValue(`object-fit`),u=n.getPropertyValue(`object-position`);l&&l!==`fill`?(o.style.objectFit=l,u&&(o.style.objectPosition=u)):(i>0&&(o.style.minWidth=`${i}px`),a>0&&(o.style.minHeight=`${a}px`))}catch(e){U(t,`IMG dimension freeze failed`,e)}}}catch(t){throw console.error(`[Snapdom] Failed to clone node:`,e,t),t}let s=null;if(_(e,`textarea`)){let{width:t,height:n}=Y(e),r=t||e.getBoundingClientRect().width||0,i=n||e.getBoundingClientRect().height||0;r&&(o.style.width=`${r}px`),i&&(o.style.height=`${i}px`)}if(_(e,`input`)){let n=(e.type||`text`).toLowerCase();if((n===`checkbox`||n===`radio`)&&(at()||e.indeterminate)){let{el:n,applyVisual:r}=Di(e);t.nodeMap.set(n,e),s=r,o=n}else if(n===`range`&&(at()||V())){let{el:n,applyVisual:r}=Ei(e);t.nodeMap.set(n,e),s=r,o=n}else if(n===`color`&&V()){let t=o,n=e.value||`#000000`;s=()=>{t.style.setProperty(`background-color`,n,`important`),t.style.setProperty(`color`,`transparent`,`important`),t.style.setProperty(`-webkit-text-fill-color`,`transparent`,`important`),t.style.setProperty(`appearance`,`none`,`important`),t.style.setProperty(`-webkit-appearance`,`none`,`important`)},t.removeAttribute(`value`)}else if((n===`date`||n===`time`||n===`datetime-local`)&&(at()||V())){o.setAttribute(`type`,`text`);let t=e.value;n===`date`&&e.valueAsDate&&(t=e.valueAsDate.toLocaleDateString(void 0,{timeZone:`UTC`})),o.value=t,o.setAttribute(`value`,t)}else{let t=h(e)?g(e.value):e.value;o.value=t,o.setAttribute(`value`,t),e.checked!==void 0&&(o.checked=e.checked,e.checked?o.setAttribute(`checked`,``):o.removeAttribute(`checked`),e.indeterminate&&(o.indeterminate=e.indeterminate))}}if((_(e,`input`)||_(e,`textarea`))&&!e.value&&e.placeholder)try{let t=window.getComputedStyle(e,`::placeholder`),n=t&&t.color;if(n&&n!==`rgba(0, 0, 0, 0)`){let e=`snapdom-ph-`+(Math.random()*1e6|0);o.classList.add(e);let r=document.createElement(`style`);r.textContent=`.${e}::placeholder{color:${n}!important;opacity:${t.opacity||`1`}!important;-webkit-text-fill-color:${n}!important;}`,o.prepend(r)}}catch{}if(_(e,`select`)&&(i=new Set(Array.from(e.options).filter(e=>e.selected))),_(e,`textarea`)&&(a=e.value),_(e,`input`)||_(e,`textarea`)||_(e,`select`)){e.disabled&&o.setAttribute(`disabled`,``),e.required&&o.setAttribute(`required`,``),e.readOnly&&o.setAttribute(`readonly`,``);let t=e;t.min!==void 0&&t.min!==``&&o.setAttribute(`min`,t.min),t.max!==void 0&&t.max!==``&&o.setAttribute(`max`,t.max),t.pattern!==void 0&&t.pattern!==``&&o.setAttribute(`pattern`,t.pattern);let n=e.getAttribute(`aria-invalid`);n!==null&&o.setAttribute(`aria-invalid`,n)}if(ei(e)||J(e,o,t,n),s&&s(),n.captureSelection&&(_(e,`input`)||_(e,`textarea`)))try{Wi(e,o)}catch(e){U(t,`inlineTextFieldSelection failed`,e)}if(y(e)&&!ei(e)){let t=[`fill`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-miterlimit`,`opacity`,`fill-opacity`,`stroke-opacity`,`fill-rule`,`clip-rule`,`marker`,`marker-start`,`marker-mid`,`marker-end`,`visibility`,`display`,`color`];try{let n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&o.style.setProperty(e,t)}}catch{}}if(e.shadowRoot){Wn(e.shadowRoot);try{let t=e.shadowRoot.querySelectorAll(`slot`);for(let e of t){let t=e.assignedNodes?.()||[];for(let e of t)r.add(e)}}catch{}let i=fi(t),a=`[data-sd="${i}"]`;t.shadowScopes||=/* @__PURE__ */ new WeakMap,t.shadowScopes.set(e.shadowRoot,i);try{o.setAttribute(`data-sd`,i)}catch{}let s=mi(e.shadowRoot);!t.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(s)&&(t.__shadowPseudo=!0);let c=di(s,a,i),l=yi(e,_i(s),a);hi(o,l+c,i);let u=document.createDocumentFragment(),d=await Promise.all(Array.from(e.shadowRoot.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE&&e.tagName===`STYLE`?null:na(e,t,n).catch(()=>null)));u.append(...d.filter(e=>!!e)),o.appendChild(u)}if(e.tagName===`SLOT`){let r=t.shadowScopes?.get(e.getRootNode()),i=e.assignedNodes?.()||[],a=i.length?e.assignedNodes?.({flatten:!0})||i:[],o=a.length?a:Array.from(e.childNodes),s=document.createDocumentFragment(),c=await Promise.all(o.map(e=>na(e,t,n).then(e=>(e&&i.length&&bi(e,r),e||null)).catch(()=>null)));return s.append(...c.filter(e=>!!e)),s}let c=t=>r.has(t)||e.shadowRoot&&!t.assignedSlot,l=await Promise.all(Array.from(e.childNodes).map(e=>c(e)?null:na(e,t,n).catch(()=>null)));if(o.append(...l.filter(e=>!!e)),i&&_(o,`select`)){let e=!1;for(let n of o.options){let r=i.has(t.nodeMap.get(n));n.selected=r,r?n.setAttribute(`selected`,``):n.removeAttribute(`selected`),e||=r}if(!e&&!o.multiple){let e=o.ownerDocument.createElement(`option`);e.hidden=!0,e.style.setProperty(`display`,`none`,`important`),e.setAttribute(`selected`,``),e.value=``,o.appendChild(e)}}return a!==null&&_(o,`textarea`)&&(o.textContent=a),o}async function ra(e,t,n){let r=!1;try{r=!!(e.contentDocument||e.contentWindow?.document)}catch(e){U(t,`iframe same-origin probe failed`,e)}if(r)try{return await wi(e,t,n)}catch(e){console.warn(`[SnapDOM] iframe rasterization failed, fallback:`,e)}if(r||console.warn(`[snapdom] Unreadable cross-origin <iframe>; keeping its box. Use { placeholders: false } to hide it.`,e),n.placeholders){let{width:r,height:i}=Y(e),a=document.createElement(`div`);return a.style.cssText=`width:${r}px;height:${i}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,J(e,a,t,n),a}{let{width:r,height:i}=Y(e),a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,J(e,a,t,n),a}}function ia(e){try{let t=Math.max(1,Math.min(32,e.width)),n=Math.max(1,Math.min(32,e.height)),r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`,{willReadFrequently:!0});if(!i)return!1;i.drawImage(e,0,0,t,n);let a=i.getImageData(0,0,t,n).data;for(let e=3;e<a.length;e+=4)if(a[e]!==0)return!1;return!0}catch{return!1}}var aa=.95;function oa(e,t,n){try{let r=e.getImageData(0,0,t,n).data;for(let e=3;e<r.length;e+=4)if(r[e]!==255)return!1;return!0}catch{return!1}}async function sa(e,t,n){let r=``;try{let t=ia(e);t&&=(await nt(),ia(e));let n=null;if(!t){n=e.getContext(`2d`,{willReadFrequently:!0});try{n&&n.getImageData(0,0,1,1)}catch{}V()&&await nt()}if(r=e.toDataURL(`image/png`),!r||r===`data:,`){try{n&&n.getImageData(0,0,1,1)}catch{}if(await nt(),r=e.toDataURL(`image/png`),!r||r===`data:,`){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0),r=t.toDataURL(`image/png`))}}}catch(e){U(t,`Canvas toDataURL failed; using fallback`,e)}n&&n.debug&&r&&ia(e)&&U(t,`Empty canvas; capture after its first frame`,e);let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch(e){U(t,`img decoding/loading hints failed`,e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:a,height:o}=Y(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),J(e,i,t,n),i}async function ca(e,t,n){let r=``,i=e.poster&&e.paused&&!e.currentTime&&!e.played.length,a=document.createElement(`img`);try{a.decoding=`sync`,a.loading=`eager`}catch{}if(!i)try{let t=document.createElement(`canvas`);t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL(oa(n,t.width,t.height)?`image/jpeg`:`image/png`,aa),(!r||r===`data:,`)&&(r=``))}catch(e){U(t,`Video capture failed; using poster`,e)}r?a.src=r:e.poster&&(a.src=e.poster),a.width=e.videoWidth||e.offsetWidth||0,a.height=e.videoHeight||e.offsetHeight||0;let{width:o,height:s}=Y(e);return o>0&&(a.style.width=`${o}px`),s>0&&(a.style.height=`${s}px`),a.style.objectFit=`contain`,t.nodeMap.set(a,e),J(e,a,t,n),a}async function la(e,t,n){if(!e.controls)return;let{width:r,height:i}=Y(e),a=Math.round(r||e.offsetWidth||300),o=Math.round(i||e.offsetHeight||54),s=o/2,c=Math.max(4,o*.16),l=o*.34,u=a-o*.34,d=l+c+o*.55,f=Math.max(0,u-o*.7-d),p=Math.max(9,Math.round(o*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}" viewBox="0 0 ${a} ${o}"><rect width="${a}" height="${o}" rx="${Math.min(o/2,10)}" fill="#f1f3f4"/><path d="M ${l} ${s-c} L ${l+c} ${s} L ${l} ${s+c} Z" fill="#5f6368"/><rect x="${d}" y="${s-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${s}" r="${Math.max(3,o*.09)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement(`img`);try{h.decoding=`sync`,h.loading=`eager`}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,h.width=a,h.height=o,h.style.width=`${a}px`,h.style.height=`${o}px`,t.nodeMap.set(h,e),J(e,h,t,n),h}async function ua(e,t,n){let r=e.getAttribute(`data`)||e.getAttribute(`src`)||``,i=(e.getAttribute(`type`)||``).toLowerCase(),a=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&a){let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch{}i.src=r;let{width:a,height:o}=Y(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),J(e,i,t,n),i}let o=null;try{o=e.contentDocument}catch{}if(o)try{let r=await wi(e,t,n);if(r)return r}catch{}r&&console.warn(`[snapdom] <${e.localName}> capture failed (${i||`unknown type`}); using fallback children`)}Ji(`IFRAME`,ra),Ji(`CANVAS`,sa),Ji(`VIDEO`,ca),Ji(`AUDIO`,la),Ji(`OBJECT`,ua),Ji(`EMBED`,ua),W(),E(),tt(),c(),z();var da=[/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],fa=Object.assign({materialIconsFilled:`https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2`,materialIconsOutlined:`https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2`,materialIconsRound:`https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2`,materialIconsSharp:`https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2`},typeof window<`u`&&window.__SNAPDOM_ICON_FONTS__||{});function pa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ma(e){let t=Array.isArray(e)?e:e?[e]:[],n=[];for(let e of t)e instanceof RegExp?n.push(e):typeof e==`string`?n.push(new RegExp(pa(e),`i`)):console.warn(`[snapdom] Ignored invalid iconFont value:`,e);return n}function ha(e,t){let n=typeof e==`string`?e:``;for(let e of da)if(e.test(n))return!0;if(t){for(let e of t)if(e instanceof RegExp&&e.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function ga(e,t){if(typeof e!=`string`||!e)return!1;let n;try{n=new URL(e,typeof location<`u`?location.href:void 0)}catch{return ha(e,t)}let r=n.searchParams.getAll(`family`).flatMap(e=>e.split(`|`)).map(e=>e.split(`:`)[0].trim()).filter(Boolean);return r.length?r.every(e=>ha(e,t)):ha(e,t)}function _a(e=``){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var va=/* @__PURE__ */ new Map;function ya(e=``){let t=Object.create(null),n=String(e||``),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function ba(e,t,n){let r=String(e||``),i=r.toLowerCase(),a=String(t||``).toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i)||!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let o=n&&(n.FILL??n.fill),s=`outlined`;/\brounded\b/.test(a)||/\bround\b/.test(a)?s=`rounded`:/\bsharp\b/.test(a)?s=`sharp`:/\boutlined\b/.test(a)&&(s=`outlined`);let c=o===1,l=null;if(c&&(s===`outlined`&&fa.materialIconsFilled?l={url:fa.materialIconsFilled,alias:`snapdom-mi-filled`}:s===`rounded`&&fa.materialIconsRound?l={url:fa.materialIconsRound,alias:`snapdom-mi-round`}:s===`sharp`&&fa.materialIconsSharp&&(l={url:fa.materialIconsSharp,alias:`snapdom-mi-sharp`})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!va.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:`normal`,weight:`400`});await e.load(),document.fonts.add(e),va.set(l.alias,!0)}catch{return va.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(va.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function xa(e=`Material Icons`,t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,``)}"`),document.fonts.ready])}catch{}}function Sa(e){let t=e.getPropertyValue(`-webkit-text-fill-color`)?.trim()||``,n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!==`currentcolor`)return t;let r=e.color?.trim();return r&&r!==`inherit`?r:`#000`}async function Ca(e,{family:t=`Material Icons`,weight:n=`normal`,fontSize:r=32,color:i=`#000`,variation:a=``,className:o=``}={}){let s=String(t||``).replace(/^['"]+|['"]+$/g,``),c=window.devicePixelRatio||1,{familyForMeasure:l,familyForCanvas:u}=await ba(s,o,ya(a));await xa(u.replace(/^["']+|["']+$/g,``),r);let d=document.createElement(`span`);R(d),d.textContent=e,d.style.position=`absolute`,d.style.visibility=`hidden`,d.style.left=`-99999px`,d.style.whiteSpace=`nowrap`,d.style.fontFamily=l,d.style.fontWeight=String(n||`normal`),d.style.fontSize=`${r}px`,d.style.lineHeight=`1`,d.style.margin=`0`,d.style.padding=`0`,d.style.fontFeatureSettings=`'liga' 1`,d.style.fontVariantLigatures=`normal`,d.style.color=i,document.body.appendChild(d);let f=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(d);let h=document.createElement(`canvas`);h.width=p*c,h.height=m*c;let g=h.getContext(`2d`);g.scale(c,c),g.font=`${n?`${n} `:``}${r}px ${u}`,g.textAlign=`left`,g.textBaseline=`top`,g.fillStyle=i;try{g.fontKerning=`normal`}catch{}return g.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:m}}async function wa(e,t,n=/* @__PURE__ */ new Map){if(e?.nodeType!==1)return 0;let r=`.material-icons, [class*="material-symbols"]`,i=Array.from(e.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim());if(e.matches?.(r)&&e.textContent&&e.textContent.trim()&&i.unshift(e),i.length===0)return 0;let a=t?.nodeType===1?Array.from(t.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim()):[];t?.nodeType===1&&t.matches?.(r)&&t.textContent&&t.textContent.trim()&&a.unshift(t);let o=0;for(let e=0;e<i.length;e++){let t=i[e],r=n&&n.get(t)||a[e]||null;try{let e=getComputedStyle(r||t),n=e.fontFamily||`Material Icons`;if(!_a(n))continue;let i=(r||t).textContent.trim();if(!i)continue;let a=parseInt(e.fontSize,10)||24,{dataUrl:s,width:c,height:l}=await Ca(i,{family:n,weight:e.fontWeight&&e.fontWeight!==`normal`?e.fontWeight:`normal`,fontSize:a,color:Sa(e),variation:e.fontVariationSettings&&e.fontVariationSettings!==`normal`?e.fontVariationSettings:``,className:(r||t).className||``});t.textContent=``;let u=t.ownerDocument.createElement(`img`);u.src=s,u.alt=i,u.style.height=`${a}px`,u.style.width=`${Math.max(1,Math.round(c/l*a))}px`,u.style.objectFit=`contain`,u.style.verticalAlign=getComputedStyle(t).verticalAlign||`baseline`,t.appendChild(u),o++}catch{}}return o}F(),H(),z();async function Ta(e,t,n,r=32,i=`#000`,a=`normal`){t=t.replace(/^['"]+|['"]+$/g,``);let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let s=document.createElement(`span`);R(s),s.textContent=e,s.style.position=`absolute`,s.style.visibility=`hidden`,s.style.fontFamily=`"${t}"`,s.style.fontWeight=n||`normal`,s.style.fontStyle=a||`normal`,s.style.fontSize=`${r}px`,s.style.lineHeight=`1`,s.style.whiteSpace=`nowrap`,s.style.padding=`0`,s.style.margin=`0`,document.body.appendChild(s);let c=s.getBoundingClientRect(),l=Math.ceil(c.width),u=Math.ceil(c.height);document.body.removeChild(s);let d=document.createElement(`canvas`);d.width=Math.max(1,l*o),d.height=Math.max(1,u*o);let f=d.getContext(`2d`);return f.scale(o,o),f.font=`${a||`normal`} ${n||`normal`} ${r}px "${t}"`,f.textAlign=`left`,f.textBaseline=`top`,f.fillStyle=i,f.fillText(e,0,0),{dataUrl:d.toDataURL(),width:l,height:u}}var Ea=/* @__PURE__ */ new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`emoji`,`math`,`fangsong`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`]),Da=[`katex`,`mathjax`,`mathml`];function Oa(e){if(!e)return``;for(let t of e.split(`,`)){let e=t.trim().replace(/^['"]+|['"]+$/g,``);if(e&&!Ea.has(e.toLowerCase()))return e}return``}function ka(e){if(!e)return[];let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^['"]+|['"]+$/g,``);e&&(Ea.has(e.toLowerCase())||t.push(e))}return t}function Aa(e){let t=String(e??`400`).trim().toLowerCase();if(t===`normal`)return 400;if(t===`bold`)return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ja(e){let t=String(e??`normal`).trim().toLowerCase();return t.startsWith(`italic`)?`italic`:t.startsWith(`oblique`)?`oblique`:`normal`}function Ma(e){let t=String(e??`100%`).match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Na(e){let t=String(e||`400`).trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=Aa(n[1]),t=Aa(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=Aa(t);return{min:r,max:r}}function Pa(e){let t=String(e||`normal`).trim().toLowerCase();return t===`italic`?{kind:`italic`}:t.startsWith(`oblique`)?{kind:`oblique`}:{kind:`normal`}}function Fa(e){let t=String(e||`100%`).trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Ia(e){return!e||typeof e!=`string`?``:e.replace(/\s+(variable|vf|v[0-9]+)$/i,``).trim().toLowerCase().replace(/\s+/g,`-`)}function La(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=r.host.toLowerCase();if([`fonts.googleapis.com`,`fonts.gstatic.com`,`use.typekit.net`,`p.typekit.net`,`kit.fontawesome.com`,`use.fontawesome.com`,`cdn.jsdelivr.net`,`unpkg.com`,`cdnjs.cloudflare.com`,`esm.sh`].some(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith(`.`+e.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||Da.some(e=>a.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,`+`),n=e.toLowerCase().replace(/\s+/g,`-`),r=Ia(e);if(a.includes(t)||a.includes(n)||r&&a.includes(r))return!0}return!1}catch{return!1}}function Ra(e){let t=/* @__PURE__ */ new Set;for(let n of e||[]){let e=String(n).split(`__`)[0]?.trim();e&&t.add(e)}return t}function za(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||``).trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Ba=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Va=4;async function Ha(e,t,n){if(!e)return e;let r=/* @__PURE__ */ new Set;function i(e,t){try{return new URL(e,t||location.href).href}catch{return e}}async function a(e,t,o=0){if(o>Va)return console.warn(`[snapDOM] @import depth exceeded (${Va}) at ${t}`),e;let s=``,c=0,l,u=new RegExp(Ba.source,`g`);for(;l=u.exec(e);){s+=e.slice(c,l.index),c=u.lastIndex;let d=i((l[2]||l[4]||``).trim(),t);if(r.has(d)){console.warn(`[snapDOM] Skipping circular @import: ${d}`);continue}r.add(d);let f=``;try{let e=await N(d,{as:`text`,useProxy:n,silent:!0});e.ok&&typeof e.data==`string`&&(f=e.data)}catch{}f?(f=za(f,d),f=await a(f,d,o+1),s+=`
|
|
7
|
-
/* inlined: ${d} */
|
|
8
|
-
${f}
|
|
9
|
-
`):s+=l[0]}return s+=e.slice(c),s}let o=za(e,t||location.href);return o=await a(o,t||location.href,0),o}var Ua=/url\((["']?)([^"')]+)\1\)/g,Wa=/@font-face[^{}]*\{[^}]*\}/g;function X(e,t,n=``){return(e.match(RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,`i`))?.[1]||n).trim()}function Ga(e){if(!e)return[];let t=[],n=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],a=e=>e.includes(`?`)?[parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]:parseInt(e,16);if(i){let e=a(r),n=a(i),o=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(o,s),Math.max(o,s)])}else{let e=a(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function Ka(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function qa(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Ua)){let e=(r[2]||``).trim();if(e&&!e.startsWith(`data:`)){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function Ja(e,t,n=``){let r=e;for(let i of e.matchAll(Ua)){let e=l(i[0]);if(!e)continue;let a=e;if(!a.startsWith(`http`)&&!a.startsWith(`data:`))try{a=new URL(a,t||location.href).href}catch{}if(s.resource?.has(a)){r=r.replace(i[0],`url(${s.resource.get(a)})`);continue}try{let e=await N(a,{as:`dataURL`,useProxy:n,silent:!0});if(e.ok&&typeof e.data==`string`){let t=e.data;s.resource?.set(a,t),r=r.replace(i[0],`url(${t})`)}}catch{console.warn(`[snapDOM] Failed to fetch font resource:`,a)}}return r}function Ya(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),a=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?`vietnamese`:a?`cyrillic`:i?`greek`:r?`latin-ext`:n?`latin`:null}function Xa(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=Ya(i);if(e&&r.has(e))return!0}return!1}}function Za(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=/* @__PURE__ */ new Set,r=[];for(let i of e.match(t)||[]){let e=Oa(X(i,`font-family`)),t=X(i,`font-weight`,`400`),a=X(i,`font-style`,`normal`),o=X(i,`font-stretch`,`100%`),s=X(i,`unicode-range`),c=X(i,`src`),l=qa(c,location.href),u=l.length?l.map(e=>String(e).toLowerCase()).sort().join(`|`):c.toLowerCase(),d=[String(e||``).toLowerCase(),t,a,o,s.toLowerCase(),u].join(`|`);n.has(d)||(n.add(d),r.push(i))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||``)}var Qa=/* @__PURE__ */ new WeakMap,$a=0;function eo(e){let t=Qa.get(e);return t===void 0&&(t=$a++,Qa.set(e,t)),t}function to(e,t,n,r,i,a,o,s,c){let l=Array.from(e||[]).sort().join(`|`),u=0,d=0;for(let e of o||[]){let t=Math.imul(e,2654435761);t^=t>>>15,t=Math.imul(t,2246822507),t^=t>>>13,u=u+t|0,d++}let f=t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):``,p=(n||[]).map(e=>`${(e.family||``).toLowerCase()}::${e.weight||`normal`}::${e.style||`normal`}::${e.stretchPct??100}::${e.src||``}`).sort().join(`|`),m=r||``,h=(i||[]).map(e=>String(e).toLowerCase()).sort().join(`|`),g=eo(a||document),_=(s||[]).map(e=>String(e)).sort().join(`|`);return`fonts-embed-css::req=${l}::ex=${f}::lf=${p}::px=${m}::fd=${h}::doc=${g}::cp=${u}::n=${d}::ic=${_}::env=${c}`}async function no(e,t,n,r){let i=r.doc?.defaultView||window;if(e.disabled||e.media?.mediaText&&!i.matchMedia(e.media.mediaText).matches)return;let a;try{a=e.cssRules||[]}catch{return}let o=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of a){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?o(e.href,t):t;if(r.depth>=Va){console.warn(`[snapDOM] CSSOM import depth exceeded (${Va}) at ${i}`);continue}if(i&&r.visitedSheets.has(i)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${i}`);continue}i&&r.visitedSheets.add(i);let a={...r,depth:(r.depth||0)+1};await no(e.styleSheet,i,n,a);continue}if(e.cssRules?.length){if(e.type===CSSRule.MEDIA_RULE&&!i.matchMedia(e.conditionText).matches||e.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(e.conditionText))continue;await no(e,t,n,r);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=Oa((e.style.getPropertyValue(`font-family`)||``).trim());if(!i||ha(i,r.iconMatchers))continue;let a=(e.style.getPropertyValue(`font-weight`)||``).trim(),o=(e.style.getPropertyValue(`font-style`)||``).trim(),s=(e.style.getPropertyValue(`font-stretch`)||``).trim(),c=(e.style.getPropertyValue(`font-variation-settings`)||``).trim(),l=(e.style.getPropertyValue(`src`)||``).trim(),u=(e.style.getPropertyValue(`unicode-range`)||``).trim(),d=a||`400`,f=o||`normal`,p=s||`100%`,m=(o?`font-style:${o};`:``)+(a?`font-weight:${a};`:``)+(s?`font-stretch:${s};`:``)+(c?`font-variation-settings:${c};`:``)+(u?`unicode-range:${u};`:``),h=r.faceMatchesRequired(i,f,d,p);if(!h&&!r.requiredIndex.has(i.toLowerCase()))continue;let g=Ga(u);if(!Ka(r.usedCodepoints,g))continue;let _={family:i,weightSpec:d,styleSpec:f,stretchSpec:p,unicodeRange:u,srcRaw:l,srcUrls:qa(l,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(_,g))continue;if(!h){r.provisionalFaces.push({family:i.toLowerCase(),block:`@font-face{font-family:${i};src:${l};${m}}`,srcRaw:l,baseHref:t||location.href});continue}r.coveredFamilies.add(i.toLowerCase());let v=`"${String(i).replace(/^\s*["']|["']\s*$/g,``).replace(/(["\\])/g,`\\$1`)}"`;/url\(/i.test(l)?await n(`@font-face{font-family:${v};src:${await Ja(l,t||location.href,r.useProxy)};${m}}`):await n(`@font-face{font-family:${v};src:${l};${m}}`)}}}async function ro({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i=``,fontStylesheetDomains:a=[],iconMatchers:o=[],doc:c=document}={}){e instanceof Set||(e=/* @__PURE__ */ new Set),t instanceof Set||(t=/* @__PURE__ */ new Set);let l=/* @__PURE__ */ new Map;for(let t of e){let[e,n,r,i]=String(t).split(`__`);if(!e)continue;let a=e.toLowerCase(),o=l.get(a)||[];o.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),l.set(a,o)}function u(e,t,n,r){let i=String(e).toLowerCase();if(!l.has(i))return!1;let a=l.get(i),o=Na(n),s=Pa(t),c=Fa(r),u=o.min!==o.max,d=o.min,f=e=>s.kind===`normal`&&e===`normal`||s.kind!==`normal`&&(e===`italic`||e===`oblique`),p=!1;for(let e of a){let t=u?e.w>=o.min&&e.w<=o.max:e.w===d,n=f(ja(e.s)),r=e.st>=c.min&&e.st<=c.max;if(t&&n&&r){p=!0;break}}if(p)return!0;if(!u)for(let e of a){let t=f(ja(e.s)),n=e.st>=c.min&&e.st<=c.max;if(Math.abs(d-e.w)<=300&&t&&n)return!0}if(!u&&s.kind===`normal`&&a.some(e=>ja(e.s)!==`normal`))for(let e of a){let t=Math.abs(d-e.w)<=300,n=e.st>=c.min&&e.st<=c.max;if(t&&n)return!0}return!1}let d=Xa(n);En(c),$n();let f=to(e,n,r,i,a,c,t,o,En(c));if(s.resource?.has(f))return s.resource.get(f);let p=Ra(e),m=[],h=Ba;for(let e of c.querySelectorAll(`style`)){let t=e.textContent||``;for(let e of t.matchAll(h)){let t=(e[2]||e[4]||``).trim();t&&!ga(t,o)&&(c.querySelector(`link[rel="stylesheet"][href="${t}"]`)||m.push(t))}}let g=[];m.length&&await Promise.all(m.map(e=>new Promise(t=>{if(c.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=c.createElement(`link`);n.rel=`stylesheet`,n.href=e,R(n),n.setAttribute(`data-snapdom`,`injected-import`);let r=setTimeout(()=>t(null),3e3),i=e=>{clearTimeout(r),t(e)};n.onload=()=>i(n),n.onerror=()=>i(null),c.head.appendChild(n),g.push(n)})));let _=``,v=/* @__PURE__ */ new Set,y=[],b=Array.from(c.querySelectorAll(`link[rel="stylesheet"]`)).filter(e=>!!e.href);for(let e of g)try{e.remove()}catch{}for(let e of b)try{if(ga(e.href,o))continue;let r=``,s=!1;try{s=new URL(e.href,location.href).origin===location.origin}catch{}if(!s){let t=Array.isArray(a)?a:[];if(!La(e.href,p,t))continue}if(s){let t=Array.from(c.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join(``)}catch{}}if(!r){let t=await N(e.href,{as:`text`,useProxy:i});t?.ok&&typeof t.data==`string`&&(r=t.data)}r=await Ha(r,e.href,i);let f=``;for(let a of r.match(Wa)||[]){let r=Oa(X(a,`font-family`));if(!r||ha(r,o))continue;let s=X(a,`font-weight`,`400`),c=X(a,`font-style`,`normal`),p=X(a,`font-stretch`,`100%`),m=X(a,`unicode-range`),h=X(a,`src`),g=qa(h,e.href),_=u(r,c,s,p);if(!_&&!l.has(r.toLowerCase()))continue;let b=Ga(m);if(!Ka(t,b))continue;let x={family:r,weightSpec:s,styleSpec:c,stretchSpec:p,unicodeRange:m,srcRaw:h,srcUrls:g,href:e.href};if(n&&d(x,b))continue;if(!_){y.push({family:r.toLowerCase(),block:a,srcRaw:h,baseHref:e.href});continue}v.add(r.toLowerCase());let S=/url\(/i.test(h)?await Ja(a,e.href,i):a;f+=S}f.trim()&&(_+=f)}catch{console.warn(`[snapDOM] Failed to process stylesheet:`,e.href)}let x={doc:c,requiredIndex:l,usedCodepoints:t,faceMatchesRequired:u,coveredFamilies:v,provisionalFaces:y,simpleExcluder:n?Xa(n):null,useProxy:i,iconMatchers:o,visitedSheets:/* @__PURE__ */ new Set,depth:0},S=/* @__PURE__ */ new Set([...c.styleSheets,...c.adoptedStyleSheets||[]]);for(let e of S)if(!(e.href&&b.some(t=>t.href===e.href)))try{let t=e.href||c.baseURI||location.origin+`/`;t&&x.visitedSheets.add(t),await no(e,t,async e=>{_+=e},x)}catch{}for(let e of y)v.has(e.family)||(_+=/url\(/i.test(e.srcRaw)?await Ja(e.block,e.baseHref,i):e.block);try{for(let e of c.fonts||[]){if(!e||!e.family||e.status!==`loaded`||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,``);if(ha(t,o)||!l.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith(`data:`)){if(s.resource?.has(e._snapdomSrc))r=s.resource.get(e._snapdomSrc);else try{let t=await N(e._snapdomSrc,{as:`dataURL`,useProxy:i,silent:!0});if(t.ok&&typeof t.data==`string`)r=t.data,s.resource?.set(e._snapdomSrc,r);else continue}catch{console.warn(`[snapDOM] Failed to fetch dynamic font src:`,e._snapdomSrc);continue}}_+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||`normal`};font-weight:${e.weight||`normal`};}`}}catch{}for(let e of r){if(!e||typeof e!=`object`)continue;let t=String(e.family||``).replace(/^['"]+|['"]+$/g,``);if(!t||ha(t,o)||!l.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e.weight==null?`normal`:String(e.weight),a=e.style==null?`normal`:String(e.style),c=e.stretchPct==null?`100%`:`${e.stretchPct}%`,u=String(e.src||``),d=u;if(!d.startsWith(`data:`)){if(s.resource?.has(u))d=s.resource.get(u);else try{let e=await N(u,{as:`dataURL`,useProxy:i,silent:!0});if(e.ok&&typeof e.data==`string`)d=e.data,s.resource?.set(u,d);else continue}catch{console.warn(`[snapDOM] Failed to fetch localFonts src:`,u);continue}}_+=`@font-face{font-family:'${t}';src:url(${d});font-style:${a};font-weight:${r};font-stretch:${c};}`}return _&&(_=Za(_),s.resource?.set(f,_)),_}function io(e,t){let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set;if(!e)return{required:n,usedCodepoints:r};let i=e=>{if(e)for(let t of e)r.add(t.codePointAt(0))},a=e=>{let t=ka(e.fontFamily);if(t.length)for(let r of t)n.add(`${r}__${Aa(e.fontWeight)}__${ja(e.fontStyle)}__${Ma(e.fontStretch)}`)},o=pr(e),s=e.getRootNode(),c=e=>{a(B(e));let t=e.getRootNode()===s?o:pr(e);for(let n of[`::before`,`::after`]){let o=n===`::before`?t.before:t.after;if(o!==null){if(o===``)continue;try{if(!e.matches(o))continue}catch{}}let s=B(e,n),c=s&&s.content;if(c&&c!==`none`&&c!==`normal`){if(a(s),/^["']/.test(c))i(c.slice(1,-1));else{let e=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let t of e)try{r.add(parseInt(t.slice(1),16))}catch{}}}}},l=[e];for(let n=0;n<l.length;n++){let r=l[n];r.nodeType===Node.ELEMENT_NODE&&c(r),r.shadowRoot&&l.push(r.shadowRoot);let a=(e.ownerDocument||document).createTreeWalker(r,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;a.nextNode();){let e=a.currentNode;if(e.nodeType===Node.TEXT_NODE){if(t&&e.parentElement&&!t(e.parentElement))continue;i(e.nodeValue||``)}else{if(t&&!t(e))continue;c(e),e.shadowRoot&&l.push(e.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function ao(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let e=n.createElement(`div`);R(e),e.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;`;for(let t of r){let r=n.createElement(`span`);r.textContent=`AaBbGg1234ÁÉÍÓÚçñ—∞`,r.style.fontFamily=`"${t}"`,r.style.fontWeight=`700`,r.style.fontStyle=`italic`,r.style.fontSize=`32px`,r.style.lineHeight=`1`,r.style.whiteSpace=`nowrap`,r.style.margin=`0`,r.style.padding=`0`,e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await nt(),await nt()}E();function oo(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||``)}function so(e,t=!1){let n=``,r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function co(e,t=!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,e)),i=``;for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function lo(e,t){switch((t||`decimal`).toLowerCase()){case`decimal`:return String(e);case`decimal-leading-zero`:{let t=Math.abs(e);return(e<0?`-`:``)+(t<10?`0`:``)+String(t)}case`lower-alpha`:case`lower-latin`:return so(e,!1);case`upper-alpha`:case`upper-latin`:return so(e,!0);case`lower-roman`:return co(e,!1);case`upper-roman`:return co(e,!0);default:return String(e)}}function uo(e,t){let n=(e||``).trim().split(/[\s,]+/).filter(Boolean),r=[];for(let e=0;e<n.length;e++){let i=n[e];if(i===`none`)continue;let a=n[e+1],o=a!==void 0&&Number.isFinite(Number(a));r.push([i,o?Number(a):t]),o&&e++}return r}function fo(e){let t=/* @__PURE__ */ new WeakMap,n=x(e)?e.documentElement:e,r=e=>e&&e.tagName===`LI`,i=/* @__PURE__ */ new WeakMap,a=e=>{let t=/* @__PURE__ */ new Map;for(let[n,r]of e)t.set(n,r.slice());return t},o=(e,t,n)=>{let o=a(e),s;try{s=getComputedStyle(n)}catch{s=n.style}let c;try{c=s?.counterReset}catch{}if(c&&c!==`none`)for(let[e,n]of uo(c,0)){let r=t.get(e);if(r&&r.length){let t=r.slice();t.push(n),o.set(e,t)}else o.set(e,[n])}let l;try{l=s?.counterSet}catch{}if(l&&l!==`none`)for(let[e,t]of uo(l,0)){let n=o.get(e)||[];n.length===0&&n.push(0),n[n.length-1]=t,o.set(e,n)}let u;try{u=s?.counterIncrement}catch{}if(u&&u!==`none`)for(let[e,t]of uo(u,1)){let n=o.get(e)||[];n.length===0&&n.push(0),n[n.length-1]+=t,o.set(e,n)}try{if(s?.display===`list-item`&&r(n)){let e=n.parentElement,t=e&&i.get(e),r=e?.tagName===`OL`?parseInt(e.getAttribute(`start`),10):NaN,a=t===void 0?Number.isFinite(r)?r:1:t+1,s=e?.tagName===`OL`?parseInt(n.getAttribute(`value`),10):NaN;Number.isFinite(s)&&(a=s),e&&i.set(e,a);let c=o.get(`list-item`)||[];c.length===0&&c.push(0),c[c.length-1]=a,o.set(`list-item`,c)}}catch{}return o},s=(e,n,r)=>{let i=o(r,n,e);t.set(e,i);let a=i;for(let t of e.children)a=s(t,i,a);let c=/* @__PURE__ */ new Map;for(let[e,t]of r){let n=t.length,r=a.get(e);c.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,t]of a)!c.has(e)&&t.length&&!n.has(e)&&c.set(e,t.slice(0,1));return c},c=/* @__PURE__ */ new Map;return s(n,c,c),{get(e,n){let r=t.get(e)?.get(n);return r&&r.length?r[r.length-1]:0},getStack(e,n){let r=t.get(e)?.get(n);return r?r.slice():[]}}}function po(e,t,n){if(!e||e===`none`)return e;try{return e.replace(/\b(counter|counters)\s*\(([^)]+)\)/g,(e,r,i)=>{let a=String(i).split(`,`).map(e=>e.trim());if(r===`counter`){let e=a[0]?.replace(/^["']|["']$/g,``),r=(a[1]||`decimal`).toLowerCase();return lo(n.get(t,e),r)}{let e=a[0]?.replace(/^["']|["']$/g,``),r=a[1]?.replace(/^["']|["']$/g,``)??``,i=(a[2]||`decimal`).toLowerCase(),o=n.getStack(t,e);return o.length?o.map(e=>lo(e,i)).join(r):``}})}catch{return`- `}}F();var mo=/* @__PURE__ */ new WeakMap,ho=1e3;function go(e,t){let n=vo(e);return t?(t.__pseudoPreflightFp!==n&&($n(),t.__pseudoPreflight=bo(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):($n(),bo(e,n))}function _o(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function vo(e){let t=e.querySelectorAll(`style,link[rel~="stylesheet"]`),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i.tagName===`STYLE`){let e=i.textContent?i.textContent.length:0;n+=`S${e}|`;let t=i.sheet,a=t?_o(t):null;a&&(r+=a.length)}else{let e=i.getAttribute(`href`)||``,t=i.getAttribute(`media`)||`all`;n+=`L${e}|m:${t}|`;let a=i.sheet,o=a?_o(a):null;o&&(r+=o.length)}}let i=e.adoptedStyleSheets,a=0;if(Array.isArray(i))for(let e of i){let t=_o(e);t&&(a+=t.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${a}|tr:${r}`,n}function yo(e,t,n){let r=_o(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],a=i&&i.cssText?i.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0;if(i&&i.styleSheet&&yo(i.styleSheet,t,n))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],a=r&&r.cssText?r.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0}if(n.budget<=0)return!1}return!1}function bo(e=document,t=vo(e)){let n=mo.get(e);if(n&&n.fingerprint===t)return n.result;let r=e=>(e.match(/\|ass:[^|]*/)||[``])[0];n&&r(t)!==r(n.fingerprint)&&kn();let i=[`::before`,`::after`,`::first-letter`,`::marker`,`::first-line`,`:before`,`:after`,`:first-letter`,`:first-line`,`counter(`,`counters(`,`counter-increment`,`counter-reset`],a=e.querySelectorAll(`style`);for(let n=0;n<a.length;n++){let r=a[n].textContent||``;for(let n of i)if(r.includes(n))return mo.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let n={budget:ho};try{for(let r of o)if(yo(r,i,n))return mo.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll(`style,link[rel~="stylesheet"]`),r={budget:ho};for(let a=0;a<n.length&&r.budget>0;a++){let o=n[a],s=null;if(o.tagName,s=o.sheet||null,s&&yo(s,i,r))return mo.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector(`[style*="counter("], [style*="counters("]`)?(mo.set(e,{fingerprint:t,result:!0}),!0):(mo.set(e,{fingerprint:t,result:!1}),!1)}function xo(e){for(let t of[`Top`,`Right`,`Bottom`,`Left`]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&r!==`none`&&r!==`hidden`)return!0}return!1}function So(e,t){let n=null,r=()=>{if(!n)try{n=fo(e)}catch(e){U(t,`buildCounterContext failed`,e),n={get:()=>0,getStack:()=>[]}}return n};return{get(e,t){return r().get(e,t)},getStack(e,t){return r().getStack(e,t)}}}function Co(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`)t=!t;else if(r===`/`&&!t)return e.slice(0,n).trim()}return e}function wo(e){return e.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return e===0||e>1114111?`�`:String.fromCodePoint(e)}return n===`
|
|
10
|
-
`?``:n})}function To(e){if(!e)return``;let t=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(e);){let a=e.slice(r,i.index).trim();a&&t.push(a),t.push(wo(i[1]===void 0?i[2]:i[1])),r=n.lastIndex}let a=e.slice(r).trim();return a&&t.push(a),t.join(``)}function Eo(e,t,n){let r=e.parentElement,i=r&&n?n.get(r):null;return i?{get(e,n){let r=t.get(e,n),a=i.get(n);return typeof a==`number`?Math.max(r,a):r},getStack(e,n){let r=t.getStack(e,n);if(!r.length)return r;let a=i.get(n);if(typeof a==`number`){let e=r.slice();return e[e.length-1]=Math.max(e[e.length-1],a),e}return r}}:t}function Do(e,t,n){let r=/* @__PURE__ */ new Map,i=(e,t)=>uo(e,t).map(([e,t])=>({name:e,num:t})),a=i(t?.counterReset,0),o=i(t?.counterSet,0),s=i(t?.counterIncrement,1);function c(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;i=i.length?[...i,e]:[e]}let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i.length===0&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;i.length===0&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=c(t);return n.length?n[n.length-1]:0},getStack(e,t){return c(t)},__incs:s}}var Oo=[`color`,`-webkit-text-fill-color`,`font-family`,`font-size`,`font-weight`,`font-style`,`letter-spacing`,`line-height`],ko=[`color`,`-webkit-text-fill-color`,`font-family`,`font-size`,`font-weight`,`font-style`,`font-variant`,`letter-spacing`,`word-spacing`,`text-transform`,`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`line-height`,`background-color`,`vertical-align`];function Ao(e,t,n,r,i,a){try{if(r===null){if(e.getRootNode()!==(e.ownerDocument||document))return;let t=B(e).display||``;if(i===`::marker`?!t.includes(`list-item`):t!==`block`&&t!==`flow-root`&&t!==`list-item`&&t!==`inline-block`&&t!==`table-cell`&&t!==`table-caption`)return}else if(!e.matches(r))return;if(i===`::marker`&&!(B(e).display||``).includes(`list-item`))return;let o=B(e,i),s=B(e);if(!o)return;let c=``;for(let e of a){let t=o.getPropertyValue(e);t&&t!==s.getPropertyValue(e)&&(e!==`background-color`||t!==`rgba(0, 0, 0, 0)`)&&(e!==`vertical-align`||t!==`baseline`)&&(c+=`${e}:${t};`)}if(i===`::marker`){let e=o.getPropertyValue(`content`);e&&e!==`normal`&&e!==`none`&&(c+=`content:${e};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;t.setAttribute(l,``),n.__pseudoCSS=(n.__pseudoCSS||``)+`[${l}]${i}{${c}}`}catch{}}function jo(e,t){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(e))return e;let n=`“`,r=`”`;try{let e=B(t).quotes;if(e===`none`)n=``,r=``;else if(e&&e!==`auto`){let t=e.match(/"[^"]*"|'[^']*'/g);t&&t.length>=2&&(n=t[0].slice(1,-1),r=t[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,``),r=r.replace(/"/g,``),e.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(e,t)=>t?t===`open-quote`?`"${n}"`:t===`close-quote`?`"${r}"`:`""`:e)}function Mo(e,t,n,r){let i;try{i=B(e,t)}catch{}let a=i?.content;if(!a||a===`none`||a===`normal`)return{text:``,incs:[]};a=Co(a),a=jo(a,e);let o=Eo(e,n,r),s=Do(e,i,o);return{text:To(oo(a)?po(a,e,s):a),incs:s.__incs||[]}}function No(e,t){if(t.__shadowPseudo)return!1;let n=pr(e),r=[];for(let e of[`before`,`after`,`firstLetter`,`marker`,`firstLine`]){let t=n[e];if(t===null)return!1;t&&r.push(t)}if(!r.length)return!0;let i=r.join(`,`);try{return!e.matches(i)&&e.querySelector(i)===null}catch{return!1}}async function Po(e,t,n,r,i=!1){if(e?.nodeType!==1||t?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),e.tagName===`TEXTAREA`))return;let a=e.ownerDocument||document;if(!i&&!go(a,n)&&!n.__shadowPseudo||!i&&No(e,n))return;n.__siblingCounters||=/* @__PURE__ */ new WeakMap,n.__counterCtx||=So(e.ownerDocument||document,n);let o=n.__counterCtx,s=pr(e);s.marker!==``&&Ao(e,t,n,s.marker,`::marker`,Oo),s.firstLine!==``&&Ao(e,t,n,s.firstLine,`::first-line`,ko);for(let i of[`::before`,`::after`,`::first-letter`]){let a=s[i===`::before`?`before`:i===`::after`?`after`:`firstLetter`];if(a!==null){if(a===``)continue;try{if(!e.matches(a))continue}catch{}}try{let a=B(e,i);if(!a||a.content===`none`&&a.backgroundImage===`none`&&(a.backgroundColor===`transparent`||a.backgroundColor===`rgba(0, 0, 0, 0)`)&&!xo(a)&&(!a.transform||a.transform===`none`)&&a.display===`inline`)continue;if(a.display===`none`||i!==`::first-letter`&&(a.content===`none`||a.content===`normal`)){i===`::before`&&(t.dataset.snapdomHasBefore=`1`),i===`::after`&&(t.dataset.snapdomHasAfter=`1`);continue}if(i===`::first-letter`){let r=B(e),i=(r?.display||``).toLowerCase();if(i.includes(`flex`)||i.includes(`grid`))continue;let o=e=>a[e]!==r[e]&&(parseFloat(a[e])||0)!==0;if(!(a.color!==r.color||a.fontSize!==r.fontSize||a.fontWeight!==r.fontWeight||a.fontFamily!==r.fontFamily||a.fontStyle!==r.fontStyle||a.textTransform!==r.textTransform||a.float!==r.float&&a.float!==`none`||o(`paddingTop`)||o(`paddingRight`)||o(`paddingBottom`)||o(`paddingLeft`)||o(`marginTop`)||o(`marginRight`)||o(`marginBottom`)||o(`marginLeft`)))continue;let s=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!s)continue;let c=s.textContent,l=/^\s*/.exec(c)[0],u=c.slice(l.length),d=u.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],f=u.slice(d?.length||0);if(!d||/[\uD800-\uDFFF]/.test(d))continue;let p=document.createElement(`span`);p.textContent=d,p.dataset.snapdomPseudo=`::first-letter`;let m=Ne(Re(a,dr(e)),`span`);n.styleMap.set(p,m);let h=document.createTextNode(f);t.replaceChild(h,s),t.insertBefore(p,h),l&&t.insertBefore(document.createTextNode(l),p);continue}let s=a.content??``,c=s===``||s===`none`||s===`normal`,{text:u,incs:f}=Mo(e,i,o,n.__siblingCounters),m=a.backgroundImage,h=a.backgroundColor,g=a.fontFamily,_=parseInt(a.fontSize)||32,v=parseInt(a.fontWeight)||!1,y=a.fontStyle||`normal`,b=a.color||`#000`,x=a.transform,S=ha(g,r?.__iconMatchers),C=!c&&u!==``,w=m&&m!==`none`,T=h&&h!==`transparent`&&h!==`rgba(0, 0, 0, 0)`,E=xo(a),D=x&&x!==`none`,O=s!==`none`&&s!==`normal`,k=/^inline-/.test(a.display||``),A=O&&((parseFloat(a.width)||0)>0||(parseFloat(a.height)||0)>0||k),ee=O&&a.boxShadow&&a.boxShadow!==`none`,j=O&&a.outlineStyle&&a.outlineStyle!==`none`&&(parseFloat(a.outlineWidth)||0)>0;if(!(C||w||T||E||D||A||ee||j)){if(f&&f.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||/* @__PURE__ */ new Map;for(let{name:r}of f){if(!r)continue;let a=Eo(e,o,n.__siblingCounters),s=Do(e,B(e,i),a).get(e,r);t.set(r,s)}n.__siblingCounters.set(e.parentElement,t)}continue}let te=u.startsWith(`url(`)||/^-?(?:webkit-)?image-set\(/i.test(u),ne=!1;if(C&&!S&&u.length>1&&!te){let n=B(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=r*1.5),e.getBoundingClientRect().height<i*1.6&&(t.style.whiteSpace=`nowrap`,ne=!0)}let M=document.createElement(`span`);M.dataset.snapdomPseudo=i,M.style.pointerEvents=`none`,ne&&(M.style.whiteSpace=`nowrap`);let re=Nr(e,i,a,n,r),ie=(B(e).display||``).toLowerCase(),ae=ie.includes(`flex`)||ie.includes(`grid`);if(ae){let e=re[`min-width`];(!e||e===`auto`||e===`0px`)&&(re[`min-width`]=`0px`)}let oe=Ne(re,`span`,C,ae);if(n.styleMap.set(M,oe),S&&u&&u.length===1){let{dataUrl:e,width:n,height:r}=await Ta(u,g,v,_,b,y),i=document.createElement(`img`);i.src=e,i.style=`height:${_}px;width:${n/r*_}px;object-fit:contain;`,M.appendChild(i),t.dataset.snapdomHasIcon=`true`}else if(u&&te){let t=d(u,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??l(u);if(t?.trim())try{let e=await N(p(t),{as:`dataURL`,useProxy:r.useProxy});if(e?.ok&&typeof e.data==`string`){let t=document.createElement(`img`);t.src=e.data,t.style=`width:${_}px;height:auto;object-fit:contain;`,M.appendChild(t)}}catch(t){console.error(`[snapdom] Error in pseudo ${i} for`,e,t)}}else!S&&C&&(M.textContent=u);M.style.backgroundImage=`none`,`maskImage`in M.style&&(M.style.maskImage=`none`),`webkitMaskImage`in M.style&&(M.style.webkitMaskImage=`none`);try{M.style.backgroundRepeat=a.backgroundRepeat,M.style.backgroundSize=a.backgroundSize,a.backgroundPositionX&&a.backgroundPositionY?(M.style.backgroundPositionX=a.backgroundPositionX,M.style.backgroundPositionY=a.backgroundPositionY):M.style.backgroundPosition=a.backgroundPosition,M.style.backgroundOrigin=a.backgroundOrigin,M.style.backgroundClip=a.backgroundClip,M.style.backgroundAttachment=a.backgroundAttachment,M.style.backgroundBlendMode=a.backgroundBlendMode}catch{}if(w)try{let e=ze(m),t=await Promise.all(e.map(e=>se(e,r)));M.style.backgroundImage=t.join(`, `)}catch(e){console.warn(`[snapdom] ${i} background-image inline failed`,e)}T&&(M.style.backgroundColor=h);let P=a.maskImage||a.webkitMaskImage;if(P&&P!==`none`)try{let e=(await Promise.all(ze(P).map(e=>se(e,r)))).join(`, `);M.style.maskImage=e,M.style.webkitMaskImage=e;for(let e of[`maskSize`,`maskRepeat`,`maskPosition`,`maskMode`,`maskComposite`,`maskOrigin`,`maskClip`])a[e]&&(M.style[e]=a[e])}catch(e){console.warn(`[snapdom] ${i} mask-image inline failed`,e)}let F=M.childNodes.length>0||M.textContent?.trim()!==``||w||T||E||D||A||ee||j;if(f&&f.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||/* @__PURE__ */ new Map,r=Eo(e,o,n.__siblingCounters),a=Do(e,B(e,i),r);for(let{name:n}of f){if(!n)continue;let r=a.get(e,n);t.set(n,r)}n.__siblingCounters.set(e.parentElement,t)}if(!F)continue;i===`::before`?(t.dataset.snapdomHasBefore=`1`,t.insertBefore(M,t.firstChild)):(t.dataset.snapdomHasAfter=`1`,t.appendChild(M))}catch(t){console.warn(`[snapdom] Failed to capture ${i} for`,e,t)}}let c=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of c){let t=n.nodeMap.get(e);t?.nodeType===1&&await Po(t,e,n,r,!0)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,c.length);e++)await Po(t[e],c[e],n,r,!0)}}E();function Fo(e,t,n){if(!e||e?.nodeType!==1)return;let r=e.ownerDocument||document,i=t||r,a=y(e)&&e.localName===`svg`?[e]:Array.from(e.querySelectorAll(`svg`)),o=/url\(\s*["']?\s*#([^)"']+)/g,s=[`fill`,`stroke`,`filter`,`clip-path`,`mask`,`marker`,`marker-start`,`marker-mid`,`marker-end`],c=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`),l=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if(t.name===`href`)return t.value;let r=t.name.indexOf(`:`);if(r!==-1&&t.name.slice(r+1)===`href`)return t.value}return null},u=new Set(Array.from(e.querySelectorAll(`[id]`)).map(e=>e.id)),d=/* @__PURE__ */ new Set,f=!1,p=(e,t=null)=>{if(!e)return;o.lastIndex=0;let n;for(;n=o.exec(e);){f=!0;let e=(n[1]||``).trim();e&&(u.has(e)||(d.add(e),t&&!t.has(e)&&t.add(e)))}},m=e=>{let t=e.querySelectorAll(`use`);for(let e of t){let t=l(e);if(!t||!t.startsWith(`#`))continue;f=!0;let n=t.slice(1).trim();n&&!u.has(n)&&d.add(n)}p(e.getAttribute(`style`)||``);for(let t of s)p(e.getAttribute(t));let n=e.querySelectorAll(`*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]`);for(let e of n){p(e.getAttribute(`style`)||``);for(let t of s)p(e.getAttribute(t))}},h=e=>{if(!e||e.nodeType!==1||!e.querySelectorAll)return;let t=!1;try{t=!!(i.querySelector&&i.querySelector(`filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]`))}catch{return}if(!t)return;let n=[`filter`,`clipPath`,`mask`,`maskImage`,`webkitMaskImage`],r=e=>{if(y(e))return;let t;try{t=getComputedStyle(e)}catch{return}for(let e of n){let n=t[e];n&&n.includes(`url(`)&&p(n)}};r(e);for(let t of e.querySelectorAll(`*`))r(t)};for(let e of a)m(e);if(h(n),!f)return;let g=e.querySelector(`svg.inline-defs-container`);g||(g=r.createElementNS(`http://www.w3.org/2000/svg`,`svg`),g.classList.add(`inline-defs-container`),g.setAttribute(`aria-hidden`,`true`),g.setAttribute(`style`,`position:absolute;width:0;height:0;overflow:hidden`),e.insertBefore(g,e.firstChild||null));let _=g.querySelector(`defs`)||null,v=t=>{if(!t||u.has(t))return null;let n=c(t),r=t=>{let n=i.querySelector(t);return n&&!e.contains(n)?n:null};return r(`svg defs > *#${n}`)||r(`svg > symbol#${n}`)||r(`*#${n}`)};if(!d.size)return;let b=new Set(d),x=/* @__PURE__ */ new Set;for(;b.size;){let e=b.values().next().value;if(b.delete(e),!e||u.has(e)||x.has(e))continue;let t=v(e);if(!t){x.add(e);continue}_||(_=r.createElementNS(`http://www.w3.org/2000/svg`,`defs`),g.appendChild(_));let n=t.cloneNode(!0);n.id||n.setAttribute(`id`,e),_.appendChild(n),x.add(e),u.add(e);let i=[n,...n.querySelectorAll(`*`)];for(let e of i){let t=l(e);if(t&&t.startsWith(`#`)){let e=t.slice(1).trim();e&&!u.has(e)&&!x.has(e)&&b.add(e)}let n=e.getAttribute?.(`style`)||``;n&&p(n,b);for(let t of s){let n=e.getAttribute?.(t);n&&p(n,b)}}}}E();var Io=/* @__PURE__ */ new WeakMap,Lo=/* @__PURE__ */ new WeakMap;function Ro(e,t,n){let r=n.get(e),i=e.style;if(!r){let a=i.cssText,o=e.hasAttribute(`style`);r={users:0,saved:t.map(([e,t])=>{let n={property:e,value:i.getPropertyValue(e),priority:i.getPropertyPriority(e)};return i.setProperty(e,t,`important`),n.forcedValue=i.getPropertyValue(e),n}),originalCSS:a,forcedCSS:i.cssText,hadStyle:o},n.set(e,r)}r.users++;let a=!1;return()=>{if(!a&&(a=!0,!--r.users)){if(n.delete(e),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let e of r.saved)i.getPropertyValue(e.property)!==e.forcedValue||i.getPropertyPriority(e.property)!==`important`||(e.value?i.setProperty(e.property,e.value,e.priority):i.removeProperty(e.property));!r.hadStyle&&!i.length&&(e.getAttribute(`style`),e.removeAttribute(`style`))}}}function zo(e){if(Io.has(e))return Ro(e,[],Io);let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=n!==`none`&&parseFloat(r)>0,a=parseFloat(t.borderTopWidth)===0&&parseFloat(t.borderRightWidth)===0&&parseFloat(t.borderBottomWidth)===0&&parseFloat(t.borderLeftWidth)===0;if(i&&a){let t=[];for(let e of[`top`,`right`,`bottom`,`left`])t.push([`border-${e}-width`,r],[`border-${e}-style`,`solid`],[`border-${e}-color`,`transparent`]);return Ro(e,t,Io)}return()=>{}}function Bo(e,t=null){let n=[],r=e=>{if(!v(e))return;if(Lo.has(e)){n.push(Ro(e,[],Lo));return}let t=getComputedStyle(e);(t.contentVisibility||t.getPropertyValue(`content-visibility`)||``)===`auto`&&n.push(Ro(e,[[`content-visibility`,`visible`]],Lo))};try{if(t){let n=e=>{let i;try{i=e.getBoundingClientRect()}catch{return}if(!((i.width>0||i.height>0)&&(i.right<t.left-200||i.left>t.right+200||i.bottom<t.top-200||i.top>t.bottom+200))){r(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)n(t)}};n(e)}else{for(let t of e.querySelectorAll(`*`))r(t);r(e)}}catch{}return()=>{for(let e of n)try{e()}catch{}}}W(),c(),z(),tt(),z();function Vo(e){return Uo(e.boxShadow)}function Ho(e){return Uo(e.textShadow)}function Uo(e){if(!e||e===`none`)return{top:0,right:0,bottom:0,left:0};let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?r++:a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n),n=``):n+=a}n.trim()&&t.push(n);let i=0,a=0,o=0,s=0;for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,c=0,l=0]=t,u=Math.abs(n)+c+l,d=Math.abs(r)+c+l;a=Math.max(a,u+Math.max(n,0)),s=Math.max(s,u+Math.max(-n,0)),o=Math.max(o,d+Math.max(r,0)),i=Math.max(i,d+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(s)}}function Wo(e){let t=e.filter&&e.filter!==`none`?e.filter:e.webkitFilter||``,n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(t);)r+=parseFloat(i[1])||0;let a=Math.ceil(r*2);return{top:a,right:a,bottom:a,left:a}}function Go(e){if((e.outlineStyle||`none`)===`none`)return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||`0`)||0),n=parseFloat(e.outlineOffset||`0`)||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function Ko(e){let t=`${e.filter||``} ${e.webkitFilter||``}`.trim();if(!t||t===`none`)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,a=0,o=0,s=!1;for(let e of n){s=!0;let[t=0,n=0,c=0]=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],l=Math.abs(t)+c,u=Math.abs(n)+c;i=Math.max(i,l+Math.max(t,0)),o=Math.max(o,l+Math.max(-t,0)),a=Math.max(a,u+Math.max(n,0)),r=Math.max(r,u+Math.max(-n,0))}return{bleed:{top:Z(r),right:Z(i),bottom:Z(a),left:Z(o)},has:s}}function qo(e){let t=Vo(e),n=Ho(e),r=Wo(e),i=Go(e),a=Ko(e);return{top:Math.max(t.top,n.top)+r.top+i.top+a.bleed.top,right:Math.max(t.right,n.right)+r.right+i.right+a.bleed.right,bottom:Math.max(t.bottom,n.bottom)+r.bottom+i.bottom+a.bleed.bottom,left:Math.max(t.left,n.left)+r.left+i.left+a.bleed.left}}function Jo(e){return e.boxShadow&&e.boxShadow!==`none`||e.textShadow&&e.textShadow!==`none`||(e.outlineStyle||`none`)!==`none`||e.filter&&e.filter!==`none`?!0:!!e.webkitFilter&&e.webkitFilter!==`none`}function Yo(e){let t=e.overflowX||e.overflow||`visible`,n=e.overflowY||e.overflow||`visible`,r=!!e.contain&&/\b(paint|content|strict)\b/.test(e.contain)||!!e.clipPath&&e.clipPath!==`none`;return{x:r||t!==`visible`,y:r||n!==`visible`}}function Xo(e,t,n,r=1,i=1){let a=0,o=0,s=0,c=0,l=Yo(n.get(e)||B(e));if(l.x&&l.y)return{top:0,right:0,bottom:0,left:0};let u=e.getBoundingClientRect();for(let d of t.values()){if(d===e||d.nodeType!==1||d.ownerDocument!==e.ownerDocument)continue;let t=n.get(d);if(!t||!Jo(t))continue;let f=qo(t);if(!(f.top||f.right||f.bottom||f.left))continue;let p=d.getBoundingClientRect(),m={left:p.left-f.left/r,top:p.top-f.top/i,right:p.right+f.right/r,bottom:p.bottom+f.bottom/i};for(let t=d.parentElement;t;t=t.parentElement){let r=Yo(n.get(t)||B(t));if(r.x||r.y){let e=t.getBoundingClientRect();r.x&&(m.left=Math.max(m.left,e.left),m.right=Math.min(m.right,e.right)),r.y&&(m.top=Math.max(m.top,e.top),m.bottom=Math.min(m.bottom,e.bottom))}if(t===e)break}l.x||(c=Math.max(c,(u.left-m.left)*r),o=Math.max(o,(m.right-u.right)*r)),l.y||(a=Math.max(a,(u.top-m.top)*i),s=Math.max(s,(m.bottom-u.bottom)*i))}return{top:Math.max(0,Math.ceil(a)),right:Math.max(0,Math.ceil(o)),bottom:Math.max(0,Math.ceil(s)),left:Math.max(0,Math.ceil(c))}}function Zo(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin=`0 0`}catch{}try{`translate`in t.style&&(t.style.translate=`none`),`rotate`in t.style&&(t.style.rotate=`none`)}catch{}let r=n.transform||`none`;if(!r||r===`none`){let n=null;try{n=es(e).scale}catch{}try{t.style.transform=`none`}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=rs({scale:n});return{a:r.a,b:r.b,c:r.c,d:r.d}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,a=0,o=0;if(i>0){let s=e/i,c=t/i;a=s*n+c*r;let l=n-s*a,u=r-c*a;o=Math.sqrt(l*l+u*u)||0,o>0?a/=o:a=0}return{a:i,b:0,c:a*o,d:o}}let a=t=>{let n=es(e).scale;if(!n)return t;let r=rs({scale:n,baseTransform:`matrix(${t.a},${t.b},${t.c},${t.d},0,0)`});return{a:r.a,b:r.b,c:r.c,d:r.d}},o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===6&&e.every(Number.isFinite)){let[n,r,o,s]=e,c=i(n,r,o,s);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return a(c)}}let s=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(s){let e=s[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===16&&e.every(Number.isFinite)){let n=e[0],r=e[1],o=e[4],s=e[5],c=i(n,r,o,s);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return a(c)}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return a(n)}catch{return null}}function Qo(e,t,n,r,i){let a=n.a,o=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(e,t){let n=e-r,d=t-i,f=a*n+s*d,p=o*n+c*d;return f+=r+l,p+=i+u,[f,p]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],p=1/0,m=1/0,h=-1/0,g=-1/0;for(let[e,t]of f)e<p&&(p=e),t<m&&(m=t),e>h&&(h=e),t>g&&(g=t);return{minX:p,minY:m,maxX:h,maxY:g,width:h-p,height:g-m}}function $o(e,t,n){let r=(e.transformOrigin||`0 0`).trim().split(/\s+/),[i,a]=[r[0]||`0`,r[1]||`0`],o=(e,t)=>{let n=e.toLowerCase();return n===`left`||n===`top`?0:n===`center`?t/2:n===`right`||n===`bottom`?t:n.endsWith(`px`)?parseFloat(n)||0:n.endsWith(`%`)?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:o(i,t),oy:o(a,n)}}function es(e){let t={rotate:`0deg`,scale:null,translate:null},n=null;try{n=typeof e.computedStyleMap==`function`?e.computedStyleMap():null}catch{}if(n){let r=e=>{try{return typeof n.has==`function`&&!n.has(e)||typeof n.get!=`function`?null:n.get(e)}catch{return null}},i=r(`rotate`);if(i){if(i.angle){let e=i.angle;t.rotate=e.unit===`rad`?e.value*180/Math.PI+`deg`:e.value+e.unit,i.is2D===!1&&i.x&&i.y&&i.z&&(t.rotate=`${i.x.value} ${i.y.value} ${i.z.value} ${t.rotate}`)}else t.rotate=i.unit?i.unit===`rad`?i.value*180/Math.PI+`deg`:i.value+i.unit:String(i)}else{let n=getComputedStyle(e);t.rotate=n.rotate&&n.rotate!==`none`?n.rotate:`0deg`}let a=r(`scale`);if(a){let e=e=>e&&e.value!=null?`${e.value}${e.unit===`percent`?`%`:``}`:null;t.scale=`x`in a&&a.x?.value!=null?[e(a.x),e(a.y)??e(a.x),...a.is2D===!1?[e(a.z)??`1`]:[]].join(` `):Array.isArray(a)?a.map(e).join(` `):String(a)}else{let n=getComputedStyle(e);t.scale=n.scale&&n.scale!==`none`?n.scale:null}let o=r(`translate`);if(o){let e=e=>e&&e.value!=null?`${e.value}${e.unit===`percent`?`%`:e.unit||`px`}`:null;t.translate=`x`in o&&o.x?.value!=null?[e(o.x),e(o.y)??`0px`,...o.is2D===!1?[e(o.z)??`0px`]:[]].join(` `):Array.isArray(o)?o.map(e).join(` `):String(o)}else{let n=getComputedStyle(e);t.translate=n.translate&&n.translate!==`none`?n.translate:null}return(!t.rotate||t.rotate===`none`)&&(t.rotate=`0deg`),(!t.scale||t.scale===`none`)&&(t.scale=null),(!t.translate||t.translate===`none`)&&(t.translate=null),t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!==`none`?r.rotate:`0deg`,t.scale=r.scale&&r.scale!==`none`?r.scale:null,t.translate=r.translate&&r.translate!==`none`?r.translate:null,t}var ts=null;function ns(){if(ts?.isConnected)return ts;let e=document.createElement(`div`);return e.id=`snapdom-measure-slot`,e.setAttribute(`aria-hidden`,`true`),R(e),Object.assign(e.style,{position:`absolute`,left:`-99999px`,top:`0px`,width:`0px`,height:`0px`,overflow:`hidden`,opacity:`0`,pointerEvents:`none`,contain:`size layout style`}),document.documentElement.appendChild(e),ts=e,e}function rs(e){let t=e=>{let t=[],n=0,r=0,i=String(e).trim();for(let e=0;e<i.length;e++)i[e]===`(`?n++:i[e]===`)`?n--:/\s/.test(i[e])&&!n&&(e>r&&t.push(i.slice(r,e)),r=e+1);return r<i.length&&t.push(i.slice(r)),t},n=e=>e&&e!==`none`,r=[];if(n(e.translate)){let n=t(e.translate);for(let t=0;t<2&&t<n.length;t++){let r=t===0?e.width:e.height;/^[+-]?(?:\d*\.)?\d+%$/.test(n[t])&&Number.isFinite(r)&&(n[t]=`${parseFloat(n[t])*r/100}px`)}r.push(n.length>2?`translate3d(${n.join(`,`)})`:`translate(${n.join(`,`)})`)}if(n(e.rotate)&&e.rotate!==`0deg`){let n=t(e.rotate);n.length===4?r.push(`rotate3d(${n.join(`,`)})`):n.length===2&&/^[xyz]$/i.test(n[0])?r.push(`rotate${n[0].toUpperCase()}(${n[1]})`):r.push(`rotate(${n.join(` `)})`)}if(n(e.scale)){let n=t(e.scale).map(e=>/%$/.test(e)?String(parseFloat(e)/100):e);r.push(n.length>2?`scale3d(${n.join(`,`)})`:`scale(${n.join(`,`)})`)}if(n(e.baseTransform)&&r.push(e.baseTransform),!r.length)return new DOMMatrix;let i=r.join(` `);try{if(i.includes(`%`))throw Error(`Transform needs a reference box`);return new DOMMatrix(i)}catch{let t=ns(),n=document.createElement(`div`);if(n.style.cssText=`all:initial!important;display:block!important;transform-origin:0 0!important`,n.style.setProperty(`width`,`${Number.isFinite(e.width)?e.width:0}px`,`important`),n.style.setProperty(`height`,`${Number.isFinite(e.height)?e.height:0}px`,`important`),n.style.setProperty(`transform`,i,`important`),!n.style.transform)throw Error(`Invalid transform composition`);t.appendChild(n);try{return as(n)}finally{n.remove()}}}function is(e){let t=B(e),n=t.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=t.rotate&&t.rotate!==`none`&&t.rotate!==`0deg`,i=t.scale&&t.scale!==`none`&&t.scale!==`1`,a=t.translate&&t.translate!==`none`&&t.translate!==`0px 0px`;return!!(r||i||a)}function as(e){let t=getComputedStyle(e).transform;if(!t||t===`none`)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}var os=/* @__PURE__ */ new WeakSet;function ss(e,t){if(!t)return null;let n=e.ownerDocument||document,r=n.defaultView||window,i,a,o,s;if(t===`viewport`)i=0,a=0,o=n.documentElement?.clientWidth||r.innerWidth,s=n.documentElement?.clientHeight||r.innerHeight;else if(typeof t==`object`)i=(Number(t.x)||0)-(r.scrollX||0),a=(Number(t.y)||0)-(r.scrollY||0),o=Number(t.width),s=Number(t.height);else return null;return o>0&&s>0?{left:i,top:a,width:o,height:s,right:i+o,bottom:a+s}:null}function cs(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return b(t)?t.host:null}function ls(e,t){for(let n=t;n;n=cs(n))if(n===e)return!0;return!1}function us(e,t){for(let n=cs(e);n&&n!==t&&n?.nodeType===1;n=cs(n)){let e=B(n);if(e.position!==`static`||e.transform&&e.transform!==`none`||e.filter&&e.filter!==`none`||e.backdropFilter&&e.backdropFilter!==`none`||e.perspective&&e.perspective!==`none`||/transform|perspective|filter/.test(e.willChange||``)||/layout|paint|strict|content/.test(e.contain||``))return n}return null}function ds(e,t){try{return rs({baseTransform:e,rotate:t?.rotate,scale:t?.scale})}catch{return null}}function fs(e,t,n,r,i){let a=e.getBoundingClientRect();v(t)&&B(e).position===`static`&&(t.style.position=`relative`);let o=[];for(let[t,s]of n){if(!v(t)||s?.nodeType!==1||s===e||!ls(e,s))continue;let n=r.get(s)||B(s),c=n.position;if(c!==`fixed`&&c!==`sticky`&&c!==`-webkit-sticky`||t.style.position===`absolute`)continue;let l=s.getBoundingClientRect();if(!(l.width>0&&l.height>0))continue;os.add(t);let u=n.transform&&n.transform!==`none`?n.transform:``,d=es(s),f=!!(u||d.rotate!==`0deg`||d.scale||d.translate),p=f?ds(u,d):null,m=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,h=l.width,g=l.height;m||(h=s.offsetWidth||l.width,g=s.offsetHeight||l.height);let _=s.getRootNode&&b(s.getRootNode()),y=a,x=e.clientLeft||0,S=e.clientTop||0;if(_){let t=us(s,e);t&&(y=t.getBoundingClientRect(),x=t.clientLeft||0,S=t.clientTop||0)}let C=l.left-y.left-x,w=l.top-y.top-S;if(f){if(t.style.translate=`none`,t.style.rotate=`none`,t.style.scale=`none`,m)t.style.transform=`none`;else{t.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:e,oy:r}=$o(n,h,g),i=Qo(h,g,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},e,r);C-=i.minX,w-=i.minY}}if(c!==`fixed`){let e=t.cloneNode(!1);e.setAttribute(`data-snap-ph`,`1`),e.style.position=`static`,e.style.visibility=`hidden`,e.style.width=`${h}px`,e.style.height=`${g}px`,e.style.boxSizing=`border-box`,t.parentElement?.insertBefore(e,t)}let T=h+2,E=g;i&&(Math.abs(w-i.y)<.5&&(--w,E+=1),Math.abs(C-i.x)<.5&&(--C,T+=1)),t.style.position=`absolute`,t.style.left=`${C}px`,t.style.top=`${w}px`,t.style.right=`auto`,t.style.bottom=`auto`,t.style.margin=`0`,t.style.width=`${T}px`,t.style.height=`${E}px`,t.style.boxSizing=`border-box`,_||o.push(t)}for(let e of o)t.appendChild(e)}function ps(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow=`none`}catch(e){U(n,`stripRootShadows boxShadow`,e)}try{t.style.textShadow=`none`}catch(e){U(n,`stripRootShadows textShadow`,e)}try{t.style.outline=`none`}catch(e){U(n,`stripRootShadows outline`,e)}let i=(r.filter||``).replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,``).trim().replace(/\s+/g,` `);try{t.style.filter=i.length?i:`none`}catch(e){U(n,`stripRootShadows filter`,e)}}function ms(e,t){if(!e||!t||!t.style)return;let n=1;try{n=parseFloat(getComputedStyle(e).zoom)}catch{return}if(t.style.getPropertyValue(`zoom`)||Number.isFinite(n)&&n!==1)try{t.style.setProperty(`zoom`,`1`,`important`)}catch{}}function hs(e){let t=e.display||``;if(t.includes(`flex`)||t.includes(`grid`)||t.startsWith(`table`)||t===`inline-block`||t===`flow-root`||e.position===`absolute`||e.position===`fixed`||e.float&&e.float!==`none`)return!0;let n=e.overflowX||e.overflow||`visible`,r=e.overflowY||e.overflow||`visible`;return!!(n!==`visible`||r!==`visible`||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function gs(e,t){let n=Array.from(e.childNodes),r=t===`top`?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||``))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||``);if(n!==`none`&&n!==`contents`&&t.position!==`absolute`&&t.position!==`fixed`)return t.float&&t.float!==`none`||n.startsWith(`inline`)?null:e}return null}function _s(e,t,n){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!hs(r))for(let i of[`top`,`bottom`]){let a=i===`top`?`Top`:`Bottom`;if((parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)continue;let o=e,s=t;for(;o&&s;){let e=gs(o,i);if(!e)break;let t=n?Array.from(s.children).find(t=>n.get(t)===e)||null:s.children[Array.from(o.children).indexOf(e)]||null,r=getComputedStyle(e),c=parseFloat(r[`margin${a}`])||0;if(t&&t.style&&c>0&&(t.style[`margin${a}`]=`0px`),hs(r)||(parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)break;o=e,s=t}}}var vs=/* @__PURE__ */ new Set([`xml`,`xlink`]);function ys(e,t){if(e.startsWith(`*`)||e.includes(`@`))return!0;if(e.includes(`:`)){let t=e.split(`:`,1)[0];if(!vs.has(t))return!0}return t?e.startsWith(`x-`)||e.startsWith(`v-`)||e.startsWith(`:`)||e.startsWith(`on:`)||e.startsWith(`bind:`)||e.startsWith(`let:`)||e.startsWith(`class:`):!1}var bs=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,xs=e=>e.replace(bs,e=>e.length===2?e:``),Ss=/^data:[^,]{0,120};base64,/;function Cs(e,t={}){if(!e)return;let{stripFrameworkDirectives:n=!0}=t,r=e=>{for(let t of Array.from(e.attributes)){if(ys(t.name,n)){e.removeAttribute(t.name);continue}if(Ss.test(t.value))continue;let r=xs(t.value);if(r!==t.value)try{e.setAttribute(t.name,r)}catch{}}};e.nodeType===Node.ELEMENT_NODE&&r(e);let i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o;for(;o=a.nextNode();)if(o.nodeType===Node.ELEMENT_NODE)r(o);else if(o.nodeType===Node.COMMENT_NODE)i.push(o);else{let e=xs(o.data);e!==o.data&&(o.data=e)}for(let e of i)e.remove()}function ws(e){try{let t=e.getAttribute?.(`style`)||``;return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}var Ts=/* @__PURE__ */ new Set([`img`,`canvas`,`video`,`iframe`,`object`,`embed`]);function Es(e){return y(e)||Ts.has(e?.localName)}function Ds(e,t){if(e?.nodeType!==1||ws(e)||Es(e))return!1;let n=t.position;if(n===`absolute`||n===`fixed`||n===`sticky`)return!1;let r=t.display||``;return!(r.includes(`flex`)||r.includes(`grid`)||r.startsWith(`table`)||t.transform&&t.transform!==`none`)}function Os(e,t,n=/* @__PURE__ */ new Map,r=null){function i(e,t){if(e?.nodeType!==1||t?.nodeType!==1)return;let a=e.childElementCount>t.childElementCount,o=n.get(e)||getComputedStyle(e);if(n.has(e)||n.set(e,o),a&&Ds(e,o)){t.style.height||(t.style.height=`auto`),t.style.width||(t.style.width=`auto`),t.style.removeProperty(`block-size`),t.style.removeProperty(`inline-size`),t.style.minHeight||(t.style.minHeight=`0`),t.style.minWidth||(t.style.minWidth=`0`),t.style.maxHeight||(t.style.maxHeight=`none`),t.style.maxWidth||(t.style.maxWidth=`none`);let e=o.overflowY||o.overflowBlock||`visible`,n=o.overflowX||o.overflowInline||`visible`;(e!==`visible`||n!==`visible`)&&(t.style.overflow=`visible`)}let s=Array.from(t.children);if(r)for(let e of s){let t=r.get(e);t&&t.nodeType===1&&i(t,e)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,s.length);e++)i(t[e],s[e])}}i(e,t)}function ks(e){let t=getComputedStyle(e);return t.display!==`none`&&t.position!==`absolute`&&t.position!==`fixed`}function As(e,t){if(e?.nodeType!==1)return!1;if(e.getAttribute(`data-capture`)===`exclude`)return t?.excludeMode===`remove`;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode===`remove`}catch(e){U(t,`exclude selector match failed`,e)}if(Array.isArray(t?.excludePredicates))for(let n of t.excludePredicates)try{if(n(e))return t.excludeMode===`remove`}catch(e){U(t,`exclude predicate failed`,e)}if(typeof t?.filter==`function`&&t.filterMode===`remove`)try{if(!t.filter(e))return!0}catch(e){U(t,`filter function failed`,e)}return!1}function js(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,a=-1/0,o=!1,s=Array.from(e.children);for(let e of s){if(As(e,t)||!ks(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,c=n.bottom-r.top;c<=s||(s<i&&(i=s),c>a&&(a=c),o=!0)}let c=o?Math.max(0,a-i):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var Z=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Ms=.75;function Ns(e,t,n,r,i,a){let o=e.ownerDocument||document,s=e.getBoundingClientRect(),c=i>0&&s.width>0?s.width/i:1,l=a>0&&s.height>0?s.height/a:1;if(Math.abs(c-l)>.02)return 0;let u=o.createElement(`div`);R(u),u.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+i+`px!important;overflow:visible!important;visibility:hidden!important;`;let d=u.attachShadow({mode:`open`}),f=o.createElement(`style`);f.textContent=n,d.appendChild(f);let p=t.cloneNode(!0);d.appendChild(p),o.body.appendChild(u);let m=0,h=(e,t,n)=>{let r=B(e),i=r.boxSizing===`border-box`,a=(e,t,...n)=>{let r=parseFloat(e);if(!Number.isFinite(r))return t;let a=r+(i?0:n.reduce((e,t)=>e+(parseFloat(t)||0),0));return Math.abs(a-t)<=.51?a:t};return{width:a(r.width,t,r.paddingLeft,r.paddingRight,r.borderLeftWidth,r.borderRightWidth),height:a(r.height,n,r.paddingTop,r.paddingBottom,r.borderTopWidth,r.borderBottomWidth)}};try{let e=p.getBoundingClientRect(),n=p.offsetWidth||i,o=p.offsetHeight||a,s=n>0&&e.width>0?e.width/n:1,u=o>0&&e.height>0?e.height/o:1,d=(e,t,n=!1)=>{let i=e.children,a=t.children,o=Math.min(i.length,a.length);for(let e=0;e<o;e++){let t=i[e],o=a[e],f=r.get(t),p=n||os.has(t);if(f?.nodeType===1&&v(t)&&t.style&&f.isConnected){let e=f.getBoundingClientRect();if(e.width>0&&e.height>0){let n=o.getBoundingClientRect(),r=e.width/c,i=e.height/l,a=n.width,d=n.height,g=f.offsetWidth||r,_=f.offsetHeight||i,v=o.offsetWidth||a,y=o.offsetHeight||d,b=Math.abs(r-g)>Ms||Math.abs(i-_)>Ms||Math.abs(a-v)>Ms||Math.abs(d-y)>Ms;if(p){let e=h(o,v,y);r=a>0?r*s*e.width/a:r,i=d>0?i*u*e.height/d:i,a=e.width,d=e.height}else if(b){let e=h(f,g,_),t=h(o,v,y);r=e.width,i=e.height,a=t.width,d=t.height}let x=a-r,S=d-i;(Math.abs(x)>Ms||Math.abs(S)>Ms)&&(t.style.boxSizing=`border-box`,t.style.width=`${Z(r)}px`,t.style.height=`${Z(i)}px`,m++)}}d(t,o,p)}};d(t,p)}finally{u.remove()}return m}var Ps=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function Fs(e,t=/* @__PURE__ */ new Set){let n=``;if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=Fs(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=Fs(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||``;if(Ps.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}var Is=/* @__PURE__ */ new WeakMap;function Ls(e){let t=``;for(let n of e.styleSheets){let e=-1;try{e=n.cssRules?n.cssRules.length:-1}catch{}t+=(n.href||`inline`)+`:`+e+`|`}return t}function Rs(e){if(!e||!e.styleSheets)return``;let t=Ls(e),n=Is.get(e);if(n&&n.fp===t)return n.css;let r=/* @__PURE__ */ new Set,i=``;for(let t of Array.from(e.styleSheets))try{let e=t.cssRules;e&&(i+=Fs(e,r))}catch{}return Is.set(e,{fp:t,css:i}),i}function zs(e,t){let n=Pe(e.clone).sort(),r=n.join(`,`),i=cr(e.element),a=s.baseStyle.get(r),o;a&&a.universe===i?o=a.css:(o=Fe(n,i),s.baseStyle.set(r,{universe:i,css:o}));let c=Rs(e.element?.ownerDocument||document);return e.fontsCSS=t,e.baseCSS=o,e.scrollbarCSS=c,{baseCSS:o,scrollbarCSS:c,fontsCSS:t}}H();var Bs=/* @__PURE__ */ new Set;async function Vs(e,t={}){$n(),Qn(e.ownerDocument||document);let n=t.__session||{styleMap:/* @__PURE__ */ new Map,styleCache:/* @__PURE__ */ new WeakMap,nodeMap:/* @__PURE__ */ new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:t,slicer:t.__slicer||null},i=null,a=null;if(t.clip&&(a=ss(e,t.clip),a&&(r.clip={rect:a,root:e})),t.captureSelection)try{r.selection=Ri(e)}catch(e){U(r,`prepareSelectionContext failed`,e)}let o,s=``,c=``;if(Bs.size){let t=(e,t)=>{for(let n=t;n;n=n.assignedSlot||n.parentElement||n.getRootNode()?.host)if(n===e)return!0;return!1};for(;;){let n=[...Bs].filter(({root:n})=>t(n,e)||t(e,n)).map(({promise:e})=>e.catch(()=>{}));if(!n.length)break;await Promise.all(n)}}if(!r.clip&&e.isConnected&&e.ownerDocument?.visibilityState!==`hidden`)try{let t=e.getBoundingClientRect(),n=e.ownerDocument?.defaultView||window,r=t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight,i=[];if(r&&(()=>{let t=[];e.shadowRoot&&t.push(e.shadowRoot);for(let n of e.querySelectorAll(`*`))n.shadowRoot&&t.push(n.shadowRoot);for(;t.length;){let e=t.pop(),n=e.host?.localName===`calcite-icon`;for(let r of e.querySelectorAll(`*`)){if(r.shadowRoot&&t.push(r.shadowRoot),!n||r.localName!==`svg`)continue;let e=r.querySelectorAll(`path`);if(!e.length||[...e].some(e=>e.getAttribute(`d`)?.trim()))continue;let a=r.getBoundingClientRect();a.width&&a.height&&i.push(r)}}})(),i.length){let t=(async()=>{let t=e.style,r=e.hasAttribute(`style`),a=/* @__PURE__ */ new Map,o=(e,n)=>{a.has(e)||a.set(e,{value:t.getPropertyValue(e),priority:t.getPropertyPriority(e)}),t.setProperty(e,n,`important`);let r=a.get(e);r.forcedValue=t.getPropertyValue(e),r.forcedPriority=t.getPropertyPriority(e)};try{o(`left`,`0`),o(`top`,`0`),o(`right`,`auto`),o(`bottom`,`auto`),o(`margin-top`,`0`),o(`margin-right`,`0`),o(`margin-bottom`,`0`),o(`margin-left`,`0`),o(`transform`,`none`),o(`translate`,`none`),o(`opacity`,`0`),o(`pointer-events`,`none`);let t=e.getBoundingClientRect();if(t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight){let t=e.parentElement?.getBoundingClientRect(),r=t&&t.right>0&&t.left<n.innerWidth?Math.max(0,t.left):0,i=t&&t.bottom>0&&t.top<n.innerHeight?Math.max(0,t.top):0;o(`position`,`fixed`),o(`left`,`${r}px`),o(`top`,`${i}px`)}await nt(100);let r=Date.now()+1500,a=()=>i.some(e=>{if([...e.querySelectorAll(`path`)].some(e=>e.getAttribute(`d`)?.trim()))return!1;let t=e.getBoundingClientRect();return t.width&&t.height&&t.right>0&&t.bottom>0&&t.left<n.innerWidth&&t.top<n.innerHeight});for(;Date.now()<r&&a();)await new Promise(e=>setTimeout(e,25));await nt(100)}finally{for(let[e,n]of a)t.getPropertyValue(e)!==n.forcedValue||t.getPropertyPriority(e)!==n.forcedPriority||(n.value?t.setProperty(e,n.value,n.priority):t.removeProperty(e));!r&&!t.length&&e.removeAttribute(`style`),await nt(100)}})(),r={root:e,promise:t};Bs.add(r);try{await t}finally{Bs.delete(r)}}}catch{}let l=zo(e),u=Bo(e,a);if(a){let t=e.getBoundingClientRect(),n=e.offsetWidth||t.width,r=e.offsetHeight||t.height,o=t.width&&Math.abs(n-t.width)>=1?n/t.width:1,s=t.height&&Math.abs(r-t.height)>=1?r/t.height:1;i={x:(a.left-t.left)*o,y:(a.top-t.top)*s,width:a.width*o,height:a.height*s}}try{o=await na(e,r,t)}catch(e){throw console.warn(`deepClone failed:`,e),e}finally{u(),l()}r.slicer?.due()&&await r.slicer.pause();try{Fo(o,void 0,e)}catch(e){console.warn(`inlineExternal defs or symbol failed:`,e)}try{await Po(e,o,r,t)}catch(e){console.warn(`inlinePseudoElements failed:`,e)}await Fi(o,r);for(let[e,t]of r.nodeMap.entries())if(t?.tagName===`STYLE`&&e?.tagName===`STYLE`&&!e.hasAttribute(`data-sd`))try{let n=t.sheet&&t.sheet.cssRules;n&&/@media/i.test(e.textContent||``)&&(e.textContent=pi(n))}catch{}try{let e=o.querySelectorAll(`style[data-sd]`);for(let t of e)c+=t.textContent||``,t.remove()}catch(e){U(r,`Shadow CSS extraction failed`,e)}r.slicer?.due()&&await r.slicer.pause();let d=Ie(r.styleMap);s=Array.from(d.entries()).map(([e,t])=>`.${t}{${e}}`).join(``);let p=c+`[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}`+(r.__pseudoCSS||``);s=p+s;for(let[e,t]of r.styleMap.entries())Us(e,t,d);try{Hs(e,o,r.nodeMap)}catch(e){U(r,`top-layer lift failed`,e)}if((r.clip||e.scrollTop||e.scrollLeft)&&o?.nodeType===1)try{let t=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};fs(e,o,r.nodeMap,r.styleCache,t)}catch(e){U(r,`freezeViewportPositioned failed`,e)}for(let[t,n]of r.nodeMap.entries())r.clip&&n===e||Ws(t,n);let m=e.ownerDocument;if((e===m.body||e===m.documentElement)&&m.documentElement.localName===`html`){let t=r.styleCache.get(m.documentElement)||B(m.documentElement);e===m.documentElement&&(o.style.overflow=`visible`);let n=e===m.body?o:o.querySelector(`body`);if(n&&t.overflowX===`visible`&&t.overflowY===`visible`&&t.contain===`none`&&!t.containerType?.includes(`size`)&&t.contentVisibility!==`auto`&&t.contentVisibility!==`hidden`){let e=r.styleCache.get(m.body)||B(m.body);e.contain===`none`&&!e.containerType?.includes(`size`)&&e.contentVisibility!==`auto`&&e.contentVisibility!==`hidden`&&e.display!==`none`&&(n.style.overflow=`visible`)}}if(e===r.nodeMap.get(o)){let t=r.styleCache.get(e)||B(e);r.styleCache.set(e,t);let n=f(t.transform);o.style.margin=`0`,o.style.top=`auto`,o.style.left=`auto`,o.style.right=`auto`,o.style.bottom=`auto`,o.style.animation=`none`,o.style.transition=`none`,o.style.willChange=`auto`,o.style.float=`none`,o.style.clear=`none`,o.style.transform=n||``,o.style.translate=`none`}for(let[e,t]of r.nodeMap.entries())t.tagName===`PRE`&&(e.style.marginTop=`0`,e.style.marginBlockStart=`0`);return{clone:o,classCSS:s,classPrefixCSS:p,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function Hs(e,t,n){let r=[];for(let t of[`:modal`,`:popover-open`])try{r.push(...e.querySelectorAll(t))}catch{}if(!r.length)return;let i=/* @__PURE__ */ new Map;for(let[e,t]of n.entries())i.set(t,e);let a=214748e4;for(let e of r){let n=i.get(e);if(n&&n!==t&&n.parentNode!=null){try{let n=getComputedStyle(e,`::backdrop`),r=n.backgroundColor,i=n.backgroundImage;if(r&&r!==`rgba(0, 0, 0, 0)`&&r!==`transparent`||i&&i!==`none`){let e=document.createElement(`div`);e.setAttribute(`data-sd-backdrop`,``),e.style.cssText=`position:fixed;inset:0;z-index:${a};background-color:${r};`+(i&&i!==`none`&&i.includes(`data:`)?`background-image:${i};`:``),t.appendChild(e)}}catch{}a+=1,n.style.zIndex=String(a),t.appendChild(n),a+=1}}}function Us(e,t,n){if(e.tagName===`STYLE`)return;if(e.getRootNode&&b(e.getRootNode())){e.setAttribute(`style`,t.replace(/;/g,`; `));return}let r=n.get(t);r&&e.classList.add(r);let i=e.style?.backgroundImage,a=e.dataset?.snapdomHasIcon;i&&i!==`none`&&(e.style.backgroundImage=i),a&&(e.style.verticalAlign=`middle`,e.style.display=`inline`)}function Ws(e,t){let n=t.scrollLeft,r=t.scrollTop;if(!(n||r)||e?.nodeType!==1||e.namespaceURI!==`http://www.w3.org/1999/xhtml`)return;e.style.overflow=`hidden`,e.style.scrollbarWidth=`none`,e.style.msOverflowStyle=`none`;try{let t=e.querySelectorAll(`*`);for(let e of t){if(e.nodeType!==1||e.namespaceURI!==`http://www.w3.org/1999/xhtml`)continue;let t=e.style.position;if(t===`fixed`||t===`absolute`){let i=parseFloat(e.style.top)||0,a=parseFloat(e.style.left)||0;e.style.top=`${i+r}px`,e.style.left=`${a+n}px`,t===`fixed`&&(e.style.position=`absolute`)}}}catch{}let i=document.createElement(`div`);for(i.style.all=`unset`,i.style.transform=`translate(${-n}px, ${-r}px)`,i.style.willChange=`transform`,i.style.display=`inline-block`,i.style.width=`100%`;e.firstChild;)i.appendChild(e.firstChild);e.appendChild(i)}F(),ut(),c();var Gs=`http://www.w3.org/1999/xlink`;function Ks(e){return e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(Gs,`href`):null)}function qs(e){let t=parseFloat(e.dataset?.snapdomWidth||``)||0,n=parseFloat(e.dataset?.snapdomHeight||``)||0,r=parseInt(e.getAttribute(`width`)||``,10)||0,i=parseInt(e.getAttribute(`height`)||``,10)||0,a=parseFloat(e.style?.width||``)||0,o=parseFloat(e.style?.height||``)||0;return{width:t||a||r||e.width||e.naturalWidth||100,height:n||o||i||e.height||e.naturalHeight||100}}async function Js(e,t={}){let n=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&n.unshift(e);let r=async e=>{if(!e.getAttribute(`src`)){let t=e.currentSrc||e.src||ii(e.getAttribute(`srcset`),e)||``;t&&e.setAttribute(`src`,t)}if(e.removeAttribute(`srcset`),e.removeAttribute(`sizes`),(e.getAttribute(`src`)||``).startsWith(`data:`)){e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let n=e.src||``;if(!n)return;let r=s.image?.get(n);if(r){e.src=r,e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let i=await N(n,{as:`dataURL`,useProxy:t.useProxy});if(i.ok&&typeof i.data==`string`&&i.data.startsWith(`data:`)){s.image?.set(n,i.data),e.src=i.data,i.blob&&(e.__snapdomBlob=i.blob),e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let{width:a,height:o}=qs(e),{fallbackURL:c}=t||{};if(c)try{let r=typeof c==`function`?await c({width:a,height:o,src:n,element:e}):c;if(r){let n=await N(r,{as:`dataURL`,useProxy:t.useProxy});if(n?.ok&&typeof n.data==`string`){e.src=n.data,e.width||=a,e.height||=o;return}}}catch{}if(t.placeholders!==!1){ct(t.__session,`image-fallback`,`image failed to inline, using placeholder: ${n}`);let r=document.createElement(`div`);r.style.cssText=[`width:${a}px`,`height:${o}px`,`background:#ccc`,`display:inline-block`,`text-align:center`,`line-height:${o}px`,`color:#666`,`font-size:12px`,`overflow:hidden`].join(`;`),r.textContent=`img`,e.replaceWith(r)}else{let t=document.createElement(`div`);t.style.cssText=`display:inline-block;width:${a}px;height:${o}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&i.unshift(e);let a=async e=>{let n=Ks(e);if(!n||n.startsWith(`data:`)||n.startsWith(`blob:`))return;let r=await N(n,{as:`dataURL`,useProxy:t.useProxy});r.ok&&typeof r.data==`string`&&r.data.startsWith(`data:`)&&(e.setAttribute(`href`,r.data),e.removeAttribute(`xlink:href`),typeof e.removeAttributeNS==`function`&&e.removeAttributeNS(Gs,`href`))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(a);await Promise.allSettled(t)}}H(),W();var Ys=[`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`],Xs=[`mask-position`,`mask-size`,`mask-repeat`,`mask-mode`,`mask-composite`,`-webkit-mask-position`,`-webkit-mask-size`,`-webkit-mask-repeat`,`-webkit-mask-composite`,`mask-origin`,`mask-clip`,`-webkit-mask-origin`,`-webkit-mask-clip`,`-webkit-mask-position-x`,`-webkit-mask-position-y`],Zs=[`background-position`,`background-position-x`,`background-position-y`,`background-size`,`background-repeat`,`background-origin`,`background-clip`,`background-attachment`,`background-blend-mode`],Qs=[`border-image-slice`,`border-image-width`,`border-image-outset`,`border-image-repeat`];async function $s(e,t,n,r){let i=n.get(e)||B(e);n.has(e)||n.set(e,i);let a=rr(e),o=a?e=>e in a?a[e]:``:e=>i.getPropertyValue(e),s=o(`border-image`),c=o(`border-image-source`),l=s&&s!==`none`||c&&c!==`none`,u=i.getPropertyValue(`background-image`),d=o(`background-color`),f=u&&u!==`none`||d&&d!==`rgba(0, 0, 0, 0)`&&d!==`transparent`||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue(`background`)||``),p=at()&&(o(`background-clip`)||o(`-webkit-background-clip`)||``).includes(`text`);if(f&&!p)for(let e of Zs){let n=o(e);n&&t.style.setProperty(e,n)}for(let e of Ys){if(p&&e===`background-image`)continue;let n=i.getPropertyValue(e);if(e===`background-image`&&(!n||n===`none`)){let e=i.getPropertyValue(`background`);e&&/url\s*\(/.test(e)&&(n=ze(e).filter(e=>/url\s*\(/.test(e)).join(`, `)||n)}if(!n||n===`none`)continue;let a=ze(n),o=await Promise.all(a.map(e=>se(e,r)));o.some(e=>e&&e!==`none`&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,o.join(`, `))}for(let e of Xs){let n=o(e);!n||n===`initial`||t.style.setProperty(e,n)}if(l)for(let e of Qs){let n=o(e);!n||n===`initial`||t.style.setProperty(e,n)}if(f&&/fixed/.test(o(`background-attachment`)||``))try{await tc(e,t,i)}catch{}}function ec(e,t,n,r,i){let a=(e||`auto`).trim();if(a===`cover`||a===`contain`){if(!t||!n)return{w:r,h:i};let e=a===`cover`?Math.max(r/t,i/n):Math.min(r/t,i/n);return{w:t*e,h:n*e}}let o=a.split(/\s+/),s=(e,t)=>{if(e===`auto`||e===void 0)return null;if(e.endsWith(`px`))return parseFloat(e);if(e.endsWith(`%`))return t*parseFloat(e)/100},c=s(o[0],r),l=s(o[1],i);if(c===void 0||l===void 0)return null;let u=c,d=l;return u==null&&d==null?(u=t||r,d=n||i):u==null?u=t&&n?t/n*d:r:d??=t&&n?n/t*u:i,!u||!d?null:{w:u,h:d}}async function tc(e,t,n){let r=(n.getPropertyValue(`background-attachment`)||``).split(`,`).map(e=>e.trim()),i=it();if(!i)for(let t=e.parentElement;t&&!i;t=t.parentElement){let e=B(t);(e.transform&&e.transform!==`none`||e.filter&&e.filter!==`none`)&&(i=!0)}if(i){t.style.setProperty(`background-attachment`,r.map(()=>`scroll`).join(`, `));return}let a=e.getBoundingClientRect(),o=e.ownerDocument?.defaultView||window,s=o.innerWidth,c=o.innerHeight,l=ze(t.style.backgroundImage||n.getPropertyValue(`background-image`)||``),u=(t.style.backgroundSize||n.getPropertyValue(`background-size`)||`auto`).split(`,`).map(e=>e.trim()),d=(t.style.backgroundPosition||n.getPropertyValue(`background-position`)||`0% 0%`).split(`,`).map(e=>e.trim()),f=[],p=[];for(let e=0;e<l.length;e++){let t=r[e%r.length]||`scroll`,n=u[e%u.length],i=d[e%d.length];if(t!==`fixed`){f.push(n),p.push(i);continue}let o=0,m=0,h=l[e]&&l[e].match(/url\(["']?([^"')]+)["']?\)/);if(h)try{let e=new Image;e.src=h[1],await e.decode(),o=e.naturalWidth,m=e.naturalHeight}catch{f.push(n),p.push(i);continue}let g=ec(n,o,m,s,c);if(!g){f.push(n),p.push(i);continue}let _=i.split(/\s+/),v=(e,t,n)=>{if(!e)return 0;if(e.endsWith(`px`))return parseFloat(e);if(e.endsWith(`%`))return(t-n)*parseFloat(e)/100},y=v(_[0]||`0%`,s,g.w),b=v(_[1]||_[0]||`0%`,c,g.h);if(y===void 0||b===void 0){f.push(n),p.push(i);continue}f.push(`${nc(g.w)}px ${nc(g.h)}px`),p.push(`${nc(y-a.left)}px ${nc(b-a.top)}px`)}t.style.setProperty(`background-size`,f.join(`, `)),t.style.setProperty(`background-position`,p.join(`, `)),t.style.setProperty(`background-attachment`,r.map(()=>`scroll`).join(`, `))}var nc=e=>Math.round(e*100)/100;async function rc(e,t,n,r={},i=/* @__PURE__ */ new Map){if(!t)return;let a=[];e&&nr(e)&&a.push([e,t]);let o=[t];for(;o.length;){let e=o.pop();if(e.children)for(let t of e.children){if(t.tagName===`STYLE`)continue;let e=i.get(t);e&&nr(e)&&a.push([e,t]),o.push(t)}}for(let e=0;e<a.length;e+=6)await Promise.allSettled(a.slice(e,e+6).map(([e,t])=>$s(e,t,n,r)))}W();function ic(e,t,n=/* @__PURE__ */ new Map){let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let e=i.currentNode;e;e=i.nextNode()){let i=n.get(e);if(i?.nodeType!==1)continue;let a=B(i),o=a.getPropertyValue(`backdrop-filter`)||a.getPropertyValue(`-webkit-backdrop-filter`);o&&o!==`none`&&e!==t&&r.push({cloneEl:e,orig:i,bf:o,path:lc(t,e)})}if(!r.length)return;let a=e.getBoundingClientRect(),o=r.map((e,i)=>{let a=t.cloneNode(!0);cc(a,t,e.orig.getBoundingClientRect(),n),dc(uc(a,e.path));for(let e=0;e<i;e++){let t=uc(a,r[e].path);t&&(t.style.setProperty(`backdrop-filter`,`none`,`important`),t.style.setProperty(`-webkit-backdrop-filter`,`none`,`important`))}return{...e,copy:a}});for(let{cloneEl:e,orig:t,bf:n,copy:r}of o)ac.has(e.tagName)||oc(e,t,n,r,a)}var ac=/* @__PURE__ */ new Set([`IMG`,`INPUT`,`TEXTAREA`,`SELECT`,`CANVAS`,`VIDEO`,`AUDIO`,`IFRAME`,`EMBED`,`OBJECT`,`PROGRESS`,`METER`,`HR`,`BR`]);function oc(e,t,n,r,i){let a=t.getBoundingClientRect();if(!a.width||!a.height)return;let o=B(t),s=t.offsetWidth?a.width/t.offsetWidth:1,c=Math.abs(s-1)>.001?1/s:1;r.style.position=`absolute`,r.style.left=`${(i.left-a.left)*c}px`,r.style.top=`${(i.top-a.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin=`0`,r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin=`top left`);let l=document.createElement(`div`);l.style.cssText=`position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2`,l.appendChild(r);let u=document.createElement(`div`);u.style.cssText=`position:absolute;inset:0;border-radius:inherit;z-index:-1`,u.style.backgroundColor=o.backgroundColor,u.style.backgroundImage=e.style.backgroundImage||o.backgroundImage;for(let e of[`background-size`,`background-position`,`background-repeat`,`background-origin`,`background-clip`])u.style.setProperty(e,o.getPropertyValue(e));e.style.setProperty(`background-color`,`transparent`,`important`),e.style.setProperty(`background-image`,`none`,`important`),e.style.setProperty(`backdrop-filter`,`none`,`important`),e.style.setProperty(`-webkit-backdrop-filter`,`none`,`important`),o.position===`static`&&(e.style.position=`relative`),e.style.isolation=`isolate`,e.prepend(u),e.prepend(l)}var sc=128;function cc(e,t,n,r){let i=[[e,t]];for(;i.length;){let[e,t]=i.pop(),a=r.get(t);if(a?.nodeType===1){let t=a.getBoundingClientRect();(t.left>n.right+sc||t.right<n.left-sc||t.top>n.bottom+sc||t.bottom<n.top-sc)&&(e.tagName===`IMG`&&e.setAttribute(`src`,`data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=`),e.style&&(e.style.backgroundImage=`none`))}let o=e.children,s=t.children;for(let e=0;e<o.length;e++)i.push([o[e],s[e]])}}function lc(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function uc(e,t){if(!t)return null;let n=e;for(let e of t)if(n=n.children[e],!n)return null;return n}function dc(e){if(e)for(let t=e;t&&t.parentNode;){let n=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=n}}W(),H(),c(),c();function fc(e){return a(e),{styleMap:/* @__PURE__ */ new Map,styleCache:/* @__PURE__ */ new WeakMap,nodeMap:/* @__PURE__ */ new Map,warnings:[]}}ut();function pc(e,t){if(!e)return()=>{};let n=[];function r(e){if(t){let n=e.getBoundingClientRect();if(n.width>0||n.height>0){let r=Math.max(n.right,n.left+(e.scrollWidth||0)),i=Math.max(n.bottom,n.top+(e.scrollHeight||0));if(r<t.left-200||n.left>t.right+200||i<t.top-200||n.top>t.bottom+200)return}}let i=getComputedStyle(e),a=mc(e,i);a&&n.push(a);let o=hc(e,i);o&&n.push(o);for(let t of e.children||[])r(t)}return r(e),()=>n.forEach(e=>e())}function mc(e,t){if(!e)return()=>{};t||=getComputedStyle(e);let n=yc(t);if(n<=0||!Sc(e))return()=>{};let r=_c(e),i=r.text,a=xc(t);r.write(`X`);let o=e.scrollHeight-a;r.restore();let s=o>0?o:bc(t),c=Math.round(s*n+a);if(e.scrollHeight<=c+.5)return()=>{};let l=0,u=i.length,d=-1;for(;l<=u;){let t=l+u>>1;r.write(i.slice(0,vc(i,t))+`…`),e.scrollHeight<=c+.5?(d=t,l=t+1):u=t-1}let f=(d>=0?i.slice(0,vc(i,d)):``)+`…`;return r.write(f),gc(e,f,r)}function hc(e,t){if(!e||(t||=getComputedStyle(e),t.textOverflow!==`ellipsis`)||t.whiteSpace!==`nowrap`&&t.whiteSpace!==`pre`||t.overflowX!==`hidden`&&t.overflowX!==`clip`||!Sc(e)||e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=_c(e),r=n.text,i=0,a=r.length,o=-1;for(;i<=a;){let t=i+a>>1;n.write(r.slice(0,vc(r,t))+`…`),e.scrollWidth<=e.clientWidth+.5?(o=t,i=t+1):a=t-1}let s=(o>=0?r.slice(0,vc(r,o)):``)+`…`;return n.write(s),gc(e,s,n)}function gc(e,t,n){return()=>{e.textContent===t&&n.restore()}}function _c(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let n=t.map(e=>e.data);return{text:n.join(``),write(e){t[0].data=e;for(let e=1;e<t.length;e++)t[e].data=``},restore(){for(let e=0;e<t.length;e++)t[e].data=n[e]}}}function vc(e,t){if(t<=0||t>=e.length)return t;let n=e.charCodeAt(t-1);return n>=55296&&n<=56319?t-1:t}function yc(e){let t=e.getPropertyValue(`-webkit-line-clamp`)||e.getPropertyValue(`line-clamp`);t=(t||``).trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}function bc(e){let t=(e.lineHeight||``).trim(),n=parseFloat(e.fontSize)||16;return!t||t===`normal`?Math.round(n*1.2):t.endsWith(`px`)?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith(`%`)?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function xc(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function Sc(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Cc=[`clone`,`render`],wc={clone:0,render:1},Tc=`render`;function Ec(e){let t=Array.isArray(e&&e.plugins)?e.plugins:[];if(!t.length)return{stage:Tc,loweredBy:[]};let n=-1,r=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.needs===void 0?Tc:e.needs;if(!Object.prototype.hasOwnProperty.call(wc,t))throw Error(`[snapdom] plugin '${e.name||`(unnamed)`}' declares needs: ${JSON.stringify(t)}, expected one of ${Cc.join(`, `)}`);r.push({name:e.name||`(unnamed)`,needs:t}),n=Math.max(n,wc[t])}if(n<0)return{stage:Tc,loweredBy:[]};let i=Cc[n];return{loweredBy:i===`render`?[]:r.filter(e=>e.needs===i).map(e=>e.name),stage:i}}function Dc(e,t){return wc[e]>=wc[t]}function Oc(e,t,n){let r=t.length?t.map(e=>`'${e}'`).join(`, `):`the attached plugins`;return/* @__PURE__ */ Error(`[snapdom] no ${n}: this capture stopped at '${e}' because ${r} declared needs: '${e}' (result.needs says so too). It is not re-captured on demand \u2014 that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var kc=[];function Ac(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t==`function`?t(n):t}if(typeof e==`object`&&`plugin`in e){let{plugin:t,options:n}=e;return typeof t==`function`?t(n):t}return typeof e==`function`?e():e}function jc(...e){let t=e.flat();for(let e of t){let t=Ac(e);if(t){if(t.needs!==void 0&&t.needs!==`render`)throw Error(`[snapdom] global plugin '${t.name||`(unnamed)`}' declares needs: ${JSON.stringify(t.needs)}. A global plugin must run to '${Tc}': lowering it here would stop EVERY capture in the app short of pixels. Pass it per capture instead: snapdom(el, { plugins: [<plugin>] }).`);kc.some(e=>e&&e.name&&t.name&&e.name===t.name)||kc.push(t)}}}function Mc(e){return e&&Array.isArray(e.plugins)?e.plugins:kc}async function Nc(e,t,n){let r=n,i=Mc(t);for(let n of i){let i=n&&typeof n[e]==`function`?n[e]:null;if(!i)continue;let a=await i(t,r);typeof a<`u`&&(r=a)}return r}async function Pc(e,t,n){let r=[],i=Mc(t);for(let a of i){let i=a&&typeof a[e]==`function`?a[e]:null;if(!i)continue;let o=await i(t,n);typeof o<`u`&&r.push(o)}return r}var Fc=0;function Ic(e){let t=[];if(Array.isArray(e))for(let n of e){let e=Ac(n);if(!e)continue;e.name||=`anonymous-${++Fc}`;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of kc)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}function Lc(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Ic(t)),e}function Rc(){return kc.slice()}var zc=[`resolveNode`,`beforeSnap`,`beforeClone`,`afterClone`,`beforeRender`,`afterRender`];function Bc(e){let t=Array.isArray(e&&e.plugins)?e.plugins:[];for(let e of t){let t=Ac(e);if(t&&t.pure!==!0){for(let e of zc)if(typeof t[e]==`function`)return!0}}return!1}c(),tt();var Vc=`data-snapdom-asset`,Hc=`http://www.w3.org/1999/xlink`,Uc=0;function Wc(e,t,n,r,i,a){let o=a.__compressedAssets||=/* @__PURE__ */ new WeakMap,s=o.get(e);s||(s={token:String(++Uc),properties:[]},o.set(e,s),e.setAttribute(Vc,s.token));let c=s.properties.find(e=>e.kind===t&&e.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):s.properties.push({kind:t,name:n,original:r,compressed:i})}var Gc=(e,t)=>t.kind===`style`?e.style?.getPropertyValue(t.name):e.getAttribute(t.name);function Kc(e,t){let n=/* @__PURE__ */ new Map;if(!e||!t)return n;let r=[e,...e.querySelectorAll(`[${Vc}]`)];for(let e of r){let r=t.get(e);if(!r||e.getAttribute(Vc)!==r.token)continue;let i=r.properties.filter(t=>Gc(e,t)===t.compressed).map(e=>Object.freeze({...e}));i.length&&n.set(r.token,Object.freeze(i))}return n}function qc(e,t){if(!e||!t)return;let n=0;for(let r of[e,...e.querySelectorAll(`[${Vc}]`)]){let e=t.get(r);e&&(e.token=String(++n),r.setAttribute(Vc,e.token))}}function Jc(e,t){if(!t?.size||typeof e!=`string`||!e.startsWith(`data:image/svg+xml`))return e;let n=e.indexOf(`,`),r=new DOMParser().parseFromString(decodeURIComponent(e.slice(n+1)),`image/svg+xml`);if(r.querySelector(`parsererror`))return e;let i=!1;for(let e of r.querySelectorAll(`[${Vc}]`))for(let n of t.get(e.getAttribute(Vc))||[])Gc(e,n)===n.compressed&&(n.kind===`style`?e.style.setProperty(n.name,n.original,e.style.getPropertyPriority(n.name)):n.name===`xlink:href`?e.setAttributeNS(Hc,n.name,n.original):e.setAttribute(n.name,n.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:e}function Yc(e){if(e.is2D===!1)return 1/0;let t=e.a*e.a+e.b*e.b+e.c*e.c+e.d*e.d,n=e.a*e.d-e.b*e.c;return Math.sqrt((t+Math.sqrt(Math.max(0,t*t-4*n*n)))/2)}function Xc(e,t){let n=t.element||e,r=n.isConnected?B(n):n.style,i=t.__compressionClip,a=(e,t)=>{try{return e[t]?.baseVal?.value||0}catch{return 0}},o=i?.width||n.offsetWidth||parseFloat(r?.width)||a(n,`width`),s=i?.height||n.offsetHeight||parseFloat(r?.height)||a(n,`height`),c=Number.isFinite(t.width),l=Number.isFinite(t.height);if(!i&&(c||l)&&o&&s)try{let e=t.outerTransforms===!1&&t.__compressionRootTransform?t.__compressionRootTransform:rs({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:o,height:s});if(e.is2D===!1)o=0,s=0;else{let t=Math.abs(e.a)*o+Math.abs(e.c)*s,n=Math.abs(e.b)*o+Math.abs(e.d)*s;o=Math.min(o,t),s=Math.min(s,n)}}catch{o=0,s=0}let u=(c||l?Math.max(c?o?t.width/o:1/0:0,l?s?t.height/s:1/0:0):t.scale||1)*(t.dpr||1);t.__compressionDensity=u;let d=/* @__PURE__ */ new WeakMap,f=e=>{if(!e||e.nodeType!==1)return 1;if(d.has(e))return d.get(e);let t=e.isConnected?B(e):e.style,r=1;try{t?.perspective&&t.perspective!==`none`&&(r=1/0);let i=t?.transform;if(i&&i!==`none`)r*=Yc(new DOMMatrix(i));else if(e.transform?.baseVal?.numberOfItems){let t=new DOMMatrix;for(let n=0;n<e.transform.baseVal.numberOfItems;n++){let r=e.transform.baseVal.getItem(n).matrix;t=t.multiply(new DOMMatrix([r.a,r.b,r.c,r.d,r.e,r.f]))}r*=Yc(t)}if(t?.scale&&t.scale!==`none`){let e=t.scale.trim().split(/\s+/).map(e=>parseFloat(e)/(e.endsWith(`%`)?100:1));r*=Math.max(...e.map(Math.abs))}if(e!==n&&t?.zoom&&t.zoom!==`normal`&&(r*=parseFloat(t.zoom)||1),e.localName===`svg`&&e.viewBox?.baseVal?.width>0&&e.viewBox.baseVal.height>0){let n=e.viewBox.baseVal,i=n=>/^\d+(?:\.\d+)?px$/.test(t?.[n]||``)?parseFloat(t[n]):a(e,n),o=i(`width`),s=i(`height`);r*=o>0&&s>0?Math.max(o/n.width,s/n.height):1/0}}catch{r=1/0}return Number.isFinite(r)||(r=1/0),e!==n&&(r*=f(e.parentElement||e.getRootNode?.().host)),d.set(e,r),r};return{density:u,stretch:f}}var Zc=.92,Qc=1;async function $c(e){let t=new Image;return t.decoding=`sync`,t.src=e,typeof t.decode==`function`?(await t.decode(),t):(await new Promise((e,n)=>{t.onload=()=>e(),t.onerror=n}),t)}function el(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:``}var tl=65536,nl=33554432,rl=/* @__PURE__ */ new Map;function il(e,t,n,r){if(n.length+(r?.length||0)>nl)return;e.set(t,{source:n,result:r});let i=0;for(let t of e.values())i+=t.source.length+(t.result?.length||0);for(;i>nl;){let t=e.keys().next().value,n=e.get(t);i-=n.source.length+(n.result?.length||0),e.delete(t)}}function al(e,t){let n=e.indexOf(`,`);if(n<0||!/;base64/i.test(e.slice(0,n)))return null;let r=Math.ceil(t/3)*4,i=e.length-n-1,a=Math.min(i,r);try{let t=atob(e.slice(n+1,n+1+a-a%4)),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}catch{return null}}function ol(e){let t=al(e,4096);if(!t||t.length<16)return null;let n=e=>t[e]<<8|t[e+1];if(t[0]===137&&t[1]===80&&t.length>=24)return{w:(t[16]<<24|t[17]<<16|t[18]<<8|t[19])>>>0,h:(t[20]<<24|t[21]<<16|t[22]<<8|t[23])>>>0};if(t[0]===71&&t[1]===73&&t[2]===70)return{w:t[6]|t[7]<<8,h:t[8]|t[9]<<8};if(t[0]===82&&t[1]===73&&t[8]===87&&t.length>=30){let e=t[15];if(e===32&&t[23]===157)return{w:(t[26]|t[27]<<8)&16383,h:(t[28]|t[29]<<8)&16383};if(e===76)return{w:(t[21]|(t[22]&63)<<8)+1,h:((t[22]>>6|t[23]<<2|(t[24]&15)<<10)&16383)+1};if(e===88)return{w:(t[24]|t[25]<<8|t[26]<<16)+1,h:(t[27]|t[28]<<8|t[29]<<16)+1}}if(t[0]===255&&t[1]===216){let e=2;for(;e+9<t.length;){if(t[e]!==255){e++;continue}let r=t[e+1];if(r===216||r===1||r>=208&&r<=215){e+=2;continue}if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return{h:n(e+5),w:n(e+7)};let i=n(e+2);if(i<2)break;e+=2+i}}return null}function sl(e,t,n,r){let i=Math.min(1,Math.max(n/e,r/t));return!(i>0)||i>=.95?0:i}var cl=`self.onmessage = async (e) => {
|
|
11
|
-
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
12
|
-
try {
|
|
13
|
-
const blob = given || await (await fetch(dataURL)).blob()
|
|
14
|
-
const bmp = await createImageBitmap(blob)
|
|
15
|
-
const nw = bmp.width, nh = bmp.height
|
|
16
|
-
if (!nw || !nh) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
17
|
-
const raw = Math.min(1, Math.max(targetW / nw, targetH / nh))
|
|
18
|
-
if (!(raw > 0) || raw >= 0.95) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
19
|
-
const factor = raw * resFactor
|
|
20
|
-
const ow = Math.max(1, Math.round(nw * factor))
|
|
21
|
-
const oh = Math.max(1, Math.round(nh * factor))
|
|
22
|
-
const canvas = new OffscreenCanvas(ow, oh)
|
|
23
|
-
const ctx = canvas.getContext('2d')
|
|
24
|
-
ctx.imageSmoothingEnabled = true
|
|
25
|
-
ctx.imageSmoothingQuality = 'high'
|
|
26
|
-
ctx.drawImage(bmp, 0, 0, ow, oh)
|
|
27
|
-
bmp.close()
|
|
28
|
-
const out = await canvas.convertToBlob({ type: mime, quality })
|
|
29
|
-
const url = new FileReaderSync().readAsDataURL(out)
|
|
30
|
-
self.postMessage({ id, url: (url && url.length < srcLength) ? url : null })
|
|
31
|
-
} catch (err) {
|
|
32
|
-
self.postMessage({ id, error: String(err) })
|
|
33
|
-
}
|
|
34
|
-
}`,ll=Math.max(1,Math.min(4,(typeof navigator<`u`&&navigator.hardwareConcurrency||2)-1)),Q=null,ul=0,dl=0,fl=/* @__PURE__ */ new Map;function pl(){for(let e of fl.values())e(void 0);if(fl.clear(),Array.isArray(Q))for(let e of Q)try{e?.terminate()}catch{}Q=!1}function ml(){let e,t=null;try{e=URL.createObjectURL(new Blob([cl],{type:`text/javascript`})),t=new Worker(e),t.onmessage=e=>{let t=fl.get(e.data.id);t&&(fl.delete(e.data.id),t(e.data.error?void 0:e.data.url??null))},t.onerror=pl}catch{t=null}return e&&URL.revokeObjectURL(e),t}function hl(){if(Q===!1)return!1;if(Q===null){if(typeof Worker>`u`||typeof OffscreenCanvas>`u`)return Q=!1;Q=[]}let e=ul++%ll;if(!Q[e]){let t=ml();if(!t)return pl(),!1;Q[e]=t}return Q[e]}var gl=5e3;function _l(e,t,n,r,i){let a=hl();return a?new Promise(o=>{let s=++dl,c=setTimeout(()=>{fl.delete(s),o(void 0)},gl);fl.set(s,e=>{clearTimeout(c),o(e)});try{a.postMessage({id:s,dataURL:i?``:e,blob:i,srcLength:e.length,targetW:t,targetH:n,resFactor:Qc,quality:Zc,mime:r})}catch{clearTimeout(c),fl.delete(s),o(void 0)}}):Promise.resolve(void 0)}async function vl(e,t,n,r){if(typeof e!=`string`||!e.startsWith(`data:image`)||e.startsWith(`data:image/svg`))return null;t=Math.ceil(t),n=Math.ceil(n);let i=e.length+`:`+e.slice(0,64)+e.slice(-64)+`:`+t+`x`+n,a=s.compress,o=a.get(i);if(o?.source===e)return o.result;let c=rl.get(i);if(c?.source===e&&c.cache===a)return c.promise;let l=(async()=>{let i=el(e),a=i===`image/jpeg`?`image/jpeg`:i===`image/webp`?`image/webp`:`image/png`,o=ol(e);if(o&&o.w>0&&o.h>0&&!sl(o.w,o.h,t,n))return null;if(e.length>=tl){let i=await _l(e,t,n,a,r);if(i!==void 0)return i}let s;try{s=await $c(e)}catch{return null}let c=s.naturalWidth||s.width,l=s.naturalHeight||s.height;if(!c||!l)return null;let u=sl(c,l,t,n);if(!u)return null;let d=u*Qc,f=Math.max(1,Math.round(c*d)),p=Math.max(1,Math.round(l*d)),m=document.createElement(`canvas`);m.width=f,m.height=p;let h=m.getContext(`2d`);if(!h)return null;h.imageSmoothingEnabled=!0,h.imageSmoothingQuality=`high`,h.drawImage(s,0,0,f,p);try{let t=m.toDataURL(a,Zc);if(typeof t==`string`&&t.startsWith(`data:image`)&&t.length<e.length)return t}catch{}return null})(),u={source:e,promise:l,cache:a};rl.set(i,u);try{let t=await l;return il(a,i,e,t),t}finally{rl.get(i)===u&&rl.delete(i)}}async function yl(e,t,n=/* @__PURE__ */ new Map,r={}){if(!t.compress)return{count:0,before:0,after:0};let i=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&i.unshift(e);let a=0,o=0,s=0,c=async i=>{let c=i.getAttribute(`src`)||``;if(!c.startsWith(`data:image`)||c.startsWith(`data:image/svg`))return;let l=parseFloat(i.dataset.snapdomWidth)||parseFloat(i.style.width)||i.width||0,u=parseFloat(i.dataset.snapdomHeight)||parseFloat(i.style.height)||i.height||0;if(!l||!u)return;let d=r.value||=Xc(e,t),f=d.density*d.stretch(n.get(i)||i),p=await vl(c,l*f,u*f,i.__snapdomBlob);p&&(a++,o+=c.length,s+=p.length,i.setAttribute(`src`,p),Wc(i,`attribute`,`src`,c,p,t))};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(c));return{count:a,before:o,after:s}}var bl=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function xl(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}async function Sl(e,t,n=/* @__PURE__ */ new Map,r={}){if(!t.compress)return{count:0};let i=[],a=[e,...e.querySelectorAll(`*`)];for(let e of a){let t=e.style&&e.style.backgroundImage;t&&t.includes(`data:image`)&&i.push(e)}let o=0,s=async i=>{let a=n.get(i);if(!a||!a.isConnected)return;let s;try{s=getComputedStyle(a)}catch{return}if((s.backgroundRepeat||`repeat`).toLowerCase().split(`,`).some(e=>e.trim()!==`no-repeat`))return;let c=(i.style.backgroundSize||s.backgroundSize||`auto`).toLowerCase();if(c.split(`,`).some(e=>!bl.test(e.trim())))return;let{w:l,h:u}=xl(a);if(!l||!u)return;let d=Math.max(1,...(c.match(/\d+(?:\.\d+)?%/g)||[]).map(e=>parseFloat(e)/100)),f=r.value||=Xc(e,t),p=f.density*f.stretch(a)*d,m=l*p,h=u*p,g=i.style.backgroundImage,_=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],v=g;for(let e of _){let t=e[2];if(t.startsWith(`data:image/svg`))continue;let n=await vl(t,m,h);n&&(v=v.split(t).join(n),o++)}v!==g&&(i.style.setProperty(`background-image`,v,i.style.getPropertyPriority(`background-image`)),Wc(i,`style`,`background-image`,g,i.style.backgroundImage,t))};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(s));return{count:o}}async function Cl(e,t,n=/* @__PURE__ */ new Map,r={}){if(!t.compress)return{count:0};let i=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&i.unshift(e);let a=0,o=async i=>{let o=i.getAttribute(`href`)||(typeof i.getAttributeNS==`function`?i.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(!o||!o.startsWith(`data:image`)||o.startsWith(`data:image/svg`))return;let s=i.getAttribute(`width`)||``,c=i.getAttribute(`height`)||``;if(s.includes(`%`)||c.includes(`%`))return;let l=n.get(i),u=l?B(l):i.style,d=(e,t)=>{if(/^\d+(?:\.\d+)?px$/.test(u?.[e]||``))return parseFloat(u[e]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(t.trim()))return parseFloat(t);try{return l?.[e]?.baseVal?.value||0}catch{return 0}},f=d(`width`,s),p=d(`height`,c);if(!f||!p)return;let m=r.value||=Xc(e,t),h=m.density*m.stretch(l||i),g=await vl(o,f*h,p*h);g&&(i.setAttribute(`href`,g),Wc(i,`attribute`,`href`,o,g,t),i.hasAttribute(`xlink:href`)&&(i.setAttributeNS(Hc,`xlink:href`,g),Wc(i,`attribute`,`xlink:href`,o,g,t)),a++)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(o));return{count:a}}async function wl(e,t,n){if(!t.compress)return;let r={};await yl(e,t,n,r),await Sl(e,t,n,r),await Cl(e,t,n,r)}W(),c(),z();function Tl(e,t){if(V())return e;let n=e.indexOf(`</style>`);if(n===-1)return e;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],a=n,o;for(r.lastIndex=n;o=r.exec(e);)i.push({text:e.slice(a,o.index),intern:!0}),i.push({text:o[0],intern:!1}),a=r.lastIndex;i.push({text:e.slice(a),intern:!0});let s=/* @__PURE__ */ new Map,c=/ style="([^"]*)"/g,l;for(let e of i)if(e.intern)for(c.lastIndex=0;l=c.exec(e.text);)s.set(l[1],(s.get(l[1])||0)+1);let u=0;for(let[e,t]of s)t>1&&(u+=(t-1)*e.length);if(u<2048||e.includes(` data-sdi=`))return e;let d=El(t,i.some(e=>!e.intern),e.includes(`data-snapdom-asset`));if(d===null)return e;let f=/* @__PURE__ */ new Map,p=0,m=[],h=(e,t)=>{if((s.get(t)||0)<2||d.has(t))return e;let n=f.get(t);return n===void 0&&(n=`i`+(p++).toString(36),f.set(t,n),m.push(`[data-sdi="${n}"]{${t}}`)),` data-sdi="${n}"`},g=``;for(let e of i)g+=e.intern?e.text.replace(c,h):e.text;return e.slice(0,n)+m.join(``)+g}function El(e,t,n){let r=/* @__PURE__ */ new Set;if(!t&&!n)return r;if(!e||e.querySelector(`[data-sdi]`))return null;let i=e=>{let t=e.getAttribute(`style`);t&&r.add(t)};if(n&&e.querySelectorAll(`[data-snapdom-asset][style]`).forEach(i),t)try{let t=n=>{for(let r of n){if(r.type===CSSRule.IMPORT_RULE||r.type===CSSRule.NAMESPACE_RULE)throw Error(`External or namespaced CSS`);if(r.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(r.selectorText))throw Error(`Attribute-dependent or nested CSS`);e.querySelectorAll(r.selectorText).forEach(i)}r.cssRules&&t(r.cssRules)}};for(let n of[...e.querySelectorAll(`style`)].slice(1)){let e=n.textContent||``;if(/@import\b/i.test(e))return null;let r=new CSSStyleSheet;r.replaceSync(e),t(r.cssRules)}}catch{return null}let a=/* @__PURE__ */ new Set,o=document.createElement(`div`),s=new XMLSerializer;for(let e of r){o.setAttribute(`style`,e);let t=s.serializeToString(o).match(/ style="([^"]*)"/);t&&a.add(t[1])}return a}async function Dl(e,t){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:a,fontsCSS:o}=t,c=e.options;if(e!==c){let{options:t,...n}=e;e=Object.assign(c,n),Object.defineProperty(e,"options",{value:e,configurable:!0})}let l,u;zs(e,o),await Nc(`beforeRender`,e);let d=B(e.element),f=e.element.getBoundingClientRect(),p=Math.max(1,Z(e.element.offsetWidth||parseFloat(d.width)||f.width||1)),m=Math.max(1,Z(e.element.offsetHeight||parseFloat(d.height)||f.height||1)),h=e.element.ownerDocument||document;if(!n&&(e.element===h.body||e.element===h.documentElement)&&!e.__pinned){let t=Math.max(e.element.scrollHeight||0,h.documentElement?.scrollHeight||0,h.body?.scrollHeight||0),n=Math.max(e.element.scrollWidth||0,h.documentElement?.scrollWidth||0,h.body?.scrollWidth||0);t>0&&(m=Math.max(m,Z(t))),n>0&&(p=Math.max(p,Z(n)));try{let r=(e.scrollbarCSS||``).length+(e.baseCSS||``).length+(e.fontsCSS||``).length+(e.classCSS||``).length,i=s.measureHints.get(e.element);if(i&&i.cssLen===r&&i.w0===p&&i.docH===t&&i.docW===n)i.csh>0&&(m=Math.max(m,Z(i.csh))),i.csw>0&&(p=Math.max(p,Z(i.csw)));else{let i=h.createElement(`div`);R(i),i.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+p+`px!important;overflow:visible!important;visibility:hidden!important;`;let a=i.attachShadow({mode:`open`}),o=h.createElement(`style`);o.textContent=(e.scrollbarCSS||``)+e.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+e.classCSS,a.appendChild(o),a.appendChild(e.clone.cloneNode(!0)),h.body.appendChild(i);let c=i.scrollHeight,l=i.scrollWidth;h.body.removeChild(i),s.measureHints.set(e.element,{cssLen:r,w0:p,docH:t,docW:n,csh:c,csw:l}),c>0&&(m=Math.max(m,Z(c))),l>0&&(p=Math.max(p,Z(l)))}}catch{}}if(e.options?.excludeMode===`remove`||typeof e.options?.filter==`function`&&e.options.filterMode===`remove`){let t=js(e.element,e.options),n=js(e.element,{}),r=Math.max(2,m*.15);Number.isFinite(n)&&n>=m-r&&Number.isFinite(t)&&t>0&&(m=Math.max(1,Math.min(m,Z(t+1))))}if(e.options?.reconcile)try{let t=(e.scrollbarCSS||``)+e.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+e.classCSS;Ns(e.element,e.clone,t,e.nodeMap,p,m)}catch(e){console.warn(`[snapdom] reconcile pass failed:`,e)}let g=(e,t=NaN)=>{let n=typeof e==`string`?parseFloat(e):e;return Number.isFinite(n)?n:t},_=g(e.options.width),v=g(e.options.height),y=n?Z(n.width):p,b=n?Z(n.height):m,x=y,S=b,C=Number.isFinite(_),w=Number.isFinite(v),T=b>0?y/b:1;C&&w?(x=Math.max(1,Z(_)),S=Math.max(1,Z(v))):C?(x=Math.max(1,Z(_)),S=Math.max(1,Z(x/(T||1)))):w&&(S=Math.max(1,Z(v)),x=Math.max(1,Z(S*(T||1))));let E=0,D=0,O=p,k=m;if(n){let t=0,i=0;if(Ol(e.element)){let n=null;if(!r&&a&&Number.isFinite(a.a))n={a:a.a,b:a.b||0,c:a.c||0,d:a.d||1,e:0,f:0};else{let t=es(e.element),r=ds(d.transform&&d.transform!==`none`?d.transform:``,t);r&&r.is2D&&(n={a:r.a,b:r.b,c:r.c,d:r.d,e:0,f:0})}if(n&&(n.a!==1||n.b!==0||n.c!==0||n.d!==1)){let{ox:e,oy:r}=$o(d,p,m),a=Qo(p,m,n,e,r);t=a.minX,i=a.minY}}E=Z(n.x+t),D=Z(n.y+i),O=Z(E+n.width),k=Z(D+n.height)}else if(!r&&a&&Number.isFinite(a.a)){let e={a:a.a,b:a.b||0,c:a.c||0,d:a.d||1,e:0,f:0},t=Qo(p,m,e,0,0);E=Z(t.minX),D=Z(t.minY),O=Z(t.maxX),k=Z(t.maxY)}else if(r&&Ol(e.element)){let t=d.transform&&d.transform!==`none`?d.transform:``,n=es(e.element),r=rs({baseTransform:t,rotate:n.rotate||`0deg`,scale:n.scale,translate:n.translate,width:p,height:m}),{ox:i,oy:a}=$o(d,p,m),o=r.is2D?r:new DOMMatrix(r.toString()),s={a:o.a,b:o.b,c:o.c,d:o.d,e:0,f:0},c=Qo(p,m,s,i,a);E=Z(c.minX),D=Z(c.minY),O=Z(c.maxX),k=Z(c.maxY)}let A=Vo(d),ee=Ho(d),j=Wo(d),te=Go(d),ne=Ko(d),M=f.width>0?(O-E)/f.width:1,re=f.height>0?(k-D)/f.height:1,N=i===`subtree`&&!n?Xo(e.element,e.nodeMap,e.styleCache,M,re):{top:0,right:0,bottom:0,left:0},ie=n?{top:0,right:0,bottom:0,left:0}:i?{top:Z(Math.max(A.top,ee.top,N.top)+j.top+te.top+ne.bleed.top),right:Z(Math.max(A.right,ee.right,N.right)+j.right+te.right+ne.bleed.right),bottom:Z(Math.max(A.bottom,ee.bottom,N.bottom)+j.bottom+te.bottom+ne.bleed.bottom),left:Z(Math.max(A.left,ee.left,N.left)+j.left+te.left+ne.bleed.left)}:{top:j.top,right:j.right,bottom:j.bottom,left:j.left};E=Z(E-ie.left),D=Z(D-ie.top),O=Z(O+ie.right),k=Z(k+ie.bottom);let ae=Math.max(1,Z(O-E)),oe=Math.max(1,Z(k-D)),P=`http://www.w3.org/2000/svg`,F=Z((Ol(e.element)?2:0)+ +!r),se=Math.ceil(ae+F*2),ce=Math.ceil(oe+F*2),le=Z(-(Z(E)-F)),ue=Z(-(Z(D)-F)),de=Math.max(0,le),fe=Math.max(0,ue),pe=Z(se-Math.min(0,le)),me=Z(ce-Math.min(0,ue)),he=h.defaultView||window,I=!V()&&CSS.supports(`zoom`,`2`)&&he.devicePixelRatio||1,L=document.createElementNS(P,`foreignObject`);L.setAttribute(`x`,String(Math.min(0,le)*I)),L.setAttribute(`y`,String(Math.min(0,ue)*I)),L.setAttribute(`width`,String(pe*I)),L.setAttribute(`height`,String(me*I)),L.style.overflow=`visible`;let ge=document.createElement(`style`);ge.textContent=(e.scrollbarCSS||``)+e.baseCSS+e.fontsCSS+`svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}`+e.classCSS,L.appendChild(ge);let _e=document.createElement(`div`);_e.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),_e.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${pe}px;height:${me}px`+(de!==0||fe!==0?`;padding:${fe}px 0 0 ${de}px !important`:``)+(I===1?``:`;zoom:${I} !important`),_e.appendChild(e.clone),L.appendChild(_e);let ve=new XMLSerializer().serializeToString(L),ye=C||w,be=Object.freeze({w0:y,h0:b,vbW:se,vbH:ce,targetW:x,targetH:S,contentX:Z(le+(n?E:0)),contentY:Z(ue+(n?D:0)),clip:n?Object.freeze({x:Z(E),y:Z(D),width:y,height:b}):null});Object.defineProperty(c,"meta",{value:be,enumerable:!0,writable:!1,configurable:!0});let xe=!ye||V()?se:C?x:Z(S/ce*se),Se=!ye||V()?ce:w?S:Z(x/se*ce),Ce=parseFloat(B(h.documentElement)?.fontSize)||16,we=I!==1,Te=`<svg xmlns="${P}" width="${xe}" height="${Se}" viewBox="0 0 ${se} ${ce}" font-size="${Ce}px">${we?`<g transform="scale(${1/I})">`:``}`,De=we?`</g></svg>`:`</svg>`;u=Te+Tl(ve,L)+De,l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,e.svgString=u,e.dataURL=l,c.__artifacts={classCSS:e.classCSS||``,fontsCSS:e.fontsCSS||``,baseCSS:e.baseCSS||``,scrollbarCSS:e.scrollbarCSS||``},await Nc(`afterRender`,e),e.clone=e.nodeMap=e.styleCache=e.svgString=null;let z=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Ee);return z&&z.style.position===`absolute`&&z.remove(),e.dataURL}function Ol(e){return is(e)}function kl(e){let t=Array.isArray(e.plugins)?e.plugins:Rc(),n=[];for(let e of t){let t=Ac(e);t&&typeof t.resolveNode==`function`&&n.push(t.resolveNode.bind(t))}return n.length?n:null}async function Al(e,t){if(!e)throw Error(`Element cannot be null or undefined`);t.__session=fc(t.cache),delete t.__compressedAssets,delete t.__compressedSnapshot,delete t.__compressionDensity,t.__resolveNodeHooks=kl(t);let n=t;n.element=e,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,a,o,c,l,u,d=``,f=null,p=t.needs||`render`,m=n.format,h=n.type;await Nc(`beforeSnap`,n);let g=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),_=n.type!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(g||_){let e=String(g?n.format:n.type).toLowerCase();n.format=e===`jpg`?`jpeg`:e,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor===`transparent`)&&(n.backgroundColor=`#ffffff`)}await Nc(`beforeClone`,n);let v=n.outerTransforms!==!1,y=n.outerShadows===`subtree`?`subtree`:!!n.outerShadows,b=n.clip?ss(n.element,n.clip):null;if(t.__styleShare===void 0)try{t.__styleShare=or(n.element)&&(typeof n.element.getAnimations!=`function`||n.element.getAnimations({subtree:!0}).length===0)}catch{t.__styleShare=!1}let x=rt(t.fast);for(;;){t.__slicer=x;let e=pc(n.element,b);try{({clone:r,classCSS:i,classPrefixCSS:a,styleCache:o,nodeMap:c,reconcileRisk:l,clipWindow:u}=await Vs(n.element,n.options)),l>0&&!t.reconcile&&(ct(t.__session,`reconcile-risk`,`text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout`),s.warnedReconcile||(s.warnedReconcile=!0,console.warn(`[snapdom] Inline/table text may re-wrap with fallback fonts. Use { reconcile: true } to check layout (~2x capture time).`))),!v&&r&&(f=Zo(n.element,r)),!y&&r&&ps(n.element,r,n.options),r&&(_s(n.element,r,c),ms(n.element,r))}finally{e()}if(!x?.yielded||!t.__tornSinceStart?.())break;x=null,t.__session=fc(t.cache)}if(t.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=o,n.nodeMap=c,await Nc(`afterClone`,n),!Dc(p,`render`))return null;if(x?.due()&&await x.pause(),Cs(n.clone),n.options?.excludeMode===`remove`||typeof n.options?.filter==`function`&&n.options.filterMode===`remove`)try{Os(n.element,n.clone,n.styleCache,n.nodeMap)}catch(e){ct(t.__session,`shrink-failed`,`shrink pass failed`,e),console.warn(`[snapdom] shrink pass failed:`,e)}try{await wa(n.clone,n.element,n.nodeMap)}catch{}let S=e=>Promise.resolve().then(e),C=(async()=>{await Promise.all([S(()=>Js(n.clone,n.options)),S(()=>rc(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{ic(n.element,n.clone,n.nodeMap)}catch(e){ct(t.__session,`backdrop-filter-failed`,`backdrop-filter emulation failed`,e),console.warn(`[snapdom] backdrop-filter emulation failed:`,e)}if(t.compress&&(t.__compressionClip=u,t.__compressionRootTransform=f,await S(()=>wl(n.clone,n.options,n.nodeMap))),t.captureSelection)try{Gi(n.nodeMap)}catch(e){ct(t.__session,`selection-compose-failed`,`field selection compose failed`,e)}})(),w=Promise.resolve();(t.embedFonts===`auto`?((n.element.ownerDocument||document).fonts?.size||0)>0:t.embedFonts)&&(w=S(async()=>{let e=n.element.ownerDocument||document,r=b?e=>{try{let t=e.getBoundingClientRect();return t.right>=b.left-200&&t.left<=b.right+200&&t.bottom>=b.top-200&&t.top<=b.bottom+200}catch{return!0}}:null,{required:i,usedCodepoints:a}=!b&&t.__fontUsage||io(n.element,r);if(t.embedFonts===`auto`){let t=/* @__PURE__ */ new Set;try{for(let n of e.fonts)t.add(String(n.family).replace(/["']/g,``).toLowerCase())}catch{}if(!(t.size>0&&Array.from(i).some(e=>t.has(String(e).split(`__`)[0].toLowerCase()))))return}V()&&await ao(new Set(Array.from(i).map(e=>String(e).split(`__`)[0]).filter(Boolean)),1,e),d=await ro({required:i,usedCodepoints:a,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:e})})),await Promise.all([C,w]),(n.options.plugins||[]).some(e=>e&&(typeof e.beforeRender==`function`||typeof e.afterRender==`function`)),n.options.engine,x?.due()&&await x.pause();let T=n.clone;qc(T,t.__compressedAssets);let E=await Dl(n,{clipWindow:u,outerTransforms:v,outerShadows:y,rootTransform2D:f,fontsCSS:d});if(t.__compressedSnapshot=Kc(T,t.__compressedAssets),typeof t.__retain==`function`)try{t.__retain({clone:r,nodeMap:c,styleCache:o,styleMap:t.__session.styleMap,classPrefixCSS:a,fontsCSS:d,clipWindow:u,outerTransforms:v,outerShadows:y,rootTransform2D:f,__compressedAssets:t.__compressedAssets,__compressionDensity:t.__compressionDensity})}catch{}return E}c(),E();var jl=/* @__PURE__ */ new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]);function Ml(e={}){let t=typeof e.type==`string`&&jl.has(e.type.toLowerCase())?e.type.toLowerCase():null,n=e.format??t??`png`;n===`jpg`&&(n=`jpeg`);let r=e.format==null?t===`jpg`?`jpeg`:t:n,a=i(e.cache),o=e.exclude==null?[]:Array.isArray(e.exclude)?e.exclude:[e.exclude],s=[],c=[];for(let e of o)typeof e==`string`?s.push(e):typeof e==`function`?c.push(e):e!=null&&console.warn(`[snapdom] Invalid exclude entry; expected selector or predicate:`,e);let l=e.excludeMode??`hide`,u={debug:e.debug??!1,scale:e.scale??1,exclude:s,excludePredicates:c.length?c:null,excludeMode:l,filter:e.filter??null,filterMode:e.filterMode??`hide`,shouldExclude:e=>{if(!e||e.nodeType!==1)return!1;if(e.getAttribute(`data-capture`)===`exclude`)return!0;for(let t of Array.isArray(u.exclude)?u.exclude:[])try{if(e.matches(t))return!0}catch{}for(let t of Array.isArray(u.excludePredicates)?u.excludePredicates:[])try{if(t(e))return!0}catch{}if(typeof u.filter==`function`)try{if(!u.filter(e))return!0}catch{}return!1},placeholders:e.placeholders!==!1,captureSelection:e.captureSelection??!1,canvas:_(e.canvas,`canvas`)?e.canvas:null,embedFonts:e.embedFonts??`auto`,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],__iconMatchers:ma(e.iconFonts),localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:a,__styleShare:e.__styleShare,useProxy:typeof e.useProxy==`string`?e.useProxy:``,width:e.width??null,height:e.height??null,format:n,__explicitFormat:r,type:n,quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??([`jpeg`,`webp`].includes(n)?`#ffffff`:null),filename:e.filename??`snapDOM`,outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst,fast:e.fast===!1||e.fast===`auto`?e.fast:!0,engine:e.engine,invalidate:e.invalidate??!1,__pinned:e.__pinned===!0,clip:e.clip??null,compress:e.compress!==!1,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1};return u}H(),ut(),W();var Nl=`svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre`;function Pl(e){try{return e.matches?.(`dialog,[popover]`)||!!e.querySelector?.(`dialog,[popover]`)}catch{return!0}}var Fl=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function Il(e){if(e.__usesBackdropFilter!==void 0)return e.__usesBackdropFilter;let t=!1;for(let n of e.styleMap.values())if(Fl.test(n)){t=!0;break}return e.__usesBackdropFilter=t,t}function Ll(e,t){let n=t.has(`backdrop-filter`)||t.has(`-webkit-backdrop-filter`);if(!n&&(n=(e=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(e.getAttribute?.(`style`)||``))(e),!n))try{n=!!e.querySelector?.(`[style*="backdrop-filter" i]`)}catch{n=!0}if(!n)return!1;let r=[e];e.querySelectorAll&&r.push(...e.querySelectorAll(`*`));for(let e of r){let t=getComputedStyle(e),n=t.getPropertyValue(`backdrop-filter`)||t.getPropertyValue(`-webkit-backdrop-filter`);if(n&&n!==`none`)return!0}return!1}var Rl=/* @__PURE__ */ new WeakMap;function zl(e){let t=Dn(),n=Rl.get(e);if(n&&n.epoch===t)return n.leaky;let r=!1,i={budget:2e4},a=e=>{for(let t=0;t<e.length&&!r;t++){if(--i.budget<0){r=!0;return}let n=e[t],o=n.selectorText;if(o&&/[+~]|:has\(/.test(o)){r=!0;return}let s=n.style;if(s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes(`counter`))){r=!0;return}n.cssRules&&n.cssRules.length&&a(n.cssRules)}};try{for(let t of e.styleSheets){let e=null;try{e=t.cssRules}catch{r=!0}if(r)break;e&&a(e)}if(!r){let t=e.adoptedStyleSheets;if(Array.isArray(t))for(let e of t){if(r)break;try{a(e.cssRules)}catch{r=!0}}}}catch{r=!0}return Rl.set(e,{epoch:t,leaky:r}),r}var Bl=1/16;function Vl(e,t){if(e===t)return!0;if(!e.endsWith(`px`)||!t.endsWith(`px`))return!1;let n=parseFloat(e),r=parseFloat(t);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=Bl}var Hl=/* @__PURE__ */ new Map,Ul=[`width`,`height`,`min-width`,`min-height`];function Wl(e){let t=Hl.get(e);if(t===void 0){t=null;for(let n of Ul){let r=e.match(RegExp(`(?:^|;)`+n+`:([^;]+)`));r&&r[1].endsWith(`px`)&&((t||={})[n]=r[1])}Hl.size>5e3&&Hl.clear(),Hl.set(e,t)}return t}function Gl(e){if(e.classList&&e.classList.length)for(let t of Array.from(e.classList))/^c\d+$/.test(t)&&e.classList.remove(t)}function Kl(e,t){let n=[e];for(;n.length;){let e=n.pop();if(e.nodeType===1){let n=t.nodeMap.get(e);n!==void 0&&(t.nodeMap.delete(e),t.srcToClone.get(n)===e&&t.srcToClone.delete(n)),t.styleMap.delete(e)}for(let t=e.firstChild;t;t=t.nextSibling)n.push(t)}}var ql={attempts:0,served:0,reconciled:0};async function Jl(e,t,n){ql.attempts++;try{let r=await Yl(e,t,n);return r&&ql.served++,r}catch{return null}}async function Yl(e,t,n){let r=t.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||e.scrollTop||e.scrollLeft||Pl(e)||Il(r)||r.fontsCSS||Bc(n))return null;for(let e of n.plugins||[])if(e&&(typeof e.beforeSnap==`function`||typeof e.beforeClone==`function`||typeof e.resolveNode==`function`||typeof e.afterClone==`function`))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes(`::marker`)||r.classPrefixCSS.includes(`::first-line`))||n.excludeMode===`remove`)return null;let i=e.ownerDocument||document,a=cr(e);if(!a||zl(i))return null;let o=[];t:for(let n of t.dirtyRoots){if(!n.isConnected||n===e||!e.contains(n))return null;for(let r of t.dirtyRoots)if(r!==n&&r!==e&&r.contains(n))continue t;o.push(n)}if(!o.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let t of o){if(t.parentElement===e||t.matches?.(Nl)||t.querySelector?.(Nl)||Ll(t,a))return null;let i=r.srcToClone.get(t);if(!i||!i.parentNode)return null;let o=/* @__PURE__ */ new Map,s={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:o,options:n},c=pc(t,null),l=Bo(t),u;try{u=await na(t,s,n)}finally{l(),c()}if(!u||u.nodeType!==1||u.querySelector?.(`style[data-sd]`)||(await Po(t,u,s,n),s.__pseudoCSS))return null;await Fi(u,s),Cs(u);try{await wa(u,t,o)}catch{}if(await Promise.all([Js(u,n),rc(t,u,r.styleCache,n,o)]),n.compress)try{await wl(u,n,o)}catch{}for(let[e,t]of o.entries())Ws(e,t);i.replaceWith(u),Kl(i,r);for(let[e,t]of o.entries())r.nodeMap.set(e,t),r.srcToClone.set(t,e)}let s={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[e,t]of r.nodeMap.entries()){if(!t||t.nodeType!==1||!t.isConnected)continue;let i=r.styleMap.get(e);if(!i)continue;let a=Wl(i);if(!a)continue;let o=null,c=!1;for(let e in a)if(o||=getComputedStyle(t),!Vl(o.getPropertyValue(e),a[e])){c=!0;break}if(c){if(n.__compressedAssets?.has(e))return null;ql.reconciled++,await J(t,e,s,n)}}let c=Ie(r.styleMap);for(let[e,t]of r.styleMap.entries())Gl(e),Us(e,t,c);let l=(r.classPrefixCSS||``)+Array.from(c.entries()).map(([e,t])=>`.${t}{${e}}`).join(``);qc(r.clone,n.__compressedAssets);let u=await Dl({element:e,options:n,plugins:n.plugins,clone:r.clone,classCSS:l,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||``});return n.__compressedSnapshot=Kc(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,u}E();var Xl=/* @__PURE__ */ new WeakMap,Zl=/* @__PURE__ */ new WeakMap,Ql=/* @__PURE__ */ new WeakSet,$l=/* @__PURE__ */ new WeakMap,eu=64,tu=/* @__PURE__ */ new Map,nu=[`scroll`,`input`,`change`,`focusin`,`focusout`,`pointerdown`,`pointerup`,`pointercancel`,`keydown`,`keyup`,`beforetoggle`,`toggle`],ru=[`(prefers-color-scheme: dark)`,`(prefers-reduced-motion: reduce)`,`(prefers-contrast: more)`,`(forced-colors: active)`,`(inverted-colors: inverted)`,`(prefers-reduced-transparency: reduce)`,`(hover: hover)`,`(any-hover: hover)`,`(pointer: coarse)`,`(any-pointer: coarse)`,`(color-gamut: p3)`,`(dynamic-range: high)`];function iu(e){let t=e?.defaultView;return typeof t?.matchMedia==`function`?ru.map(e=>{try{return t.matchMedia(e).matches?`1`:`0`}catch{return`?`}}).join(``):``}function au(e){let t=[];for(let n=e;n;){try{let e=n.getBoundingClientRect();t.push(e.x,e.y,e.width,e.height)}catch{t.push(`?`)}n=n.parentElement?n.parentElement:n.getRootNode?.()?.host||null}return t.join(`|`)}function ou(e,t){if(t.disposed||(tu.delete(e),tu.set(e,t),tu.size<=eu))return;let[n,r]=tu.entries().next().value;su(n,r)}function su(e,t){t.disposed=!0,tu.delete(e),Xl.delete(e);for(let e of t.observers)try{e.disconnect()}catch{}for(let n of nu)e.removeEventListener(n,t.onMediaDirty,!0);for(let e of t.trackedShadowRoots.keys())for(let n of uu)e.removeEventListener(n,t.onMediaDirty,!0);for(let[e,n]of t.trackedImages)e.removeEventListener(`load`,n),e.removeEventListener(`error`,n);t.trackedImages.clear(),t.trackedShadowRoots.clear(),t.images.length=0,t.controls.length=0,t.scrollNodes.length=0,t.observers.length=0,t.last=null,t.retained=null,t.retainedFrameDriven=!1}function cu(e){if(Ql.has(e))return!1;Zl.delete(e);let t=[e],n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e],a=[];i?.nodeType===1&&a.push(i);try{a.push(...i.querySelectorAll(`*`))}catch{return!1}for(let e of a){e.shadowRoot&&t.push(e.shadowRoot);let i=String(e.localName||e.tagName||``).toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(i)||i===`progress`&&!e.hasAttribute(`value`)||/^(?:animate|animatetransform|animatemotion|set)$/.test(i))return!1;let a=``;if(i===`img`){r.push(e);try{a=e.currentSrc||e.src||``}catch{}}/^(?:input|textarea|select|option)$/.test(i)&&n.push(e);let o=e.getAttribute?.(`style`)||``,s=$l.get(e);if(a||o){if((!s||s.src!==a||s.style!==o)&&(s={src:a,style:o,animated:yu(a)||yu(o)},$l.set(e,s)),s.animated)return!1}else s&&$l.delete(e)}}return Zl.set(e,{roots:t.slice(1),controls:n,images:r}),!0}function lu(e,t){if(!e.querySelectorAll)return!1;let n=Zl.get(e);Zl.delete(e);let r=new Set(n?.roots||[]);if(n&&(t.controls=n.controls,t.scannedImages=n.images),!n){let t=[e];for(let e=0;e<t.length;e++){let n=t[e];n.shadowRoot&&!r.has(n.shadowRoot)&&(r.add(n.shadowRoot),t.push(n.shadowRoot));for(let e of n.querySelectorAll(`*`))e.shadowRoot&&!r.has(e.shadowRoot)&&(r.add(e.shadowRoot),t.push(e.shadowRoot))}}for(let[e,n]of t.trackedShadowRoots)if(!r.has(e)){try{n.disconnect()}catch{}for(let n of uu)e.removeEventListener(n,t.onMediaDirty,!0);t.trackedShadowRoots.delete(e);let r=t.observers.indexOf(n);r>=0&&t.observers.splice(r,1)}for(let e of r)if(!t.trackedShadowRoots.has(e))try{let n=new MutationObserver(t.markDirty);n.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),n.__flush=t.markDirty,t.observers.push(n),t.trackedShadowRoots.set(e,n);for(let n of uu)e.addEventListener(n,t.onMediaDirty,{capture:!0,passive:!0});t.retained&&t.dirtyAll()}catch{}return!!n}var uu=[`scroll`,`change`,`beforetoggle`,`toggle`];function du(e,t){return[e,...t.trackedShadowRoots.keys()]}function fu(e,t){let n=t.scannedImages;if(t.scannedImages=null,!n){n=[],e.tagName===`IMG`&&n.push(e);for(let r of du(e,t))r.querySelectorAll&&n.push(...r.querySelectorAll(`img`))}if(t.images=n,t.trackedImages.size){let e=new Set(n);for(let[n,r]of t.trackedImages)e.has(n)||(n.removeEventListener(`load`,r),n.removeEventListener(`error`,r),t.trackedImages.delete(n))}for(let e of n){if(e.complete||t.trackedImages.has(e))continue;let n=()=>{t.capturing&&(t.torn=!0),t.dirty=!0,t.dirtyRoots=null,e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t.trackedImages.delete(e)};t.trackedImages.set(e,n),e.addEventListener(`load`,n),e.addEventListener(`error`,n)}}function pu(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let i of e)if(Sn(i)){if(i.type===`attributes`){let e=t.get(i.target);e||t.set(i.target,e=/* @__PURE__ */ new Map),e.has(i.attributeName)||e.set(i.attributeName,i.oldValue)}else if(i.type===`characterData`)n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type===`childList`){let e=r.get(i.target);e||r.set(i.target,e=/* @__PURE__ */ new Map);for(let t of i.addedNodes){if(t.nodeType!==3)return!0;e.set(t.data,(e.get(t.data)||0)+1)}for(let t of i.removedNodes){if(t.nodeType!==3)return!0;e.set(t.data,(e.get(t.data)||0)-1)}}else return!0}for(let[e,n]of t)for(let[t,r]of n)if(e.getAttribute(t)!==r)return!0;for(let[e,t]of n)if(e.data!==t)return!0;for(let e of r.values())for(let t of e.values())if(t!==0)return!0;return!1}var mu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,hu=e=>e&&(typeof e==`object`||typeof e==`function`)?Mu(e):`-`;function gu(e,t=131072){if(e=String(e||``).trim(),!/^data:/i.test(e))return``;let n=e.indexOf(`,`);if(n<0)return``;let r=e.slice(0,n),i=e.slice(n+1);try{if(/;base64/i.test(r)){let e=Math.ceil(t/3)*4;return atob(i.slice(0,e-e%4))}return i.slice(0,t*3).replace(/%([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).slice(0,t)}catch{return``}}function _u(e){let t=(e.match(/^data:([^;,]+)/i)?.[1]||``).toLowerCase();if(t===`image/gif`||t===`image/apng`)return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(t))return!1;let n=gu(e);return t===`image/png`?n.includes(`acTL`):t===`image/webp`?n.includes(`ANIM`)||n.includes(`ANMF`)||n.includes(`VP8X`)&&!!(n.charCodeAt(n.indexOf(`VP8X`)+8)&2):t===`image/avif`?n.includes(`avis`):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function vu(e){let t=String(e||``).trim();return t?mu.test(t)?!0:/^data:/i.test(t)?_u(t):!1:!1}function yu(e){let t=String(e||``);if(vu(t))return!0;for(let e of t.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(vu(e[1]??e[2]??e[3]))return!0;return!1}function bu(e,t=null){let n=e&&e.clone;if(!n)return!1;let r=t?t.map(t=>e.srcToClone?.get(t)).filter(Boolean):[n];for(let t of r)for(let n of xu(t))if(yu(n.getAttribute?.(`src`))||yu(n.getAttribute?.(`href`))||yu(n.getAttribute?.(`style`))||yu(e.styleMap?.get(n)))return!0;return!1}function xu(e){let t=[];e&&e.nodeType===1&&t.push(e);try{t.push(...e.querySelectorAll(`*`))}catch{}return t}function Su(e,t){let n=[],r=/* @__PURE__ */ new Set,i=e=>{e&&!r.has(e)&&(r.add(e),n.push(e))};e.matches?.(`input,textarea,select,option`)&&i(e);for(let n of du(e,t))try{for(let e of n.querySelectorAll(`input,textarea,select,option`))i(e)}catch{}t.controls=n}function Cu(e,t){let n=[],r=/* @__PURE__ */ new Set,i=(e,t=!1)=>{if(e&&!r.has(e)){r.add(e);try{(t||e.scrollLeft||e.scrollTop||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&n.push(e)}catch{}}};for(let t=e;t;t=t.parentElement)i(t,!0);for(let n of du(e,t))for(let e of xu(n))i(e);t.scrollNodes=n}function wu(e,t){let n=e.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||``,iu(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||``];try{i.push(...[...n.adoptedStyleSheets||[]].map(hu))}catch{}for(let e of t.trackedShadowRoots.keys())try{i.push(`#shadow`,...[...e.adoptedStyleSheets||[]].map(hu))}catch{}let a=n.activeElement,o=n.fullscreenElement;(a?.contains(e)||e.contains(a))&&i.push(hu(a)),(o?.contains(e)||e.contains(o))&&i.push(hu(o));let s=[r?.scrollX||0,r?.scrollY||0];for(let e of t.scrollNodes)s.push(e.scrollLeft||0,e.scrollTop||0);let c=[];for(let e of t.controls){let t=String(e.localName||``).toLowerCase();t===`input`?c.push(e.type,h(e)?e.value.length:e.value,+!!e.checked,+!!e.indeterminate):t===`textarea`?c.push(e.value):t===`select`?c.push(e.selectedIndex,e.value):c.push(+!!e.selected)}let l=[];for(let e of t.images){let t=``;try{t=e.currentSrc||e.src||``}catch{}l.push(t,+!!e.complete,e.naturalWidth||0,e.naturalHeight||0)}return{style:i.join(`|`),scroll:s.join(`|`),controls:c,images:l,frameDriven:t.retainedFrameDriven}}function Tu(e,t,n){if(!e)return!1;let r=e[n],i=t[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==i[e])return!1;return!0}function Eu(e,t){let n=/* @__PURE__ */ new Set;for(let r of du(e,t))try{let e=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let t of e)n.add(t)}catch{}return[...n]}function Du(e){return e.map(e=>[hu(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(`:`)).join(`|`)}function Ou(e,t,n){if(!n||n.nodeType!==1)return null;if(n===e||e.contains(n))return e;for(let e of t.trackedShadowRoots.keys())if(e.contains(n))return e;return null}function ku(e){let t={dirty:!0,pending:[],torn:!1,dirtyRoots:/* @__PURE__ */ new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:/* @__PURE__ */ new Map,trackedImages:/* @__PURE__ */ new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:En(),styleEpoch:Dn(),styleStamp:On(e),outsideMutations:Tn(e),geometry:null,renderState:null},n=()=>{t.dirty=!0,t.dirtyRoots=null},r=n=>{if(!t.dirtyRoots)return;let r=n&&(n.nodeType===1?n:n.parentElement);if(!r||r===e||!e.contains(r)||t.dirtyRoots.size>=12){t.dirtyRoots=null;return}t.dirtyRoots.add(r)},i=e=>{if(t.capturing){for(let n of e)t.pending.push(n);return}for(let n of e)Sn(n)&&(t.dirty=!0,r(n.target))},a=()=>{if(t.capturing){t.torn=!0;return}n()};t.dirtyAll=n;try{let n=new MutationObserver(i);n.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),n.__flush=i,t.observers.push(n)}catch{}t.markDirty=i,t.onMediaDirty=a;try{for(let t of nu)e.addEventListener(t,a,{capture:!0,passive:!0})}catch{}return lu(e,t)||Su(e,t),Cu(e,t),fu(e,t),t}var Au=0,ju=/* @__PURE__ */ new WeakMap;function Mu(e){let t=ju.get(e);return t||(t=`@`+ ++Au,ju.set(e,t)),t}function Nu(e,t){let n=typeof e;if(n===`undefined`)return null;if(e===null||n===`boolean`||n===`number`||n===`string`)return JSON.stringify(e);if(n===`function`||n===`symbol`)return n===`symbol`?null:JSON.stringify(Mu(e));if(n!==`object`)return null;if(typeof e.nodeType==`number`)return JSON.stringify(Mu(e));if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let n=[];for(let r of e){let e=Nu(r,t);if(e===null)return null;n.push(e)}return`[`+n.join(`,`)+`]`}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return JSON.stringify(Mu(e));let r=[];for(let n of Object.keys(e).sort()){let i=e[n];if(i===void 0)continue;let a=Nu(i,t);if(a===null)return null;r.push(JSON.stringify(n)+`:`+a)}return`{`+r.join(`,`)+`}`}finally{t.delete(e)}}function Pu(e,t){let{burst:n,invalidate:r,...i}=e||{};try{let e=Nu(i,/* @__PURE__ */ new Set);return e===null?null:`${(t||[]).map(hu).join(`,`)}:${e}`}catch{return null}}function Fu(e,t,n,r,i=null){let a=Xl.get(e);a||(a=ku(e),a.baselineSignature=Pu(t,n.plugins),Xl.set(e,a));let o=Pu(t,n.plugins),s=async()=>{if(a.disposed)return r();let t=o===null||o!==a.baselineSignature;t&&o!==null?a.pendingSig===o?(a.baselineSignature=o,a.last=null,a.dirty=!0,a.dirtyRoots=null,a.pendingSig=null,t=!1):a.pendingSig=o:a.pendingSig=null,lu(e,a),fu(e,a);for(let e of a.observers)e.__flush(e.takeRecords());$n();let s=Tn(e);a.dirty&&a.outsideMutations!==s&&a.dirtyAll(),a.outsideMutations=s;let c=e.getRootNode?.(),l=[...a.trackedShadowRoots.keys()];c?.nodeType===11&&!l.includes(c)&&l.push(c),Qn(e.ownerDocument||document,l);let u=On(e);a.styleStamp!==u&&(a.styleStamp=u,a.dirty||a.dirtyAll());let d=wu(e,a),f=Eu(e,a);d.animation=Du(f),a.renderState&&(!Tu(a.renderState,d,`style`)&&(kn(),a.dirtyAll()),Tu(a.renderState,d,`scroll`)||a.dirtyAll(),Tu(a.renderState,d,`controls`)||(er(e),a.dirtyAll()),!Tu(a.renderState,d,`images`)&&!a.dirty&&a.dirtyAll());let p=En();a.envEpoch!==p&&(a.dirtyAll(),a.envEpoch=p);let m=Dn();if(a.styleEpoch!==m&&(a.styleEpoch=m,!a.dirty)){let t=au(e);a.geometry!==null&&t!==a.geometry&&(er(e),a.dirtyAll()),a.geometry=t}n.invalidate&&a.dirtyAll();let h=!1,g=!!a.renderState&&!Tu(a.renderState,d,`animation`);try{let t=/* @__PURE__ */ new Set;g&&f.length===0&&(t=null);for(let n of f){let r=n.playState===`running`;if(!r&&!g)continue;r&&(h=!0),g=!0;let i=n.effect?.target;if(Ou(e,a,i)===e)t.add(i);else{t=null;break}}if(g&&t&&t.size&&a.retained){a.dirty=!0;for(let e of t)a.dirtyRoots&&a.dirtyRoots.add(e),er(e)}else g&&!t&&a.dirtyAll()}catch{}let _=d.frameDriven,v=h||_;if(v&&(a.last=null),_&&a.dirtyAll(),!t&&!v&&!a.dirty&&a.last)return ou(e,a),a.last;a.capturing=!0;let y=null;try{let o=null,c=!1,l=null;if(!t&&a.dirty&&a.retained&&a.dirtyRoots&&a.dirtyRoots.size&&i){l=[...a.dirtyRoots];let t=await Jl(e,a,n);t&&(o=await i(t),c=!0)}if(o||=(t||(n.__retain=e=>{let t=/* @__PURE__ */ new Map;for(let[n,r]of e.nodeMap.entries())t.set(r,n);y={...e,srcToClone:t}}),n.__tornSinceStart=()=>{for(let e of a.observers)for(let t of e.takeRecords())a.pending.push(t);return $n(),a.torn||pu(a.pending)||Tn(e)!==s},await r()),!t&&!a.disposed){a.dirty=!1,a.dirtyRoots=/* @__PURE__ */ new Set,y?(a.retained=y,a.retainedFrameDriven=bu(y),Su(e,a),Cu(e,a)):c&&(a.retainedFrameDriven||=bu(a.retained,l),Su(e,a),Cu(e,a));let t=wu(e,a);t.animation=Du(Eu(e,a));let n=[`style`,`scroll`,`controls`,`images`];h||n.push(`animation`);let r=n.every(e=>Tu(d,t,e));a.renderState=t,a.styleEpoch=Dn(),a.styleStamp=On(e),a.geometry=au(e),a.renderState.frameDriven?(Ql.add(e),su(e,a)):r?!v&&!a.renderState.frameDriven&&(a.last=o,ou(e,a)):(a.dirtyAll(),a.last=null)}return o}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let e of a.observers)for(let t of e.takeRecords())a.pending.push(t);$n();let t=Tn(e);(a.torn||pu(a.pending)||t!==s)&&(a.dirtyAll(),a.last=null),a.outsideMutations=t,a.styleEpoch=Dn(),a.styleStamp=On(e),a.pending.length=0,a.torn=!1,a.capturing=!1,a.disposed||(lu(e,a),fu(e,a))}},c=a.inflight.then(s,s);return a.inflight=c.catch(()=>{}),c}var Iu=null;function Lu(e){Iu=e}var Ru=`button, a[href], [role="button"], input, select, summary, label, [tabindex]`,zu=!1,Bu=null,Vu=/* @__PURE__ */ new WeakMap,Hu=!1;function Uu(e,t){!zu||!Bu||t&&t.burst===!1||Vu.set(Bu.control,{element:e,options:t&&typeof t==`object`?{...t}:t})}function Wu(e){let t={control:e};Bu=t,setTimeout(()=>{Bu===t&&(Bu=null)},0)}function Gu(e){let t=e.target,n=t&&(t.nodeType===1?t:t.parentElement);return n&&n.closest?n.closest(Ru):null}function Ku(e){if(e.type===`keydown`&&e.key!==`Enter`&&e.key!==` `)return;let t=Gu(e);t&&(Wu(t),Ju(e,!1))}function qu(e){let t=Gu(e);t&&Wu(t)}function Ju(e,t=!0){if(!Iu||document.visibilityState===`hidden`)return;let n=Gu(e);if(!n||e.type===`pointerenter`&&e.target!==n)return;let r=Vu.get(n);if(r){if(!r.element.isConnected){Vu.delete(n);return}Iu(r.element,r.options).catch(()=>{});return}t&&!Hu&&(Hu=!0,Iu(document.body,{clip:`viewport`,burst:!1}).catch(()=>{}))}function Yu(){if(zu||typeof document>`u`||typeof document.addEventListener!=`function`)return;zu=!0;let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Ku,e),document.addEventListener(`keydown`,Ku,e),document.addEventListener(`click`,qu,e),document.addEventListener(`pointerenter`,Ju,e),document.addEventListener(`focusin`,Ju,e)}z();function Xu(...e){return jc(...e),$}async function Zu(e,t){if(typeof e!=`string`||!e.trim())throw Error(`[snapdom.fromString] html string required`);let n=document.createElement(`div`);R(n),n.style.cssText=`position:fixed;left:-99999px;top:0;pointer-events:none;`,n.innerHTML=e,document.body.appendChild(n);try{await nt();let e=Array.from(n.childNodes).some(e=>e.nodeType===3&&e.textContent.trim());return await td(n.children.length===1&&!e?n.firstElementChild:n,{...t||{},burst:!1})}finally{n.remove()}}var $=Object.assign(td,{plugins:Xu,fromString:Zu,version:`3.2.0`,preCapture:Yu});Lu(td);var Qu=Symbol(`snapdom.internal`),$u=Symbol(`snapdom.internal.silent`),ed=/* @__PURE__ */ new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]);async function td(e,t){if(!e)throw Error(`Element cannot be null or undefined`);let n=Ml(t);n.element=e,n.invalidate&&kn(),Lc(n,t&&t.plugins);let{stage:r,loweredBy:i}=Ec(n);n.needs=r,n.__needsLoweredBy=i;let a=Dc(r,`render`),o=n.burst===!0||!Bc(n),s=typeof n.filter==`function`||!!n.excludePredicates||typeof n.excludeStyleProps==`function`||typeof n.fallbackURL==`function`,c=a&&!n.captureSelection&&n.burst!==!1&&o&&!s&&cu(e);return c&&Uu(e,t),n.snap||={toPng:(e,t)=>$.toPng(e,t),toSvg:(e,t)=>$.toSvg(e,t)},c?Fu(e,t,n,()=>$.capture(e,n,Qu),e=>nd(e,n)):$.capture(e,n,Qu)}$.capture=async(e,t,n)=>{if(n!==Qu)throw Error(`[snapdom.capture] is internal. Use snapdom(...) instead.`);if(Dc(t.needs||`render`,`render`)&&V()){if(t.embedFonts)try{let n=e.ownerDocument||document,r=/* @__PURE__ */ new Set;if(t.embedFonts===`auto`){try{for(let e of n.fonts)r.add(String(e.family).replace(/["']/g,``).toLowerCase())}catch{}if(r.size===0)throw null}let i=io(e);t.clip||(t.__fontUsage=i);let a=i.required,o=new Set([...a].map(e=>String(e).split(`__`)[0]).filter(Boolean));if(t.embedFonts===`auto`&&(o=new Set([...o].filter(e=>r.has(e.toLowerCase()))),o.size===0))throw null;await ao(o,1,n)}catch{}let n=Array.from(e.querySelectorAll(`canvas`));e.tagName===`CANVAS`&&n.unshift(e);for(let e of n)try{if(ia(e))continue;let t=e.getContext(`2d`,{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){U(t,`safari canvas poke failed`,e)}}return nd(await Al(e,t),t)};async function nd(e,t){let n=t.needs||`render`,r=Dc(n,`render`),i=e=>Oc(n,t.__needsLoweredBy||[],e),a=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement?e:null,o=a?null:e,s=()=>o??=a.toDataURL(),c=a||e;a&&(e=``);let l=t.__compressedSnapshot,u=t.__compressionDensity;delete t.__compressedSnapshot,delete t.__compressedAssets;let d,f=t.meta||{},p=(Number.isFinite(t.width)||Number.isFinite(t.height))&&!V(),m=p?Number.isFinite(t.width)?f.targetW/f.vbW:f.targetH/f.vbH:1,h=p?Number.isFinite(t.height)?f.targetH/f.vbH:f.targetW/f.vbW:1,g=e=>{if(a||!l?.size)return c;let t=f.vbW,n=f.vbH,r=e.crop;r&&(t=Math.max(1,Math.min(t,r.x+r.width)-Math.max(0,r.x)),n=Math.max(1,Math.min(n,r.y+r.height)-Math.max(0,r.y)));let i=Number.isFinite(e.width),o=Number.isFinite(e.height);return(i&&o?Math.max(e.width/t,e.height/n):i?e.width/t*(r?Math.max(1,h/m):1):o?e.height/n*(r?Math.max(1,m/h):1):(e.scale||1)*Math.max(m,h))*(e.dpr||1)<=u?c:d??=Jc(s(),l)},_=async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Xt(),Jt));return n(c,{...e,...t||{},format:`png`})},v=()=>{if(!r)throw i(`svgString`);if(a)throw Error(`[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG`);let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``},y=e=>Object.defineProperty({...e||{},svgString:v},"url",r?{get:s,enumerable:!0}:{get(){throw i(`export.url`)},enumerable:!1,configurable:!0}),b={img:async(e,t)=>{if(a)return _(e,t);let{toImg:n}=await Promise.resolve().then(()=>($t(),Zt)),r={...e,...t||{}};return n(g(r),r)},svg:async(e,t)=>{if(a)return _(e,t);let{toSvg:n}=await Promise.resolve().then(()=>($t(),Zt)),r={...e,...t||{}};return n(g(r),r)},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(qt(),dt)),r={...e,...t||{}};return n(g(r),r)},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(un(),cn)),r={...e,...t||{}};return n(g(r),r)},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Xt(),Jt)),r={...e,...t||{},format:`png`};return n(g(r),r)},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Xt(),Jt)),r={...e,...t||{},format:`jpeg`};return n(g(r),r)},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(Xt(),Jt)),r={...e,...t||{},format:`webp`};return n(g(r),r)},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(mn(),dn)),r={...e,...t||{}};return n(g(r),r)}};if(!r)for(let e of Object.keys(b)){let t=e===`download`?`download()`:`to${e.charAt(0).toUpperCase()}${e.slice(1)}()`;b[e]=async()=>{throw i(t)}}let x={};for(let e of[`img`,`svg`,`canvas`,`blob`,`png`,`jpeg`,`webp`])x[e]=async n=>b[e](t,{...E(e,n||{}),[$u]:!0});x.jpg=x.jpeg;let S=e=>Object.defineProperty({...t,...e},"options",{value:t,configurable:!0}),C=await Pc(`defineExports`,S({artifacts:t.__artifacts||null,export:y(),exports:x})),w=Object.assign({},...C.filter(e=>e&&typeof e==`object`).reverse()),T={...b,...w};T.jpeg&&!T.jpg&&(T.jpg=(e,t)=>T.jpeg(e,t));function E(e,n){let r=n||{},i={...t,...r},o=typeof r.type==`string`?r.type.toLowerCase():``,s=typeof r.format==`string`?r.format.toLowerCase():ed.has(o)?o:``;return s&&(i.format=s===`jpg`?`jpeg`:s),i.__explicitFormat=s?i.format:t.__explicitFormat??null,e===`blob`&&!i.__explicitFormat&&(i.format=a?`png`:`svg`),i.type=i.format,[e,i.format,o].map(e=>typeof e==`string`?e.toLowerCase():``).find(e=>e===`jpeg`||e===`jpg`||e===`webp`)&&(i.backgroundColor==null||i.backgroundColor===`transparent`)&&(i.backgroundColor=`#ffffff`),i.scale!==1&&(Number.isFinite(i.width)||Number.isFinite(i.height))&&U(i,`scale ignored: width/height sets output size`),i}let D=!1,O=Promise.resolve();async function k(e,n){let r=Object.freeze(n&&typeof n==`object`?{...n}:{}),i=O.then(async()=>{let n=T[e];if(!n)throw Error(`[snapdom] Unknown export type: ${e}`);let i=E(e,r),a=S({artifacts:t.__artifacts||null,export:y({type:e,options:i,requestedOptions:r})}),o=i.format,s=i.type;await Pc(`beforeExport`,a,{format:e,options:i});let c=i.format===o?i.type===s?``:i.type:i.format,l=typeof c==`string`?c.toLowerCase():``;ed.has(l)&&(i.format=l===`jpg`?`jpeg`:l,i.type=i.format,i.__explicitFormat=i.format,/^(?:jpeg|webp)$/.test(i.format)&&(i.backgroundColor==null||i.backgroundColor===`transparent`)&&(i.backgroundColor=`#ffffff`));let u=await n(a,i);return await Pc(`afterExport`,a,{format:e,options:i,result:u}),D||(D=!0,await Nc(`afterSnap`,t)),u});return O=i.catch(()=>{}),i}let A={url:e,needs:n,warnings:t.__session&&t.__session.warnings||[],toRaw:()=>{if(!r)throw i(`toRaw()`);return s()},to:(e,t)=>k(e,t),toImg:e=>k(`img`,e),toSvg:e=>k(`svg`,e),toCanvas:e=>k(`canvas`,e),toBlob:e=>k(`blob`,e),toPng:e=>k(`png`,e),toJpg:e=>k(`jpg`,e),toWebp:e=>k(`webp`,e),download:e=>k(`download`,e)};r?a&&Object.defineProperty(A,"url",{get:s,enumerable:!0,configurable:!0}):Object.defineProperty(A,"url",{get(){throw i(`url`)},enumerable:!1,configurable:!0}),Object.defineProperty(A,"meta",r?{value:t.meta,enumerable:!0}:{get(){throw i(`meta`)},enumerable:!1,configurable:!0});for(let e of Object.keys(T)){let t=`to`+e.charAt(0).toUpperCase()+e.slice(1);A[t]||(A[t]=t=>k(e,t))}return A}$.toRaw=(e,t)=>$(e,t).then(e=>e.toRaw()),$.toImg=(e,t)=>$(e,t).then(e=>e.toImg()),$.toSvg=(e,t)=>$(e,t).then(e=>e.toSvg()),$.toCanvas=(e,t)=>$(e,t).then(e=>e.toCanvas()),$.toBlob=(e,t)=>$(e,t).then(e=>e.toBlob()),$.toPng=(e,t)=>$(e,{...t,format:`png`}).then(e=>e.toPng()),$.toJpg=(e,t)=>$(e,{...t,format:`jpeg`}).then(e=>e.toJpg()),$.toWebp=(e,t)=>$(e,{...t,format:`webp`}).then(e=>e.toWebp()),$.download=(e,t)=>$(e,t).then(e=>e.download());export{$ as snapdom};
|