customer-chat-sdk 1.0.35 → 1.0.36
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/customer-sdk.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","html2canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CustomerSDK={},t.html2canvas)}(this,function(t,e){"use strict";class n{constructor(t){this.iconElement=null,this.badgeElement=null,this.onClickCallback=null,this.notificationCallback=null,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.iconStartX=0,this.iconStartY=0,this.dragMoveHandler=null,this.dragEndHandler=null,this.iconPosition=null,this.iconPosition=t||null}async show(){if(this.iconElement)return;this.iconElement=document.createElement("div"),this.iconElement.className="customer-sdk-icon";const t={position:"fixed",width:"30px",height:"30px",backgroundColor:"transparent",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:"999999",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",userSelect:"none",transition:"transform 0.2s ease",border:"none",outline:"none",overflow:"visible"};this.iconPosition?(void 0!==this.iconPosition.x?(t.left="number"==typeof this.iconPosition.x?`${this.iconPosition.x}px`:this.iconPosition.x,t.right="auto"):t.right="20px",void 0!==this.iconPosition.y?(t.top="number"==typeof this.iconPosition.y?`${this.iconPosition.y}px`:this.iconPosition.y,t.bottom="auto"):t.bottom="80px"):(t.bottom="80px",t.right="20px"),Object.assign(this.iconElement.style,t);const e=document.createElement("img");e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAArKSURBVHgB7Z1NbFTXFcf/93mwaGyEabLoIgFTqWRFMZUitSoIu80ial01SFWrKgsGKXYpWdRtFilRK4xUgbKICosmCKIySKCo2UAE6i61XVroDuOoi2YT02RZVFNwQTAzN+e8N88ej9+8j5n3ce5wf5JhPvyY4f3f/9xzz73vXoUeYKish6oljCiFYQ2MaAebVR3D/Jzf1xpDUPTTggIW6feXoOlH0Q9wS9exRK/Pl6qYX6qoJRiOgoEMvqpHWUjlYJ9iQeEJmTb07y6y2CT6HP99/z01C8MwQmB26OMSyuTIH9LTkSA35oLn9FmKCB/WHmP2YUUtQjhiBV4jqsIoJKJJbOC8ZLHFCczhl75UWXvCFuPUDiBXV5TGeWlhXIzALCx9m6Ni3RqfeRL71PJZVYEAChfYdayDc1klSkXBCRr9caxooQsTuIccG4qbiddxsKjQnbvAlDwNVzfgXK8L2wq30ZSMHcs7GctV4IFX9ZTyXGtM8pQq2i2qnCQ3H0NO5CLwk+radnDYrj3CWB5udpAx7FoS96YVdxVy1XCJzgmfG2RMZg5268P9FI6BzP8TRlN3Q/YvkRGZCOyG5H5cApcVLZFkGbJTF3igrEccErfX+rVZk5XIqbbBmyb1y2oDZqy4yfHbZT6HSJHUHDwwqQ/QP1aBpWvIIOXlM+o8UiAVga246ZOWyF0LbMXNjjRE7kpgbi/oS1yCJTNIoP33zqjL6JCOBW5Up24+sWXHvKDyJplojEal5tEBHWXRLG6tHzNW3BxQ7oTBSxvpnKMDOhKYxbVdofxwu1BUW+DqIBKSWODBSf17K24hjFRLbuk3EYkEbhTHbW25KBxMJR2giJ1k2aRKCJR0VR9jd9ySZmwH26RKCKRBicfWYxJLYGp3j9p2VxA0th43VEeGaBuahRIzVEc6uFbCtBVXIDFDdaiDBw/pUdSp7bXIpY6xsCm5oQ5W9fiNuaUgVHjfuK2DN01ovj/IaIE3PwVs/TL9PEOPv7T2vX/fAe7+H/j4c5hPiItLbQ9SyasmRcOCvvJN4OvPAXueB7Y9He+4a/8CFkjoq1TO/9snMA7tuEbcHvReoINNc++eHcCb48De59E1t+94gp+46rncGNq4OFBg6vfehAEzIl/5FnDkB/GdmpQL1w0SWmP2/lk11vryOoFNyJx3Pgu89eN0HBuHP3zkCc1ttmgCXLwui1ZVlCGYw98Brv82P3GZ174L/P031LY/C9FQs3qg9bU1Dm5MWP8UAuEE6v1D+QobxPErnptFQtWt0mNsb14daI2Daxtk3j+09WnPQUWLy7xJbf6RcciEqlu8rknzS2sEpnT7AITB4v759ewSqU6QLHJjJaLV5/4DieFZorjNSA3XpUfY4ofpFQdLDM/vH5YrLsNO5qRPGs1hekVgGu9N9Z6YbuEQKD1rZVjkrcIuwuYw3dwG74MQ+ITxiTMBN7s/DGmsFKlcgd3ihqAxX253TYIjjahQTVq6qxihIbCuyilLcvlRcrvbDo447GYp6IaLXYGVoPUzjhgSmlthcSW52NfUF3gXBGCqe324pCnFxbqhqcO3Q0iZMckCm4w/Hi0Bvt2FtXWqG2W0v5w5SyhFdsv4boiBV8F3pCRYe3egJ+D/h6AwPewoR0b3yPTw3Mzer0EEvN2BQ/m0CAfzPKpeYY+QpoY3J3Eoj96Mgtn5nKw+ZLdI6QmoOraXoIsP0a1TWoPg6TLv/AW4/R/v9zmZSdJuv/MRsPCZd+xrL8avH/PnXryR7NidQqIRtcHbSkpjiy543feoK54nvX3vbW/Gow+LHWdclgXiYxc+T35su8996yfhRQ1JfXmHVUbBRDmCx11v3wl+fSFi4vobHwT/Dh977ZPOPveNP0VPwJPQ5JB5hzJfTjgNrt5q/x7PYQ7j48/av7cQ8l7U5164gVDiNDuZowwROIwoJy096PzYXkCEwFEnOmzgPyrRGt/V+bGhnxvRFZIyWV6GwA/C33+3HNxOc6ITdaIPv9j5se0+15TZJkxf/zempyhWb0SBbHsG+NEL7d8fooRlfGTV6Tu+4g0rvv4SIknz2Be+CvzqJW/UKAxu2//4V4hAbZrQi0Vn0uySfx5Hz8B3Kf70XRQOLzIuIkT79+r2ClHZeV5QN2nJoXqliLnQ1wy8L7cdgu4xvuuQyrchgKj+rClwJBJ0sZKDNURsY37xH+gJrna06G9GKMw7vHU5BCDsyu+YizcgBl1nB/dhEUI4cQVGw8mipIuUzeuUHspwMMMnx6h1MVo4LuwCLVVJYL4LTUqixRyqwEj4whQVnqkPzNo6jSeiXGxiWyzNvWRadyzME1hjFoL4ecWswsfF67Lcy/iaenc2lOQ4mOFB9uNS18FogUOzxJvA/d7RymSdwQn9X2mryp4uy55Oy1Hm278LnvVRKFTbuH9WbeGHq7VoR5aLmXbTbaTw6w8Eiusx5z9YvcO/hg8hjKAJc1LgPOGCsHbXh5LmlZ3SVgTeUJW5/6AvspQSIH8fyeIytb7VpHlFYHdVFiUrm/bhk8rhuujM2p9GK1lcsu/cw9Ory/yvXSdLYJhm/OWUipyKyhGEEyrJOQGjW3aCXSOwG6aFjC75FL1Wlu9anqGxZEDfvDk8M2sEdsuWSo6LixSXmwPu37JrTamsaYVKc3hm1q34rh1ycb34JQ2LEJdF5RB84oqZ5VJVw7rNpIMXBP+ZnqFQPYqCyEtc7sNyCOa7H1hQnmpjQhgORGOeihvr1hcI3rNB4ViRAv/vAfD9t5EpQgsUHUPJ1amg19vvujKpP7Xb2ZkBDw0un1GBm3K0nTZLbfFBWMxAU8RtQ/jOZwW3xZZowtzLhE98V+2vDIsMVD080oYKfP+0mpVavrR4/d6wfQuZyFtXSoquEGHVLQvcMd9ajAgbKfASVUa0DdXy0DjVWrUKIvbyKzbhkkNUYtVM7LsLbagWAodmB2Nxfz22wDZUy0BTnzdOaPZJdH8whYWTHPthKQY698vvkQYJSLwEGq9BXO13N68UvztpL5Gk3W0m8R3+PGZccrCfroxFWHKBxU3S7jbT8SKGAxN6hA6ekTaXuuegpKrah91J2t1mOl6jY/msmlfKDkhkDZ/jTsVlulqE5d4ZdVlpK3JWUMZ8kM8xuiCVdWY3TegydaHOwZIaLC5FyQq6JLWFhK3I6ZGWuExq62Tdoy9EV8t+W+3qAjp3fA7TEpdJfSnwoUN6uFbHjJ3ukwzuCtEfLG6qN+mkvtIdlzT7qM9m+8mJmOd+btriMpksZeiK/Ai7bVkzBnSOSk9hrJuuUBiZ79YwMKmnqCt11BZEWqD2lgcOktaWk5LLdhy2XV7HXNVBOSvXNpPrfiuDk3qartxfPLFuzsm1zeS+oU7DzdPk5sLvf8qZ3FzbTGE7JvG28qqOc09A2J6jVHbanaFaAAVvieVVwOhbHO01oblfqxwcLEpYn8IF9mmUOqfooYjdyLugUMe2IkZgn0boLhvVRnPy5OAyDe2dlyKsjziBfdxkrIZRcnWZnu6DTOZ0HZc3DKKydFKJrMGLFbiZFbGBl8FiF9XN4oEUhVvSRW3GCIFb4TDOW9NTSByln11ZJWi8zDKvxMsLe/J6ntLCbxyMFLiVoSk9VH2IEVd03rKedzX3XD7EO3AG7gvlDc3ddR8qLLpZr6LX6iRoHxZLGzFvgkOj+ALBlx6CtCZy6AAAAABJRU5ErkJggg==",e.style.width="100%",e.style.height="100%",e.style.objectFit="cover",e.style.display="block",e.alt="Customer Service",e.onload=()=>{this.iconElement&&(e.style.opacity="1",e.style.visibility="visible")},e.onerror=t=>{},e.style.opacity="1",e.style.visibility="visible";const n=document.createElement("div");Object.assign(n.style,{width:"100%",height:"100%",borderRadius:"50%",overflow:"hidden",position:"relative"}),n.appendChild(e),this.iconElement.appendChild(n),this.setupDragEvents(),document.body.appendChild(this.iconElement)}forceCleanupDragEvents(){if(this.dragMoveHandler)try{document.removeEventListener("mousemove",this.dragMoveHandler),document.removeEventListener("touchmove",this.dragMoveHandler)}catch(t){}if(this.dragEndHandler)try{document.removeEventListener("mouseup",this.dragEndHandler),document.removeEventListener("touchend",this.dragEndHandler)}catch(t){}this.isDragging=!1,this.iconElement&&(this.iconElement.style.transition="transform 0.2s ease",this.iconElement.style.cursor="pointer")}hide(){this.forceCleanupDragEvents(),this.iconElement&&(this.iconElement.remove(),this.iconElement=null,this.onClickCallback=null,this.dragMoveHandler=null,this.dragEndHandler=null)}setPosition(t){}setIconPosition(t){if(this.iconPosition=t,this.iconElement){void 0!==t.x&&(this.iconElement.style.left="number"==typeof t.x?`${t.x}px`:t.x,this.iconElement.style.right="auto"),void 0!==t.y&&(this.iconElement.style.top="number"==typeof t.y?`${t.y}px`:t.y,this.iconElement.style.bottom="auto");const e=this.iconElement.getBoundingClientRect();this.iconStartX=e.left,this.iconStartY=e.top}}setStyle(t){}onClick(t){this.onClickCallback=t}onNotification(t){this.notificationCallback=t}showNotification(t){if(!this.iconElement)return;const{showBadge:e=!0,badgeCount:n=0,badgeText:o="",pulse:i=!1}=t;(e||n>0)&&this.createBadge(n,o,i),this.notificationCallback&&this.notificationCallback({badgeCount:n,badgeText:o,pulse:i})}clearNotification(){this.badgeElement&&(this.badgeElement.remove(),this.badgeElement=null)}setupDragEvents(){this.iconElement&&(this.dragMoveHandler=this.handleDragMove.bind(this),this.dragEndHandler=this.handleDragEnd.bind(this),this.iconElement.addEventListener("mousedown",this.handleDragStart.bind(this)),this.iconElement.addEventListener("touchstart",this.handleDragStart.bind(this),{passive:!1}))}handleDragStart(t){if(!this.iconElement)return;if(t.target!==this.iconElement&&!this.iconElement.contains(t.target))return;t.preventDefault(),t.stopPropagation();const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY;this.isDragging=!1,this.dragStartX=e,this.dragStartY=n;const o=this.iconElement.getBoundingClientRect();this.iconStartX=o.left,this.iconStartY=o.top,this.iconElement.style.transition="none",this.iconElement.style.cursor="grabbing";const i=t=>{const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY,o=e-this.dragStartX,r=n-this.dragStartY;(Math.abs(o)>5||Math.abs(r)>5)&&(this.isDragging=!0,"touches"in t?document.removeEventListener("touchmove",i):document.removeEventListener("mousemove",i),this.dragMoveHandler&&this.dragEndHandler&&("touches"in t?(document.addEventListener("touchmove",this.dragMoveHandler,{passive:!1}),document.addEventListener("touchend",this.dragEndHandler)):(document.addEventListener("mousemove",this.dragMoveHandler),document.addEventListener("mouseup",this.dragEndHandler))))};"touches"in t?(document.addEventListener("touchmove",i,{passive:!1}),document.addEventListener("touchend",this.dragEndHandler)):(document.addEventListener("mousemove",i),document.addEventListener("mouseup",this.dragEndHandler))}handleDragMove(t){if(!this.iconElement||!this.isDragging)return;const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY,o=t.target;if(o&&o!==this.iconElement&&!this.iconElement.contains(o)){if("IFRAME"===o.tagName||o.closest("iframe")||o.closest(".customer-sdk-container")||o.closest(".customer-sdk-overlay"))return void this.handleDragEnd()}const i=e-this.dragStartX,r=n-this.dragStartY,a=this.iconElement.getBoundingClientRect(),s=a.left+a.width/2,c=a.top+a.height/2;if(Math.sqrt(Math.pow(e-s,2)+Math.pow(n-c,2))>3*Math.max(a.width,a.height))return void this.handleDragEnd();t.preventDefault(),t.stopPropagation();const l=this.iconStartX+i,u=this.iconStartY+r,d=window.innerWidth-this.iconElement.offsetWidth,h=window.innerHeight-this.iconElement.offsetHeight,m=Math.max(0,Math.min(l,d)),f=Math.max(0,Math.min(u,h));this.iconElement.style.left=`${m}px`,this.iconElement.style.top=`${f}px`,this.iconElement.style.right="auto",this.iconElement.style.bottom="auto"}handleDragEnd(t){this.iconElement&&(this.dragMoveHandler&&(document.removeEventListener("mousemove",this.dragMoveHandler),document.removeEventListener("touchmove",this.dragMoveHandler)),this.dragEndHandler&&(document.removeEventListener("mouseup",this.dragEndHandler),document.removeEventListener("touchend",this.dragEndHandler)),this.iconElement.style.transition="transform 0.2s ease",this.iconElement.style.cursor="pointer",this.isDragging||this.handleClick(),this.isDragging=!1)}handleClick(){this.onClickCallback&&this.onClickCallback()}createBadge(t,e="",n=!1){this.clearNotification(),this.badgeElement=document.createElement("div"),this.badgeElement.className="customer-sdk-icon-badge",this.badgeElement.textContent=t>0?t>99?"99+":t.toString():e||"",Object.assign(this.badgeElement.style,{position:"absolute",top:"-4px",left:"-4px",right:"auto",minWidth:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ff4444",color:"#ffffff",fontSize:"10px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"1000001",boxShadow:"0 -1px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15)",...0===t&&""===e&&{width:"12px",height:"12px",minWidth:"12px",top:"-2px",left:"-2px"},...n&&{animation:"sdk-badge-pulse 1.5s infinite"}}),this.iconElement&&this.iconElement.appendChild(this.badgeElement)}}class o{constructor(t={}){this.iframeElement=null,this.overlayElement=null,this.containerElement=null,this.isOpen=!1,this.isCreated=!1,this.config={src:"",mode:"auto",width:400,height:600,allowClose:!0,...t},this.setupMessageListener()}async init(){try{this.createIframe(),this.isCreated=!0}catch(t){throw t}}show(){if(!this.isOpen){if(!this.isCreated)throw new Error("Iframe not initialized. Call init() first.");try{const t="popup"===this.getActualMode();t&&this.createOverlay(),this.containerElement&&(t?(Object.assign(this.containerElement.style,{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",visibility:"visible",opacity:"1",display:"block"}),this.overlayElement?.appendChild(this.containerElement)):(Object.assign(this.containerElement.style,{position:"fixed",visibility:"visible",opacity:"1",display:"block"}),this.preventBodyScroll(!0))),this.isOpen=!0}catch(t){}}}open(){this.show()}hide(){if(!this.isOpen)return;this.containerElement&&Object.assign(this.containerElement.style,{visibility:"hidden",opacity:"0",display:"none"}),this.overlayElement&&(this.overlayElement.remove(),this.overlayElement=null);"fullscreen"===this.getActualMode()&&this.preventBodyScroll(!1),this.isOpen=!1,this.config.onClose&&this.config.onClose()}close(){this.hide()}destroy(){this.hide(),this.containerElement&&(this.containerElement.remove(),this.containerElement=null,this.iframeElement=null),this.isCreated=!1}isIframeOpen(){return this.isOpen}sendToIframe(t){this.iframeElement&&this.iframeElement.contentWindow&&this.iframeElement.contentWindow.postMessage(t,"*")}createOverlay(){this.overlayElement=document.createElement("div"),this.overlayElement.className="customer-sdk-overlay",Object.assign(this.overlayElement.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"999998",display:"flex",alignItems:"center",justifyContent:"center",cursor:this.config.allowClose?"pointer":"default"}),this.config.allowClose&&this.overlayElement.addEventListener("click",t=>{t.target===this.overlayElement&&this.close()}),document.body.appendChild(this.overlayElement)}createIframe(){this.containerElement=document.createElement("div"),this.containerElement.className="customer-sdk-container",this.iframeElement=document.createElement("iframe"),this.iframeElement.className="customer-sdk-iframe",this.iframeElement.src=this.config.src||"",this.iframeElement.frameBorder="0",this.iframeElement.setAttribute("allow",["microphone","camera","geolocation","clipboard-read","clipboard-write","fullscreen","autoplay","encrypted-media"].join("; ")),this.iframeElement.setAttribute("sandbox",["allow-same-origin","allow-scripts","allow-forms","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-storage-access-by-user-activation"].join(" "));const t="popup"===this.getActualMode();this.iframeElement.scrolling=t?"auto":"no";const e={width:t?`${this.config.width}px`:"100%",height:t?`${this.config.height}px`:"100%",maxWidth:t?"450px":"100%",maxHeight:t?"700px":"100%",backgroundColor:"#ffffff",borderRadius:t?"12px":"12px 12px 0 0",boxShadow:t?"0 20px 40px rgba(0, 0, 0, 0.15)":"0 -4px 16px rgba(0, 0, 0, 0.25)",border:"none",position:"fixed",zIndex:"999999",...t?{top:"50%",left:"50%",transform:"translate(-50%, -50%)"}:{top:"0",left:"0",bottom:"0",right:"0",transform:"none",overflow:"hidden",position:"fixed"},visibility:"hidden",opacity:"0",display:"none"};Object.assign(this.containerElement.style,e);const n={width:"100%",height:"100%",border:"none",borderRadius:"inherit",...t?{}:{overflow:"hidden",scrollbarWidth:"none",msOverflowStyle:"none",WebkitScrollbar:"none"}};Object.assign(this.iframeElement.style,n),this.containerElement.appendChild(this.iframeElement),this.iframeElement.addEventListener("load",()=>{t||this.injectMobileStyles()}),document.body.appendChild(this.containerElement)}injectMobileStyles(){if(this.iframeElement)try{const t=this.iframeElement.contentDocument||this.iframeElement.contentWindow?.document;if(t){const e=t.createElement("style");e.textContent="\n /* 移动端iframe全屏样式优化 */\n * {\n -webkit-overflow-scrolling: touch !important;\n }\n \n body, html, #app, .container {\n overflow: auto !important;\n -webkit-overflow-scrolling: touch !important;\n }\n \n /* 隐藏所有滚动条 */\n ::-webkit-scrollbar {\n width: 0px !important;\n height: 0px !important;\n background: transparent !important;\n }\n \n /* Firefox */\n html {\n scrollbar-width: none !important;\n }\n \n /* IE/Edge */\n body {\n -ms-overflow-style: none !important;\n }\n \n /* 确保内容可以滚动 */\n body {\n overflow: auto !important;\n height: 100vh !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n ",t.head?.appendChild(e)}}catch(t){}}preventBodyScroll(t){if(t){const t=window.scrollY;Object.assign(document.body.style,{position:"fixed",top:`-${t}px`,width:"100%",overflow:"hidden"}),document.body.setAttribute("data-scroll-position",t.toString())}else{const t=parseInt(document.body.getAttribute("data-scroll-position")||"0");Object.assign(document.body.style,{position:"",top:"",width:"",overflow:""}),document.body.removeAttribute("data-scroll-position"),window.scrollTo(0,t)}}isMobileDevice(){return window.innerWidth<=768||/Android|iPhone|iPad|iPod|Opera Mini|IEMobile/i.test(navigator.userAgent)}getActualMode(){return"auto"===this.config.mode?this.isMobileDevice()?"fullscreen":"popup":this.config.mode}setupMessageListener(){window.addEventListener("message",t=>{this.config.src&&t.origin!==new URL(this.config.src).origin||this.handleIframeMessage(t.data)},!1)}handleIframeMessage(t){let e;if("string"==typeof t)e=t;else{if(!t||!t.type)return;e=t.type}switch(e){case"iframe_ready":break;case"close_iframe":case"close":this.close();break;case"resize_iframe":case"resize":t.width&&t.height&&this.resizeIframe(t.width,t.height);break;case"new-message":this.config.onMessage&&this.config.onMessage(e,t)}}resizeIframe(t,e){this.iframeElement&&(this.iframeElement.style.width=`${t}px`,this.iframeElement.style.height=`${e}px`)}}const i="p".charCodeAt(0),r="H".charCodeAt(0),a="Y".charCodeAt(0),s="s".charCodeAt(0);let c;function l(t){let e=-1;c||(c=function(){const t=new Int32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n}return t}());for(let n=0;n<t.length;n++)e=c[255&(e^t[n])]^e>>>8;return-1^e}function u(t,e,n=!1){const o=new Uint8Array(13);e*=39.3701,o[0]=i,o[1]=r,o[2]=a,o[3]=s,o[4]=e>>>24,o[5]=e>>>16,o[6]=e>>>8,o[7]=255&e,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;const c=l(o),u=new Uint8Array(4);if(u[0]=c>>>24,u[1]=c>>>16,u[2]=c>>>8,u[3]=255&c,n){const e=function(t){for(let e=t.length-1;e>=4;e--)if(9===t[e-4]&&t[e-3]===i&&t[e-2]===r&&t[e-1]===a&&t[e]===s)return e-3;return 0}(t);return t.set(o,e),t.set(u,e+13),t}{const e=new Uint8Array(4);e[0]=0,e[1]=0,e[2]=0,e[3]=9;const n=new Uint8Array(54);return n.set(t,0),n.set(e,33),n.set(o,37),n.set(u,50),n}}const d="undefined"!=typeof window,h=d&&"Worker"in window,m=d&&"atob"in window,f=d&&"btoa"in window,p=d?window.navigator?.userAgent:"",g=p.includes("Chrome"),y=p.includes("AppleWebKit")&&!g,w=p.includes("Firefox"),b=t=>1===t.nodeType,v=t=>"object"==typeof t.className,x=t=>"image"===t.tagName,S=t=>b(t)&&void 0!==t.style&&!v(t),C=t=>8===t.nodeType,E=t=>"IMG"===t.tagName,M=t=>"VIDEO"===t.tagName,k=t=>"SLOT"===t.tagName;function A(t){const e=t?.createElement?.("canvas");return e&&(e.height=e.width=1),Boolean(e)&&"toDataURL"in e&&Boolean(e.toDataURL("image/webp").includes("image/webp"))}const L=t=>t.startsWith("data:");function I(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(d&&t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;if(!d)return t;const n=R().implementation.createHTMLDocument(),o=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(i),e&&(o.href=e),i.href=t,i.href}function R(t){return(t&&b(t)?t?.ownerDocument:t)??window.document}const T="http://www.w3.org/2000/svg";const P=t=>function(t,e){return new Promise((n,o)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>o(i.error),i.onabort=()=>o(new Error(`Failed read blob to ${e}`)),i.readAsDataURL(t)})}(t,"dataUrl");function N(t,e){const n=R(e).createElement("img");return n.decoding="sync",n.loading="eager",n.src=t,n}function F(t,e){return new Promise(n=>{const{timeout:o,ownerDocument:i,onError:r,onWarn:a}=e??{},s="string"==typeof t?N(t,R(i)):t;let c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(o&&(c=setTimeout(u,o)),M(s)){const t=s.currentSrc||s.src;if(!t)return s.poster?F(s.poster,e).then(n):u();if(s.readyState>=2)return u();const o=u,i=e=>{a?.("Failed video load",t,e),r?.(e),u()};l=()=>{s.removeEventListener("loadeddata",o),s.removeEventListener("error",i)},s.addEventListener("loadeddata",o,{once:!0}),s.addEventListener("error",i,{once:!0})}else{const t=x(s)?s.href.baseVal:s.currentSrc||s.src;if(!t)return u();const e=async()=>{if(E(s)&&"decode"in s)try{await s.decode()}catch(e){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||t,e)}u()},n=e=>{a?.("Failed image load",s.dataset.originalSrc||t,e),u()};if(E(s)&&s.complete)return e();l=()=>{s.removeEventListener("load",e),s.removeEventListener("error",n)},s.addEventListener("load",e,{once:!0}),s.addEventListener("error",n,{once:!0})}})}const W=function(){let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)}();function D(t){return t?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function H(t){return{time:e=>t&&void 0,timeEnd:e=>t&&void 0,warn:(...e)=>t&&void 0}}async function $(t,e){return(n=t)&&"__CONTEXT__"in n?t:B(t,{...e,autoDestruct:!0});var n}async function B(t,e){const{scale:n=1,workerUrl:o,workerNumber:i=1}=e||{},r=Boolean(e?.debug),a=e?.features??!0,s=t.ownerDocument??(d?window.document:void 0),c=t.ownerDocument?.defaultView??(d?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:r,fetch:{requestInit:(m=e?.fetch?.bypassingCache,{cache:m?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:H(r),node:t,ownerDocument:s,ownerWindow:c,dpi:1===n?null:96*n,svgStyleElement:U(s),svgDefsElement:s?.createElementNS(T,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:h&&o&&i?i:0})].map(()=>{try{const t=new Worker(o);return t.onmessage=async t=>{const{url:e,result:n}=t.data;n?l.get(e)?.resolve?.(n):l.get(e)?.reject?.(new Error(`Error receiving message from worker: ${e}`))},t.onmessageerror=t=>{const{url:e}=t.data;l.get(e)?.reject?.(new Error(`Error receiving message from worker: ${e}`))},t}catch(t){return u.log.warn("Failed to new Worker",t),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[A(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:a,isEnable:t=>"restoreScrollPosition"===t?"boolean"!=typeof a&&(a[t]??!1):"boolean"==typeof a?a:a[t]??!0,shadowRoots:[]};var m;u.log.time("wait until load"),await async function(t,e){S(t)&&(E(t)||M(t)?await F(t,e):await Promise.all(["img","video"].flatMap(n=>Array.from(t.querySelectorAll(n)).map(t=>F(t,e)))))}(t,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:f,height:p}=function(t,e){let{width:n,height:o}=e;if(b(t)&&(!n||!o)){const e=t.getBoundingClientRect();n=n||e.width||Number(t.getAttribute("width"))||0,o=o||e.height||Number(t.getAttribute("height"))||0}return{width:n,height:o}}(t,u);return u.width=f,u.height=p,u}function U(t){if(!t)return;const e=t.createElement("style"),n=e.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return e.appendChild(n),e}async function V(t,e){const{log:n,timeout:o,drawImageCount:i,drawImageInterval:r}=e;n.time("image to canvas");const a=await F(t,{timeout:o,onWarn:e.log.warn}),{canvas:s,context2d:c}=function(t,e){const{width:n,height:o,scale:i,backgroundColor:r,maximumCanvasSize:a}=e,s=t.createElement("canvas");s.width=Math.floor(n*i),s.height=Math.floor(o*i),s.style.width=`${n}px`,s.style.height=`${o}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const c=s.getContext("2d");c&&r&&(c.fillStyle=r,c.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:c}}(t.ownerDocument,e),l=()=>{try{c?.drawImage(a,0,0,s.width,s.height)}catch(t){e.log.warn("Failed to drawImage",t)}};if(l(),e.isEnable("fixSvgXmlDecode"))for(let t=0;t<i;t++)await new Promise(e=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),e()},t+r)});return e.drawImageCount=0,n.timeEnd("image to canvas"),s}function O(t,e){if(t.ownerDocument)try{const e=t.toDataURL();if("data:,"!==e)return N(e,t.ownerDocument)}catch(t){e.log.warn("Failed to clone canvas",t)}const n=t.cloneNode(!1),o=t.getContext("2d"),i=n.getContext("2d");try{return o&&i&&i.putImageData(o.getImageData(0,0,t.width,t.height),0,0),n}catch(t){e.log.warn("Failed to clone canvas",t)}return n}function j(t,e){return(t=>"CANVAS"===t.tagName)(t)?O(t,e):(t=>"IFRAME"===t.tagName)(t)?function(t,e){try{if(t?.contentDocument?.body)return tt(t.contentDocument.body,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return t.cloneNode(!1)}(t,e):E(t)?function(t){const e=t.cloneNode(!1);return t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager"),e}(t):M(t)?async function(t,e){if(t.ownerDocument&&!t.currentSrc&&t.poster)return N(t.poster,t.ownerDocument);const n=t.cloneNode(!1);n.crossOrigin="anonymous",t.currentSrc&&t.currentSrc!==t.src&&(n.src=t.currentSrc);const o=n.ownerDocument;if(o){let i=!0;if(await F(n,{onError:()=>i=!1,onWarn:e.log.warn}),!i)return t.poster?N(t.poster,t.ownerDocument):n;n.currentTime=t.currentTime,await new Promise(t=>{n.addEventListener("seeked",t,{once:!0})});const r=o.createElement("canvas");r.width=t.offsetWidth,r.height=t.offsetHeight;try{const t=r.getContext("2d");t&&t.drawImage(n,0,0,r.width,r.height)}catch(o){return e.log.warn("Failed to clone video",o),t.poster?N(t.poster,t.ownerDocument):n}return O(r,e)}return n}(t,e):t.cloneNode(!1)}const z=["width","height","-webkit-text-fill-color"],X=["stroke","fill"];function Z(t,e,n){const{defaultComputedStyles:o}=n,i=t.nodeName.toLowerCase(),r=v(t)&&"svg"!==i,a=r?X.map(e=>[e,t.getAttribute(e)]).filter(([,t])=>null!==t):[],s=[r&&"svg",i,a.map((t,e)=>`${t}=${e}`).join(","),e].filter(Boolean).join(":");if(o.has(s))return o.get(s);const c=function(t){let e=t.sandbox;if(!e){const{ownerDocument:n}=t;try{n&&(e=n.createElement("iframe"),e.id=`__SANDBOX__${W()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",n.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',t.sandbox=e)}catch(e){t.log.warn("Failed to getSandBox",e)}}return e}(n),l=c?.contentWindow;if(!l)return new Map;const u=l?.document;let d,h;r?(d=u.createElementNS(T,"svg"),h=d.ownerDocument.createElementNS(d.namespaceURI,i),a.forEach(([t,e])=>{h.setAttributeNS(null,t,e)}),d.appendChild(h)):d=h=u.createElement(i),h.textContent=" ",u.body.appendChild(d);const m=l.getComputedStyle(h,e),f=new Map;for(let t=m.length,e=0;e<t;e++){const t=m.item(e);z.includes(t)||f.set(t,m.getPropertyValue(t))}return u.body.removeChild(d),o.set(s,f),f}function G(t,e,n){const o=new Map,i=[],r=new Map;if(n)for(const t of n)a(t);else for(let e=t.length,n=0;n<e;n++){a(t.item(n))}for(let t=i.length,e=0;e<t;e++)r.get(i[e])?.forEach((t,e)=>o.set(e,t));function a(n){const a=t.getPropertyValue(n),s=t.getPropertyPriority(n),c=n.lastIndexOf("-"),l=c>-1?n.substring(0,c):void 0;if(l){let t=r.get(l);t||(t=new Map,r.set(l,t)),t.set(n,[a,s])}(e.get(n)!==a||s)&&(l?i.push(l):o.set(n,[a,s]))}return o}const Y=[":before",":after"],_=[":-webkit-scrollbar",":-webkit-scrollbar-button",":-webkit-scrollbar-thumb",":-webkit-scrollbar-track",":-webkit-scrollbar-track-piece",":-webkit-scrollbar-corner",":-webkit-resizer"];const q=new Set(["symbol"]);async function J(t,e,n,o,i){if(b(n)&&((t=>"STYLE"===t.tagName)(n)||(t=>"SCRIPT"===t.tagName)(n)))return;if(o.filter&&!o.filter(n))return;q.has(e.nodeName)||q.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;const r=await tt(n,o,!1,i);o.isEnable("restoreScrollPosition")&&function(t,e){if(!S(t)||!S(e))return;const{scrollTop:n,scrollLeft:o}=t;if(!n&&!o)return;const{transform:i}=e.style,r=new DOMMatrix(i),{a:a,b:s,c:c,d:l}=r;r.a=1,r.b=0,r.c=0,r.d=1,r.translateSelf(-o,-n),r.a=a,r.b=s,r.c=c,r.d=l,e.style.transform=r.toString()}(t,r),e.appendChild(r)}async function Q(t,e,n,o){let i=t.firstChild;b(t)&&t.shadowRoot&&(i=t.shadowRoot?.firstChild,n.shadowRoots.push(t.shadowRoot));for(let r=i;r;r=r.nextSibling)if(!C(r))if(b(r)&&k(r)&&"function"==typeof r.assignedNodes){const i=r.assignedNodes();for(let r=0;r<i.length;r++)await J(t,e,i[r],n,o)}else await J(t,e,r,n,o)}const K=/^[\w-:]+$/;async function tt(t,e,n=!1,o){const{ownerDocument:i,ownerWindow:r,fontFamilies:a,onCloneEachNode:s}=e;if(i&&(t=>3===t.nodeType)(t))return o&&/\S/.test(t.data)&&o(t.data),i.createTextNode(t.data);if(i&&r&&b(t)&&(S(t)||v(t))){const o=await j(t,e);if(e.isEnable("removeAbnormalAttributes")){const t=o.getAttributeNames();for(let e=t.length,n=0;n<e;n++){const e=t[n];K.test(e)||o.removeAttribute(e)}}const i=e.currentNodeStyle=function(t,e,n,o){const{ownerWindow:i,includeStyleProperties:r,currentParentNodeStyle:a}=o,s=e.style,c=i.getComputedStyle(t),l=Z(t,null,o);a?.forEach((t,e)=>{l.delete(e)});const u=G(c,l,r);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&e.classList.add("______background-clip--text"),g&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||t.scrollWidth!==t.clientWidth||u.set("text-overflow",["clip",""]));for(let t=s.length,e=0;e<t;e++)s.removeProperty(s.item(e));return u.forEach(([t,e],n)=>{s.setProperty(n,t,e)}),u}(t,o,n,e);n&&function(t,e){const{backgroundColor:n,width:o,height:i,style:r}=e,a=t.style;if(n&&a.setProperty("background-color",n,"important"),o&&a.setProperty("width",`${o}px`,"important"),i&&a.setProperty("height",`${i}px`,"important"),r)for(const t in r)a[t]=r[t]}(o,e);let r=!1;if(e.isEnable("copyScrollbar")){const e=[i.get("overflow-x")?.[0],i.get("overflow-y")?.[0]];r=e.includes("scroll")||(e.includes("auto")||e.includes("overlay"))&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)}const c=i.get("text-transform")?.[0],l=D(i.get("font-family")?.[0]),u=l?t=>{"uppercase"===c?t=t.toUpperCase():"lowercase"===c?t=t.toLowerCase():"capitalize"===c&&(t=t[0].toUpperCase()+t.substring(1)),l.forEach(e=>{let n=a.get(e);n||a.set(e,n=new Set),t.split("").forEach(t=>n.add(t))})}:void 0;return function(t,e,n,o,i){const{ownerWindow:r,svgStyleElement:a,svgStyles:s,currentNodeStyle:c}=o;function l(n){const a=r.getComputedStyle(t,n);let l=a.getPropertyValue("content");if(!l||"none"===l)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,"");const u=[W()],d=Z(t,n,o);c?.forEach((t,e)=>{d.delete(e)});const h=G(a,d,o.includeStyleProperties);h.delete("content"),h.delete("-webkit-locale"),"text"===h.get("background-clip")?.[0]&&e.classList.add("______background-clip--text");const m=[`content: '${l}';`];if(h.forEach(([t,e],n)=>{m.push(`${n}: ${t}${e?" !important":""};`)}),1===m.length)return;try{e.className=[e.className,...u].join(" ")}catch(t){return void o.log.warn("Failed to copyPseudoClass",t)}const f=m.join("\n ");let p=s.get(f);p||(p=[],s.set(f,p)),p.push(`.${u[0]}:${n}`)}a&&r&&(Y.forEach(l),n&&_.forEach(l))}(t,o,r,e,u),function(t,e){((t=>"TEXTAREA"===t.tagName)(t)||(t=>"INPUT"===t.tagName)(t)||(t=>"SELECT"===t.tagName)(t))&&e.setAttribute("value",t.value)}(t,o),M(t)||await Q(t,o,e,u),await(s?.(o)),o}const c=t.cloneNode(!1);return await Q(t,c,e),await(s?.(c)),c}function et(t){if(t.ownerDocument=void 0,t.ownerWindow=void 0,t.svgStyleElement=void 0,t.svgDefsElement=void 0,t.svgStyles.clear(),t.defaultComputedStyles.clear(),t.sandbox){try{t.sandbox.remove()}catch(e){t.log.warn("Failed to destroyContext",e)}t.sandbox=void 0}t.workers=[],t.fontFamilies.clear(),t.fontCssTexts.clear(),t.requests.clear(),t.tasks=[],t.shadowRoots=[]}function nt(t,e){const{url:n,requestType:o="text",responseType:i="text",imageDom:r}=e;let a=n;const{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:h,placeholderImage:m},font:f,workers:p,fontFamilies:g}=t;"image"===o&&(y||w)&&t.drawImageCount++;let b=l.get(n);if(!b){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const e=o.startsWith("font")&&f&&f.minify,w=new Set;if(e){o.split(";")[1].split(",").forEach(t=>{g.has(t)&&g.get(t).forEach(t=>w.add(t))})}const v=e&&w.size,x={url:a,timeout:s,responseType:v?"arrayBuffer":i,headers:"image"===o?{accept:c}:void 0,...d};b={type:o,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(u&&"image"===o){const t=await u(n);if(t)return t}return!y&&n.startsWith("http")&&p.length?new Promise((t,e)=>{p[l.size&p.length-1].postMessage({rawUrl:n,...x}),b.resolve=t,b.reject=e}):function(t){const{url:e,timeout:n,responseType:o,...i}=t,r=new AbortController,a=n?setTimeout(()=>r.abort(),n):void 0;return fetch(e,{signal:r.signal,...i}).then(t=>{if(!t.ok)throw new Error("Failed fetch, not 2xx response",{cause:t});switch(o){case"arrayBuffer":return t.arrayBuffer();case"dataUrl":return t.blob().then(P);default:return t.text()}}).finally(()=>clearTimeout(a))}(x)})().catch(e=>{if(l.delete(n),"image"===o&&m)return t.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof m?m:m(r);throw e}),l.set(n,b)}return b.response}async function ot(t,e,n,o){if(!it(t))return t;for(const[i,r]of function(t,e){const n=[];return t.replace(rt,(t,o,i)=>(n.push([i,I(i,e)]),t)),n.filter(([t])=>!L(t))}(t,e))try{const e=await nt(n,{url:r,requestType:o?"image":"text",responseType:"dataUrl"});t=t.replace(at(i),`$1${e}$3`)}catch(t){n.log.warn("Failed to fetch css data url",i,t)}return t}function it(t){return/url\((['"]?)([^'"]+?)\1\)/.test(t)}const rt=/url\((['"]?)([^'"]+?)\1\)/g;function at(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}const st=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function ct(t,e){const{tasks:n}=e;b(t)&&((E(t)||x(t))&&n.push(...function(t,e){if(E(t)){const n=t.currentSrc||t.src;if(!L(n))return[nt(e,{url:n,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(e=>{e&&(t.srcset="",t.dataset.originalSrc=n,t.src=e||"")})];(y||w)&&e.drawImageCount++}else if(v(t)&&!L(t.href.baseVal)){const n=t.href.baseVal;return[nt(e,{url:n,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(e=>{e&&(t.dataset.originalSrc=n,t.href.baseVal=e||"")})]}return[]}(t,e)),"use"===t.tagName&&n.push(...function(t,e){const{ownerDocument:n,svgDefsElement:o}=e,i=t.getAttribute("href")??t.getAttribute("xlink:href");if(!i)return[];const[r,a]=i.split("#");if(a){const i=`#${a}`,s=e.shadowRoots.reduce((t,e)=>t??e.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(r&&t.setAttribute("href",i),o?.querySelector(i))return[];if(s)return o?.appendChild(s.cloneNode(!0)),[];if(r)return[nt(e,{url:r,responseType:"text"}).then(t=>{o?.insertAdjacentHTML("beforeend",t)})]}return[]}(t,e))),S(t)&&n.push(...function(t,e){return st.map(n=>{const o=t.getPropertyValue(n);return o&&"none"!==o?((y||w)&&e.drawImageCount++,ot(o,null,e,!0).then(e=>{e&&o!==e&&t.setProperty(n,e,t.getPropertyPriority(n))})):null}).filter(Boolean)}(t.style,e)),t.childNodes.forEach(t=>{ct(t,e)})}async function lt(t,e){const{ownerDocument:n,svgStyleElement:o,fontFamilies:i,fontCssTexts:r,tasks:a,font:s}=e;if(n&&o&&i.size)if(s&&s.cssText){const t=ft(s.cssText,e);o.appendChild(n.createTextNode(`${t}\n`))}else{const t=Array.from(n.styleSheets).filter(t=>{try{return"cssRules"in t&&Boolean(t.cssRules.length)}catch(n){return e.log.warn(`Error while reading CSS rules from ${t.href}`,n),!1}});await Promise.all(t.flatMap(t=>Array.from(t.cssRules).map(async(n,o)=>{if("CSSImportRule"===n.constructor.name){let i=o+1;const r=n.href;let a="";try{a=await nt(e,{url:r,requestType:"text",responseType:"text"})}catch(t){e.log.warn(`Error fetch remote css import from ${r}`,t)}const s=a.replace(rt,(t,e,n)=>t.replace(n,I(n,r)));for(const n of function(t){if(null==t)return[];const e=[];let n=t.replace(ut,"");for(;;){const t=dt.exec(n);if(!t)break;e.push(t[0])}n=n.replace(dt,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=o.exec(n);if(t)i.lastIndex=o.lastIndex;else{if(t=i.exec(n),!t)break;o.lastIndex=i.lastIndex}e.push(t[0])}return e}(s))try{t.insertRule(n,n.startsWith("@import")?i+=1:t.cssRules.length)}catch(t){e.log.warn("Error inserting rule from remote css import",{rule:n,error:t})}}})));t.flatMap(t=>Array.from(t.cssRules)).filter(t=>"CSSFontFaceRule"===t.constructor.name&&it(t.style.getPropertyValue("src"))&&D(t.style.getPropertyValue("font-family"))?.some(t=>i.has(t))).forEach(t=>{const i=t,s=r.get(i.cssText);s?o.appendChild(n.createTextNode(`${s}\n`)):a.push(ot(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,e).then(t=>{t=ft(t,e),r.set(i.cssText,t),o.appendChild(n.createTextNode(`${t}\n`))}))})}}const ut=/(\/\*[\s\S]*?\*\/)/g,dt=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const ht=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ft(t,e){const{font:n}=e,o=n?n?.preferredFormat:void 0;return o?t.replace(mt,t=>{for(;;){const[e,,n]=ht.exec(t)||[];if(!n)return"";if(n===o)return`src: ${e};`}}):t}async function pt(t,e){const n=await $(t,e);if(b(n.node)&&v(n.node))return n.node;const{ownerDocument:o,log:i,tasks:r,svgStyleElement:a,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:h,onEmbedNode:m,onCreateForeignObjectSvg:f}=n;i.time("clone node");const p=await tt(n.node,n,!0);if(a&&o){let t="";c.forEach((e,n)=>{t+=`${e.join(",\n")} {\n ${n}\n}\n`}),a.appendChild(o.createTextNode(t))}i.timeEnd("clone node"),await(h?.(p)),!1!==l&&b(p)&&(i.time("embed web font"),await lt(0,n),i.timeEnd("embed web font")),i.time("embed node"),ct(p,n);const g=r.length;let y=0;u?.(y,g),await Promise.all([...Array.from({length:4})].map(async()=>{for(;;){const t=r.pop();if(!t)break;try{await t}catch(t){n.log.warn("Failed to run task",t)}u?.(++y,g)}})),i.timeEnd("embed node"),await(m?.(p));const w=function(t,e){const{width:n,height:o}=e,i=function(t,e,n){const o=R(n).createElementNS(T,"svg");return o.setAttributeNS(null,"width",t.toString()),o.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${t} ${e}`),o}(n,o,t.ownerDocument),r=i.ownerDocument.createElementNS(i.namespaceURI,"foreignObject");return r.setAttributeNS(null,"x","0%"),r.setAttributeNS(null,"y","0%"),r.setAttributeNS(null,"width","100%"),r.setAttributeNS(null,"height","100%"),r.append(t),i.appendChild(r),i}(p,n);return s&&w.insertBefore(s,w.children[0]),a&&w.insertBefore(a,w.children[0]),d&&et(n),await(f?.(w)),w}async function gt(t,e){const n=await $(t,e),o=await pt(n),i=function(t,e){let n=(new XMLSerializer).serializeToString(t);return e&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=U(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(T,"defs"),n.svgStyles.clear());const r=N(i,o.ownerDocument);return await V(r,n)}async function yt(t,e){return async function(t,e){const n=await $(t,e),{log:o,quality:i,type:r,dpi:a}=n,s=await gt(n);o.time("canvas to data url");let c=s.toDataURL(r,i);if(["image/png","image/jpeg"].includes(r)&&a&&m&&f){const[t,e]=c.split(",");let n=0,o=!1;if("image/png"===r){const t=function(t){let e=t.indexOf("AAlwSFlz");return-1===e&&(e=t.indexOf("AAAJcEhZ")),-1===e&&(e=t.indexOf("AAAACXBI")),e}(e);t>=0?(n=4*Math.ceil((t+28)/3),o=!0):n=44}else"image/jpeg"===r&&(n=24);const i=e.substring(0,n),s=e.substring(n),l=window.atob(i),d=new Uint8Array(l.length);for(let t=0;t<d.length;t++)d[t]=l.charCodeAt(t);const h="image/png"===r?u(d,a,o):function(t,e){return t[13]=1,t[14]=e>>8,t[15]=255&e,t[16]=e>>8,t[17]=255&e,t}(d,a);c=[t,",",window.btoa(String.fromCharCode(...h)),s].join("")}return o.timeEnd("canvas to data url"),c}(await $(t,{...e,type:"image/png"}))}var wt={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function bt(t){const e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;const n=e[2].trim();return n.startsWith("#")?null:n}function vt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}var xt=function(t="[snapDOM]",{ttlMs:e=3e5,maxEntries:n=12}={}){const o=new Map;let i=0;function r(t,r,a){if(i>=n)return;const s=Date.now();(o.get(r)||0)>s||(o.set(r,s+e),i++,"warn"===t&&console&&console.warn||console&&console.error)}return{warnOnce(t,e){r("warn",t)},errorOnce(t,e){r("error",t)},reset(){o.clear(),i=0}}}("[snapDOM]",{ttlMs:18e4,maxEntries:10}),St=new Map,Ct=new Map;function Et(t,e){if(!e)return!1;if(function(t){return/^data:|^blob:|^about:blank$/i.test(t)}(t))return!1;if(function(t,e){try{const n="undefined"!=typeof location&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,i=new URL(o||".",n),r=new URL(t,n);if(r.origin===i.origin)return!0;const a=r.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}(t,e))return!1;try{const e="undefined"!=typeof location&&location.href?location.href:"http://localhost/",n=new URL(t,e);return"undefined"==typeof location||n.origin!==location.origin}catch{return!!e}}function Mt(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}async function kt(t,e={}){const n=e.as??"blob",o=e.timeout??3e3,i=e.useProxy||"",r=e.errorTTL??8e3,a=e.headers||{},s=!!e.silent;if(/^data:/i.test(t))try{if("text"===n)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if("dataURL"===n)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};const[,e="",o=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(o):decodeURIComponent(o),r=new Uint8Array([...i].map(t=>t.charCodeAt(0))),a=new Blob([r],{type:(e||"").split(";")[0]||""});return{ok:!0,data:a,status:200,url:t,fromCache:!1,mime:a.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{const e=await fetch(t);if(!e.ok)return{ok:!1,data:null,status:e.status,url:t,fromCache:!1,reason:"http_error"};const o=await e.blob(),i=o.type||e.headers.get("content-type")||"";if("dataURL"===n){return{ok:!0,data:await Mt(o),status:e.status,url:t,fromCache:!1,mime:i}}if("text"===n){return{ok:!0,data:await o.text(),status:e.status,url:t,fromCache:!1,mime:i}}return{ok:!0,data:o,status:e.status,url:t,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return"dataURL"===n?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:"text"===n?"":new Blob([]),status:200,url:t,fromCache:!1};const c=function(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}(t,{as:n,timeout:o,useProxy:i,errorTTL:r}),l=Ct.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&Ct.delete(c);const u=St.get(c);if(u)return u;const d=Et(t,i)?function(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",vt(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${vt(t)}`;const n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}(t,i):t;let h=e.credentials;if(!h)try{const e="undefined"!=typeof location&&location.href?location.href:"http://localhost/",n=new URL(t,e),o="undefined"!=typeof location&&n.origin===location.origin;h=o?"include":"omit"}catch{h="omit"}const m=new AbortController,f=setTimeout(()=>m.abort("timeout"),o),p=(async()=>{try{const o=await fetch(d,{signal:m.signal,credentials:h,headers:a});if(!o.ok){const i={ok:!1,data:null,status:o.status,url:d,fromCache:!1,reason:"http_error"};if(r>0&&Ct.set(c,{until:Date.now()+r,result:i}),!s){const e=`${o.status} ${o.statusText||""}`.trim();xt.warnOnce(`http:${o.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${e} while fetching ${n} ${t}`)}return e.onError&&e.onError(i),i}if("text"===n){return{ok:!0,data:await o.text(),status:o.status,url:d,fromCache:!1}}const i=await o.blob(),l=i.type||o.headers.get("content-type")||"";if("dataURL"===n){return{ok:!0,data:await Mt(i),status:o.status,url:d,fromCache:!1,mime:l}}return{ok:!0,data:i,status:o.status,url:d,fromCache:!1,mime:l}}catch(i){const a=i&&"object"==typeof i&&"name"in i&&"AbortError"===i.name?String(i.message||"").includes("timeout")?"timeout":"abort":"network",l={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:a};if(!/^blob:/i.test(t)&&r>0&&Ct.set(c,{until:Date.now()+r,result:l}),!s){const e=`${a}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,i="timeout"===a?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:"abort"===a?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;xt.errorOnce(e,i)}return e.onError&&e.onError(l),l}finally{clearTimeout(f),St.delete(c)}})();return St.set(c,p),p}function At(t,e){if(!e||!t.width||!t.height)return t;const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}async function Lt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||"none"===t.trim())return t;const n=bt(t);if(!n)return t;const o=vt(n);if(wt.background.has(o)){const t=wt.background.get(o);return t?`url("${t}")`:"none"}try{const t=await kt(o,{as:"dataURL",useProxy:e.useProxy});return t.ok?(wt.background.set(o,t.data),`url("${t.data}")`):(wt.background.set(o,null),"none")}catch{return wt.background.set(o,null),"none"}}var It=new Set(["meta","script","noscript","title","link","template"]),Rt=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);var Tt=/(?:^|-)(animation|transition)(?:-|$)/i,Pt=/^(--|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,Nt=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function Ft(t){const e=String(t).toLowerCase();return!!Nt.has(e)||(!!Pt.test(e)||!!Tt.test(e))}function Wt(t,e){if(e=String(e||"").toLowerCase(),Rt.has(e))return"";const n=[],o=function(t){if(t=String(t).toLowerCase(),Rt.has(t)){const e={};return wt.defaultStyle.set(t,e),e}if(wt.defaultStyle.has(t))return wt.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));const n=document.createElement(t);n.style.all="initial",e.appendChild(n);const o=getComputedStyle(n),i={};for(let t of o){if(Ft(t))continue;const e=o.getPropertyValue(t);i[t]=e}return e.removeChild(n),wt.defaultStyle.set(t,i),i}(e);for(let[e,i]of Object.entries(t)){if(Ft(e))continue;const t=o[e];i&&i!==t&&n.push(`${e}:${i}`)}return n.sort(),n.join(";")}function Dt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=wt.computedStyle.get(t);if(n||(n=new Map,wt.computedStyle.set(t,n)),!n.has(e)){const o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Ht(t){const e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function $t(t){const e=[];let n=0,o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&n++,")"===r&&n--,","===r&&0===n&&(e.push(t.slice(o,i).trim()),o=i+1)}return e.push(t.slice(o).trim()),e}function Bt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function Ut(){const t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),o=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||o}var Vt=new WeakMap,Ot=new Map,jt=0;function zt(){jt++}var Xt=!1;var Zt=new WeakMap;function Gt(t,e=null,n={}){const o=Vt.get(t);if(o&&o.epoch===jt)return o.snapshot;const i=e||getComputedStyle(t),r=function(t,e={}){const n={},o=t.getPropertyValue("visibility");for(let e=0;e<t.length;e++){const o=t[e];let i=t.getPropertyValue(o);"background-image"!==o&&"content"!==o||!i.includes("url(")||i.includes("data:")||(i="none"),n[o]=i}if(e.embedFonts){const e=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(const o of e)if(!n[o])try{const e=t.getPropertyValue(o);e&&(n[o]=e)}catch{}}return"hidden"===o&&(n.opacity="0"),n}(i,n);return function(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;const o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;if(function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}(t))return;const i=e.position;if("absolute"===i||"fixed"===i||"sticky"===i)return;if("none"!==e.transform)return;if(function(t){if(t.backgroundImage&&"none"!==t.backgroundImage)return!0;if(t.backgroundColor&&"rgba(0, 0, 0, 0)"!==t.backgroundColor&&"transparent"!==t.backgroundColor)return!0;if((parseFloat(t.borderTopWidth)||0)>0)return!0;if((parseFloat(t.borderBottomWidth)||0)>0)return!0;if((parseFloat(t.paddingTop)||0)>0)return!0;if((parseFloat(t.paddingBottom)||0)>0)return!0;const e=t.overflowBlock||t.overflowY||"visible";return"visible"!==e}(e))return;if(function(t){const e=t.parentElement;if(!e)return!1;const n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}(t))return;if(!function(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;const n=t.firstElementChild,o=t.lastElementChild;if(n&&"BR"===n.tagName||o&&"BR"===o.tagName)return!0;const i=t.scrollHeight;if(0===i)return!1;const r=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return i>r+a}(t,e))return;delete n.height,delete n["block-size"]}(t,i,r),Vt.set(t,{epoch:jt,snapshot:r}),r}async function Yt(t,e,n,o){if("STYLE"===t.tagName)return;const i=function(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Ot,defaultStyle:wt.defaultStyle,baseStyle:wt.baseStyle,image:wt.image,resource:wt.resource,background:wt.background,font:wt.font},options:e||{}}:{session:wt.session,persist:{snapshotKeyCache:Ot,defaultStyle:wt.defaultStyle,baseStyle:wt.baseStyle,image:wt.image,resource:wt.resource,background:wt.background,font:wt.font},options:t||e||{}}}(n,o),r=i.options&&i.options.cache||"auto";if("disabled"!==r&&function(t=document.documentElement){if(!Xt){Xt=!0;try{new MutationObserver(()=>zt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>zt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{const t=document.fonts;t&&(t.addEventListener?.("loadingdone",zt),t.ready?.then(()=>zt()).catch(()=>{}))}catch{}}}(document.documentElement),"disabled"!==r||i.session.__bumpedForDisabled||(zt(),Ot.clear(),i.session.__bumpedForDisabled=!0),Rt.has(t.tagName?.toLowerCase())){const n=t.getAttribute?.("style");n&&e.setAttribute("style",n)}const{session:a,persist:s}=i;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));const c=Gt(t,a.styleCache.get(t),i.options),l=function(t){let e=Zt.get(t);return e||(e=Object.entries(t).sort((t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0).map(([t,e])=>`${t}:${e}`).join(";"),Zt.set(t,e),e)}(c);let u=s.snapshotKeyCache.get(l);if(!u){u=Wt(c,t.tagName?.toLowerCase()||"div"),s.snapshotKeyCache.set(l,u)}a.styleMap.set(e,u)}function _t(t,e,n){return Promise.all(t.map(t=>new Promise(o=>{!function i(){Bt(n=>{!n||"function"!=typeof n.timeRemaining||n.timeRemaining()>0?e(t,o):i()},{fast:n})}()})))}function qt(t,e){return t?t=(t=(t=(t=(t=t.replace(/:host\(([^)]+)\)/g,(t,n)=>`:where(${e}:is(${n.trim()}))`)).replace(/:host\b/g,`:where(${e})`)).replace(/:host-context\(([^)]+)\)/g,(t,n)=>`:where(:where(${n.trim()}) ${e})`)).replace(/::slotted\(([^)]+)\)/g,(t,n)=>`:where(${e} ${n.trim()})`)).replace(/(^|})(\s*)([^@}{]+){/g,(t,n,o,i)=>{const r=function(t,e,n=!0){return t.split(",").map(t=>t.trim()).filter(Boolean).map(t=>{if(t.startsWith(":where("))return t;if(t.startsWith("@"))return t;const o=n?(i=(i=t).trim())?/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(i)?i:`${i}:not([data-sd-slotted])`:i:t;var i;return`:where(${e} ${o})`}).join(", ")}(i,e,!0);return`${n}${o}${r}{`}):""}function Jt(t,e){try{let n=getComputedStyle(t).getPropertyValue(e).trim();if(n)return n}catch{}try{let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(t)return t}catch{}return""}async function Qt(t,e,n){const o=await async function(t,e=3){const n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}};let o=n(),i=0;for(;i<e&&(!o||!o.body&&!o.documentElement);)await new Promise(t=>setTimeout(t,0)),o=n(),i++;return o&&(o.body||o.documentElement)?o:null}(t,3);if(!o)throw new Error("iframe document not accessible/ready");const{contentWidth:i,contentHeight:r,rect:a}=function(t){const e=t.getBoundingClientRect();let n=0,o=0,i=0,r=0;try{const e=getComputedStyle(t);n=parseFloat(e.borderLeftWidth)||0,o=parseFloat(e.borderRightWidth)||0,i=parseFloat(e.borderTopWidth)||0,r=parseFloat(e.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(e.width-(n+o))),contentHeight:Math.max(0,Math.round(e.height-(i+r))),rect:e}}(t),s=n?.snap;if(!s||"function"!=typeof s.toPng)throw new Error("snapdom.toPng not available in iframe or window");const c={...n,scale:1},l=function(t,e,n){const o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}(o,i,r);let u;try{u=await s.toPng(o.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${i}px`,u.style.height=`${r}px`;const d=document.createElement("div");return e.nodeMap.set(d,t),Yt(t,d,e,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}async function Kt(t,e,n){if(!t)throw new Error("Invalid node");const o=new Set;let i,r=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){const e=(t.localName||t.tagName||"").toLowerCase();if("snapdom-sandbox"===t.id||t.hasAttribute("data-snapdom-sandbox"))return null;if(It.has(e))return null}if(t.nodeType===Node.TEXT_NODE)return t.cloneNode(!0);if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if("exclude"===t.getAttribute("data-capture")){if("hide"===n.excludeMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.excludeMode)return null}if(n.exclude&&Array.isArray(n.exclude))for(const e of n.exclude)try{if(t.matches?.(e)){if("hide"===n.excludeMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.excludeMode)return null}}catch(t){}if("function"==typeof n.filter)try{if(!n.filter(t)){if("hide"===n.filterMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.filterMode)return null}}catch(t){}if("IFRAME"===t.tagName){let o=!1;try{o=!(!t.contentDocument&&!t.contentWindow?.document)}catch{o=!1}if(o)try{return await Qt(t,e,n)}catch(t){}if(n.placeholders){const o=document.createElement("div");return o.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Yt(t,o,e,n),o}{const o=t.getBoundingClientRect(),i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${o.width}px;height:${o.height}px;visibility:hidden;`,Yt(t,i,e,n),i}}if("placeholder"===t.getAttribute("data-capture")){const o=t.cloneNode(!1);e.nodeMap.set(o,t),Yt(t,o,e,n);const i=document.createElement("div");return i.textContent=t.getAttribute("data-placeholder-text")||"",i.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",o.appendChild(i),o}if("CANVAS"===t.tagName){const o=t.toDataURL(),i=document.createElement("img");return i.src=o,i.width=t.width,i.height=t.height,e.nodeMap.set(i,t),Yt(t,i,e,n),i}try{if(i=t.cloneNode(!1),function(t,e){if(!(t instanceof Element&&e instanceof Element))return;const n=t.getAttribute?.("style");let o,i=!(!n||!n.includes("var("));if(!i&&t.attributes?.length){const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t];if(n&&"string"==typeof n.value&&n.value.includes("var(")){i=!0;break}}}if(!i)return;try{o=getComputedStyle(t)}catch{return}const r=t.style;if(r&&r.length)for(let t=0;t<r.length;t++){const n=r[t],i=r.getPropertyValue(n);if(!i||!i.includes("var("))continue;const a=o.getPropertyValue(n);if(a)try{e.style.setProperty(n,a.trim(),r.getPropertyPriority(n))}catch{}}if(t.attributes?.length){const n=t.attributes;for(let t=0;t<n.length;t++){const i=n[t];if(!i||"string"!=typeof i.value||!i.value.includes("var("))continue;const r=i.name;let a="";try{a=o.getPropertyValue(r)}catch{}if(a)try{e.style.setProperty(r,a.trim())}catch{}}}}(t,i),e.nodeMap.set(i,t),"IMG"===t.tagName){!function(t,e){try{const n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}(t,i);try{const e=t.getBoundingClientRect();let n=Math.round(e.width||0),o=Math.round(e.height||0);if(!n||!o){const e=window.getComputedStyle(t),i=parseFloat(e.width)||0,r=parseFloat(e.height)||0,a=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,c=t.width||t.naturalWidth||0,l=t.height||t.naturalHeight||0;n=Math.round(n||i||a||c||0),o=Math.round(o||r||s||l||0)}n&&(i.dataset.snapdomWidth=String(n)),o&&(i.dataset.snapdomHeight=String(o))}catch{}}}catch(t){throw t}if(t instanceof HTMLTextAreaElement){const e=t.getBoundingClientRect();i.style.width=`${e.width}px`,i.style.height=`${e.height}px`}if(t instanceof HTMLInputElement&&(i.value=t.value,i.setAttribute("value",t.value),void 0!==t.checked&&(i.checked=t.checked,t.checked&&i.setAttribute("checked",""),t.indeterminate&&(i.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),Yt(t,i,e,n),t.shadowRoot){let r=function(t,o){if(t.nodeType===Node.ELEMENT_NODE&&"STYLE"===t.tagName)return o(null);Kt(t,e,n).then(t=>{o(t||null)}).catch(()=>{o(null)})};try{const e=t.shadowRoot.querySelectorAll("slot");for(const t of e){let e=[];try{e=t.assignedNodes?.({flatten:!0})||t.assignedNodes?.()||[]}catch{e=t.assignedNodes?.()||[]}for(const t of e)o.add(t)}}catch{}const a=function(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}(e),s=`[data-sd="${a}"]`;try{i.setAttribute("data-sd",a)}catch{}const c=function(t){let e="";try{t.querySelectorAll("style").forEach(t=>{e+=(t.textContent||"")+"\n"});const n=t.adoptedStyleSheets||[];for(const t of n)try{if(t&&t.cssRules)for(const n of t.cssRules)e+=n.cssText+"\n"}catch{}}catch{}return e}(t.shadowRoot),l=qt(c,s),u=function(t,e,n){const o=[];for(const n of e){const e=Jt(t,n);e&&o.push(`${n}: ${e};`)}return o.length?`${n}{${o.join("")}}\n`:""}(t,function(t){const e=new Set;if(!t)return e;const n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;let o;for(;o=n.exec(t);)e.add(o[1]);return e}(c),s);!function(t,e,n){if(!e)return;const o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}(i,u+l,a);const d=document.createDocumentFragment(),h=await _t(Array.from(t.shadowRoot.childNodes),r,n.fast);d.append(...h.filter(t=>!!t)),i.appendChild(d)}if("SLOT"===t.tagName){let o=function(t,o){Kt(t,e,n).then(t=>{var e;t&&(e=t)&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted",""))),o(t||null)}).catch(()=>{o(null)})};const i=t.assignedNodes?.({flatten:!0})||[],r=i.length>0?i:Array.from(t.childNodes),a=document.createDocumentFragment(),s=await _t(Array.from(r),o,n.fast);return a.append(...s.filter(t=>!!t)),a}const s=await _t(Array.from(t.childNodes),function(t,i){if(o.has(t))return i(null);Kt(t,e,n).then(t=>{i(t||null)}).catch(()=>{i(null)})},n.fast);if(i.append(...s.filter(t=>!!t)),null!==r&&i instanceof HTMLSelectElement){i.value=r;for(const t of i.options)t.value===r?t.setAttribute("selected",""):t.removeAttribute("selected")}return null!==a&&i instanceof HTMLTextAreaElement&&(i.textContent=a),i}var te=[/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],ee=[];function ne(t){const e="string"==typeof t?t:"",n=[...te,...ee];for(const t of n)if(t instanceof RegExp&&t.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}async function oe(t,e,n,o=32,i="#000"){e=e.replace(/^['"]+|['"]+$/g,"");const r=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}const a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);const s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);const u=document.createElement("canvas");u.width=Math.max(1,c*r),u.height=Math.max(1,l*r);const d=u.getContext("2d");return d.scale(r,r),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var ie=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function re(t){if(!t)return"";for(let e of t.split(",")){let t=e.trim().replace(/^['"]+|['"]+$/g,"");if(t&&!ie.has(t.toLowerCase()))return t}return""}function ae(t){const e=String(t??"400").trim().toLowerCase();if("normal"===e)return 400;if("bold"===e)return 700;const n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function se(t){const e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function ce(t,e){if(!t)return!1;try{const n=new URL(t,location.href);if(n.origin===location.origin)return!0;const o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(t=>o.endsWith(t)))return!0;const i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i))return!0;for(const t of e){const e=t.toLowerCase().replace(/\s+/g,"+"),n=t.toLowerCase().replace(/\s+/g,"-");if(i.includes(e)||i.includes(n))return!0}return!1}catch{return!1}}function le(t,e){return t?t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(t,n,o)=>{const i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return t;let r=i;try{r=new URL(i,e||location.href).href}catch{}return`url("${r}")`}):t}var ue=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g;async function de(t,e,n){if(!t)return t;const o=new Set;function i(t,e){try{return new URL(t,e||location.href).href}catch{return t}}let r=le(t,e||location.href);return r=await async function t(e,r,a=0){if(a>4)return e;let s,c="",l=0;for(;s=ue.exec(e);){c+=e.slice(l,s.index),l=ue.lastIndex;const u=i((s[2]||s[4]||"").trim(),r);if(o.has(u))continue;o.add(u);let d="";try{const t=await kt(u,{as:"text",useProxy:n,silent:!0});t.ok&&"string"==typeof t.data&&(d=t.data)}catch{}d?(d=le(d,u),d=await t(d,u,a+1),c+=`\n/* inlined: ${u} */\n${d}\n`):c+=s[0]}return c+=e.slice(l),c}(r,e||location.href,0),r}var he=/url\((["']?)([^"')]+)\1\)/g,me=/@font-face[^{}]*\{[^}]*\}/g;function fe(t){if(!t)return[];const e=[],n=t.split(",").map(t=>t.trim()).filter(Boolean);for(const t of n){const n=t.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;const o=n[1],i=n[2],r=t=>{if(!t.includes("?"))return parseInt(t,16);return[parseInt(t.replace(/\?/g,"0"),16),parseInt(t.replace(/\?/g,"F"),16)]};if(i){const t=r(o),n=r(i),a=Array.isArray(t)?t[0]:t,s=Array.isArray(n)?n[1]:n;e.push([Math.min(a,s),Math.max(a,s)])}else{const t=r(o);Array.isArray(t)?e.push([t[0],t[1]]):e.push([t,t])}}return e}function pe(t,e){if(!e.length)return!0;if(!t||0===t.size)return!0;for(const n of t)for(const[t,o]of e)if(n>=t&&n<=o)return!0;return!1}function ge(t,e){const n=[];if(!t)return n;for(const o of t.matchAll(he)){let t=(o[2]||"").trim();if(t&&!t.startsWith("data:")){if(!/^https?:/i.test(t))try{t=new URL(t,e||location.href).href}catch{}n.push(t)}}return n}async function ye(t,e,n=""){let o=t;for(const i of t.matchAll(he)){const t=bt(i[0]);if(!t)continue;let r=t;if(!r.startsWith("http")&&!r.startsWith("data:"))try{r=new URL(r,e||location.href).href}catch{}if(!ne(r))if(wt.resource?.has(r))wt.font?.add(r),o=o.replace(i[0],`url(${wt.resource.get(r)})`);else if(!wt.font?.has(r))try{const t=await kt(r,{as:"dataURL",useProxy:n,silent:!0});if(t.ok&&"string"==typeof t.data){const e=t.data;wt.resource?.set(r,e),wt.font?.add(r),o=o.replace(i[0],`url(${e})`)}}catch{}}return o}function we(t={}){const e=new Set((t.families||[]).map(t=>String(t).toLowerCase())),n=new Set((t.domains||[]).map(t=>String(t).toLowerCase())),o=new Set((t.subsets||[]).map(t=>String(t).toLowerCase()));return(t,i)=>{if(e.size&&e.has(t.family.toLowerCase()))return!0;if(n.size)for(const e of t.srcUrls)try{if(n.has(new URL(e).host.toLowerCase()))return!0}catch{}if(o.size){const t=function(t){if(!t.length)return null;const e=(e,n)=>t.some(([t,o])=>!(o<e||t>n)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),i=e(880,1023),r=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":r?"cyrillic":i?"greek":o?"latin-ext":n?"latin":null}(i);if(t&&o.has(t))return!0}return!1}}async function be(t,e,n,o){let i;try{i=t.cssRules||[]}catch{return}const r=(t,e)=>{try{return new URL(t,e||location.href).href}catch{return t}};for(const t of i){if(t.type===CSSRule.IMPORT_RULE&&t.styleSheet){const i=t.href?r(t.href,e):e;if(o.depth>=4)continue;if(i&&o.visitedSheets.has(i))continue;i&&o.visitedSheets.add(i);const a={...o,depth:(o.depth||0)+1};await be(t.styleSheet,i,n,a);continue}if(t.type===CSSRule.FONT_FACE_RULE){const i=re((t.style.getPropertyValue("font-family")||"").trim());if(!i||ne(i))continue;const r=(t.style.getPropertyValue("font-weight")||"400").trim(),a=(t.style.getPropertyValue("font-style")||"normal").trim(),s=(t.style.getPropertyValue("font-stretch")||"100%").trim(),c=(t.style.getPropertyValue("src")||"").trim(),l=(t.style.getPropertyValue("unicode-range")||"").trim();if(!o.faceMatchesRequired(i,a,r,s))continue;const u=fe(l);if(!pe(o.usedCodepoints,u))continue;const d={family:i,weightSpec:r,styleSpec:a,stretchSpec:s,unicodeRange:l,srcRaw:c,srcUrls:ge(c,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(d,u))continue;if(/url\(/i.test(c)){const t=await ye(c,e||location.href,o.useProxy);await n(`@font-face{font-family:${i};src:${t};font-style:${a};font-weight:${r};font-stretch:${s};${l?`unicode-range:${l};`:""}}`)}else await n(`@font-face{font-family:${i};src:${c};font-style:${a};font-weight:${r};font-stretch:${s};${l?`unicode-range:${l};`:""}}`)}}}async function ve({required:t,usedCodepoints:e,exclude:n,localFonts:o=[],useProxy:i=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);const r=new Map;for(const e of t){const[t,n,o,i]=String(e).split("__");if(!t)continue;const a=r.get(t)||[];a.push({w:parseInt(n,10),s:o,st:parseInt(i,10)}),r.set(t,a)}function a(t,e,n,o){if(!r.has(t))return!1;const i=r.get(t),a=function(t){const e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){const t=ae(n[1]),e=ae(n[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}const o=ae(e);return{min:o,max:o}}(n),s=function(t){const e=String(t||"normal").trim().toLowerCase();return"italic"===e?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}(e),c=function(t){const e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){const t=parseFloat(n[1]),e=parseFloat(n[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}const o=e.match(/(\d+(?:\.\d+)?)\s*%/),i=o?parseFloat(o[1]):100;return{min:i,max:i}}(o),l=a.min!==a.max,u=a.min,d=t=>"normal"===s.kind&&"normal"===t||"normal"!==s.kind&&("italic"===t||"oblique"===t);let h=!1;for(const t of i){const e=l?t.w>=a.min&&t.w<=a.max:t.w===u,n=d(se(t.s)),o=t.st>=c.min&&t.st<=c.max;if(e&&n&&o){h=!0;break}}if(h)return!0;if(!l)for(const t of i){const e=d(se(t.s)),n=t.st>=c.min&&t.st<=c.max;if(Math.abs(u-t.w)<=300&&e&&n)return!0}return!1}const s=we(n),c=function(t,e,n,o){return`fonts-embed-css::req=${Array.from(t||[]).sort().join("|")}::ex=${e?JSON.stringify({families:(e.families||[]).map(t=>String(t).toLowerCase()).sort(),domains:(e.domains||[]).map(t=>String(t).toLowerCase()).sort(),subsets:(e.subsets||[]).map(t=>String(t).toLowerCase()).sort()}):""}::lf=${(n||[]).map(t=>`${(t.family||"").toLowerCase()}::${t.weight||"normal"}::${t.style||"normal"}::${t.src||""}`).sort().join("|")}::px=${o||""}`}(t,n,o,i);if(wt.resource?.has(c))return wt.resource.get(c);const l=function(t){const e=new Set;for(const n of t||[]){const t=String(n).split("__")[0]?.trim();t&&e.add(t)}return e}(t),u=[],d=ue;for(const t of document.querySelectorAll("style")){const e=t.textContent||"";for(const t of e.matchAll(d)){const e=(t[2]||t[4]||"").trim();if(!e||ne(e))continue;!!document.querySelector(`link[rel="stylesheet"][href="${e}"]`)||u.push(e)}}u.length&&await Promise.all(u.map(t=>new Promise(e=>{if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return e(null);const n=document.createElement("link");n.rel="stylesheet",n.href=t,n.setAttribute("data-snapdom","injected-import"),n.onload=()=>e(n),n.onerror=()=>e(null),document.head.appendChild(n)})));let h="";const m=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(t=>!!t.href);for(const t of m)try{if(ne(t.href))continue;let o="",r=!1;try{r=new URL(t.href,location.href).origin===location.origin}catch{}if(!r&&!ce(t.href,l))continue;if(r){const e=Array.from(document.styleSheets).find(e=>e.href===t.href);if(e)try{const t=e.cssRules||[];o=Array.from(t).map(t=>t.cssText).join("")}catch{}}if(!o){if(o=(await kt(t.href,{as:"text",useProxy:i})).data,ne(t.href))continue}o=await de(o,t.href,i);let c="";for(const r of o.match(me)||[]){const o=re((r.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim());if(!o||ne(o))continue;const l=(r.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),u=(r.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),d=(r.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),h=(r.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),m=(r.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),f=ge(m,t.href);if(!a(o,u,l,d))continue;const p=fe(h);if(!pe(e,p))continue;const g={family:o,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:m,srcUrls:f,href:t.href};if(n&&s(g,p))continue;c+=/url\(/i.test(m)?await ye(r,t.href,i):r}c.trim()&&(h+=c)}catch{}const f={requiredIndex:r,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?we(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(const t of document.styleSheets)if(!t.href||!m.some(e=>e.href===t.href))try{const e=t.href||location.href;e&&f.visitedSheets.add(e),await be(t,e,async t=>{h+=t},f)}catch{}try{for(const t of document.fonts||[]){if(!t||!t.family||"loaded"!==t.status||!t._snapdomSrc)continue;const e=String(t.family).replace(/^['"]+|['"]+$/g,"");if(ne(e))continue;if(!r.has(e))continue;if(n?.families&&n.families.some(t=>String(t).toLowerCase()===e.toLowerCase()))continue;let o=t._snapdomSrc;if(!String(o).startsWith("data:"))if(wt.resource?.has(t._snapdomSrc))o=wt.resource.get(t._snapdomSrc),wt.font?.add(t._snapdomSrc);else if(!wt.font?.has(t._snapdomSrc))try{const e=await kt(t._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(!e.ok||"string"!=typeof e.data)continue;o=e.data,wt.resource?.set(t._snapdomSrc,o),wt.font?.add(t._snapdomSrc)}catch{continue}h+=`@font-face{font-family:'${e}';src:url(${o});font-style:${t.style||"normal"};font-weight:${t.weight||"normal"};}`}}catch{}for(const t of o){if(!t||"object"!=typeof t)continue;const e=String(t.family||"").replace(/^['"]+|['"]+$/g,"");if(!e||ne(e))continue;if(!r.has(e))continue;if(n?.families&&n.families.some(t=>String(t).toLowerCase()===e.toLowerCase()))continue;const o=null!=t.weight?String(t.weight):"normal",a=null!=t.style?String(t.style):"normal",s=null!=t.stretchPct?`${t.stretchPct}%`:"100%",c=String(t.src||"");let l=c;if(!l.startsWith("data:"))if(wt.resource?.has(c))l=wt.resource.get(c),wt.font?.add(c);else if(!wt.font?.has(c))try{const t=await kt(c,{as:"dataURL",useProxy:i,silent:!0});if(!t.ok||"string"!=typeof t.data)continue;l=t.data,wt.resource?.set(c,l),wt.font?.add(c)}catch{continue}h+=`@font-face{font-family:'${e}';src:url(${l});font-style:${a};font-weight:${o};font-stretch:${s};}`}return h&&(h=function(t){if(!t)return t;const e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(const i of t.match(e)||[]){const t=re(i.match(/font-family:\s*([^;]+);/i)?.[1]||""),e=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),r=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),a=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),s=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),c=(i.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),l=ge(c,location.href),u=l.length?l.map(t=>String(t).toLowerCase()).sort().join("|"):c.toLowerCase(),d=[String(t||"").toLowerCase(),e,r,a,s.toLowerCase(),u].join("|");n.has(d)||(n.add(d),o.push(i))}if(0===o.length)return t;let i=0;return t.replace(e,()=>o[i++]||"")}(h),wt.resource?.set(c,h)),h}function xe(t){const e=new Set;if(!t)return e;const n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=t=>{const n=re(t.fontFamily);if(!n)return;var o,i,r;e.add((o=t.fontWeight,i=t.fontStyle,r=t.fontStretch,`${n}__${ae(o)}__${se(i)}__${function(t){const e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}(r)}`))};o(getComputedStyle(t));const i=getComputedStyle(t,"::before");i&&i.content&&"none"!==i.content&&o(i);const r=getComputedStyle(t,"::after");for(r&&r.content&&"none"!==r.content&&o(r);n.nextNode();){const t=n.currentNode;o(getComputedStyle(t));const e=getComputedStyle(t,"::before");e&&e.content&&"none"!==e.content&&o(e);const i=getComputedStyle(t,"::after");i&&i.content&&"none"!==i.content&&o(i)}return e}function Se(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function Ce(t,e=!0){const 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"]];let o=Math.max(1,Math.min(3999,t)),i="";for(const[t,e]of n)for(;o>=t;)i+=e,o-=t;return e?i:i.toLowerCase()}function Ee(t,e){switch((e||"decimal").toLowerCase()){case"decimal":default:return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Se(t,!1);case"upper-alpha":return Se(t,!0);case"lower-roman":return Ce(t,!1);case"upper-roman":return Ce(t,!0)}}function Me(t){const e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=t=>{let e=0,n=t?.parentElement;if(!n)return 0;for(const o of n.children){if(o===t)break;"LI"===o.tagName&&e++}return e},i=(t,e,n)=>{const i=(t=>{const e=new Map;for(const[n,o]of t)e.set(n,o.slice());return e})(t);let r,a;try{r=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(r&&"none"!==r)for(const t of r.split(",")){const n=t.trim().split(/\s+/),o=n[0],r=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!o)continue;const a=e.get(o);if(a&&a.length){const t=a.slice();t.push(r),i.set(o,t)}else i.set(o,[r])}try{a=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(a&&"none"!==a)for(const t of a.split(",")){const e=t.trim().split(/\s+/),n=e[0],o=Number.isFinite(Number(e[1]))?Number(e[1]):1;if(!n)continue;const r=i.get(n)||[];0===r.length&&r.push(0),r[r.length-1]+=o,i.set(n,r)}try{if("list-item"===getComputedStyle(n).display&&(t=>t&&"LI"===t.tagName)(n)){const t=n.parentElement;let e=1;if(t&&"OL"===t.tagName){const i=t.getAttribute("start"),r=Number.isFinite(Number(i))?Number(i):1,a=o(n),s=n.getAttribute("value");e=Number.isFinite(Number(s))?Number(s):r+a}else e=1+o(n);const r=i.get("list-item")||[];0===r.length&&r.push(0),r[r.length-1]=e,i.set("list-item",r)}}catch{}return i},r=(t,n,o)=>{const a=i(o,n,t);e.set(t,a);let s=a;for(const e of t.children){s=r(e,a,s)}return a},a=new Map;return r(n,a,a),{get(t,n){const o=e.get(t)?.get(n);return o&&o.length?o[o.length-1]:0},getStack(t,n){const o=e.get(t)?.get(n);return o?o.slice():[]}}}var ke=null,Ae=new WeakMap;function Le(t,e){const n=t.parentElement,o=n?Ae.get(n):null;return o?{get(t,n){const i=e.get(t,n),r=o.get(n);return"number"==typeof r?Math.max(i,r):i},getStack(t,n){const i=e.getStack(t,n);if(!i.length)return i;const r=o.get(n);if("number"==typeof r){const t=i.slice();return t[t.length-1]=Math.max(t[t.length-1],r),t}return i}}:e}function Ie(t,e,n){const o=new Map;function i(t){const e=[];if(!t||"none"===t)return e;for(const n of String(t).split(",")){const t=n.trim().split(/\s+/),o=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):void 0;o&&e.push({name:o,num:i})}return e}const r=i(e?.counterReset),a=i(e?.counterIncrement);function s(e){if(o.has(e))return o.get(e).slice();let i=n.getStack(t,e);i=i.length?i.slice():[];const s=r.find(t=>t.name===e);if(s){const t=Number.isFinite(s.num)?s.num:0;i=i.length?[...i,t]:[t]}const c=a.find(t=>t.name===e);if(c){const t=Number.isFinite(c.num)?c.num:1;0===i.length&&(i=[0]),i[i.length-1]+=t}return o.set(e,i.slice()),i}return{get(t,e){const n=s(e);return n.length?n[n.length-1]:0},getStack:(t,e)=>s(e),__incs:a}}function Re(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}const i=o?.content;if(!i||"none"===i||"normal"===i)return{text:"",incs:[]};const r=Ie(t,o,Le(t,n));let a=/\bcounter\s*\(|\bcounters\s*\(/.test(i||"")?function(t,e,n){if(!t||"none"===t)return t;try{const o=/\b(counter|counters)\s*\(([^)]+)\)/g;return(t.replace(o,(t,o,i)=>{const r=String(i).split(",").map(t=>t.trim());if("counter"===o){const t=r[0]?.replace(/^["']|["']$/g,""),o=(r[1]||"decimal").toLowerCase();return Ee(n.get(e,t),o)}{const t=r[0]?.replace(/^["']|["']$/g,""),o=r[1]?.replace(/^["']|["']$/g,"")??"",i=(r[2]||"decimal").toLowerCase(),a=n.getStack(e,t);return a.length?a.map(t=>Ee(t,i)).join(o):""}})||"").replace(/"([^"]*)"/g,"$1")}catch{return"- "}}(i,t,r):i;const s=function(t){if(!t)return"";const e=[],n=/"([^"]*)"/g;let o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):(t||"").replace(/"([^"]*)"/g,"$1")}(a);return{text:s,incs:r.__incs||[]}}async function Te(t,e,n,o){if(!(t instanceof Element&&e instanceof Element))return;if(!ke)try{ke=Me(t.ownerDocument||document)}catch{}for(const i of["::before","::after","::first-letter"])try{const r=Dt(t,i);if(!r||"function"!=typeof r[Symbol.iterator])continue;if(!("none"!==r.content||"none"!==r.backgroundImage||"transparent"!==r.backgroundColor||"none"!==r.borderStyle&&0!==parseFloat(r.borderWidth)||r.transform&&"none"!==r.transform||"inline"!==r.display))continue;if("::first-letter"===i){const o=getComputedStyle(t);if(!(r.color!==o.color||r.fontSize!==o.fontSize||r.fontWeight!==o.fontWeight))continue;const i=Array.from(e.childNodes).find(t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim().length>0);if(!i)continue;const a=i.textContent,s=a.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),c=s?.[0],l=a.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;const u=document.createElement("span");u.textContent=c,u.dataset.snapdomPseudo="::first-letter";const d=Wt(Ht(r),"span");n.styleMap.set(u,d);const h=document.createTextNode(l);e.replaceChild(h,i),e.insertBefore(u,h);continue}const a=r.content,{text:s,incs:c}=Re(t,i,ke),l=r.backgroundImage,u=r.backgroundColor,d=r.fontFamily,h=parseInt(r.fontSize)||32,m=parseInt(r.fontWeight)||!1,f=r.color||"#000",p=r.borderStyle,g=parseFloat(r.borderWidth),y=r.transform,w=ne(d),b="none"!==a&&""!==s,v=l&&"none"!==l,x=u&&"transparent"!==u&&"rgba(0, 0, 0, 0)"!==u,S=p&&"none"!==p&&g>0,C=y&&"none"!==y;if(!(b||v||x||S||C)){if(c&&c.length&&t.parentElement){const e=Ae.get(t.parentElement)||new Map;for(const{name:n}of c){if(!n)continue;const o=Le(t,ke),r=Ie(t,getComputedStyle(t,i),o).get(t,n);e.set(n,r)}Ae.set(t.parentElement,e)}continue}const E=document.createElement("span");E.dataset.snapdomPseudo=i,E.style.verticalAlign="middle",E.style.pointerEvents="none";const M=Wt(Ht(r),"span");if(n.styleMap.set(E,M),w&&s&&1===s.length){const{dataUrl:t,width:n,height:o}=await oe(s,d,m,h,f),i=document.createElement("img");i.src=t,i.style=`height:${h}px;width:${n/o*h}px;object-fit:contain;`,E.appendChild(i),e.dataset.snapdomHasIcon="true"}else if(s&&s.startsWith("url(")){const t=bt(s);if(t?.trim())try{const e=document.createElement("img"),n=await kt(vt(t),{as:"dataURL",useProxy:o.useProxy});e.src=n.data,e.style=`width:${h}px;height:auto;object-fit:contain;`,E.appendChild(e)}catch(t){}}else!w&&b&&(E.textContent=s);if(E.style.background="none","mask"in E.style&&(E.style.mask="none"),v)try{const t=$t(l),e=await Promise.all(t.map(Lt));E.style.backgroundImage=e.join(", ")}catch(t){}x&&(E.style.backgroundColor=u);const k=E.childNodes.length>0||""!==E.textContent?.trim()||v||x||S||C;if(c&&c.length&&t.parentElement){const e=Ae.get(t.parentElement)||new Map,n=Le(t,ke),o=Ie(t,getComputedStyle(t,i),n);for(const{name:n}of c){if(!n)continue;const i=o.get(t,n);e.set(n,i)}Ae.set(t.parentElement,e)}if(!k)continue;"::before"===i?e.insertBefore(E,e.firstChild):e.appendChild(E)}catch(t){}const i=Array.from(t.children),r=Array.from(e.children).filter(t=>!t.dataset.snapdomPseudo);for(let t=0;t<Math.min(i.length,r.length);t++)await Te(i[t],r[t],n,o)}function Pe(t){if(!t||"auto"===t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Ne(t,e){const n=[];for(let o=t;o&&o!==e;){const t=o.parentElement;if(!t)break;n.push(Array.prototype.indexOf.call(t.children,o)),o=t}return n.reverse()}function Fe(t,e,n){let o=t;for(let t=0;t<e.length;t++){if(o=We(o,n)[e[t]],!o)return null}return o instanceof HTMLElement?o:null}function We(t,e){const n=[],o=t.children;for(let t=0;t<o.length;t++){const i=o[t];i.hasAttribute(e)||n.push(i)}return n}async function De(t,e={}){const n={styleMap:wt.session.styleMap,styleCache:wt.session.styleCache,nodeMap:wt.session.nodeMap};let o,i="",r="";!function(t){const e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,i=e.borderStyle,r=e.borderWidth,a="none"!==n&&parseFloat(o)>0,s="none"===i||0===parseFloat(r);a&&s&&(t.style.border=`${o} solid transparent`)}(t);try{!function(t){if(!t)return;const e=new Set;if(t.querySelectorAll("use").forEach(t=>{const n=t.getAttribute("xlink:href")||t.getAttribute("href");n&&n.startsWith("#")&&e.add(n.slice(1))}),!e.size)return;const n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(t=>"symbol"===t.tagName.toLowerCase()),i=n.filter(t=>"defs"===t.tagName.toLowerCase());let r=t.querySelector("svg.inline-defs-container");r||(r=document.createElementNS("http://www.w3.org/2000/svg","svg"),r.setAttribute("aria-hidden","true"),r.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),r.classList.add("inline-defs-container"),t.insertBefore(r,t.firstChild));const a=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(t=>{a.add(t.id)}),e.forEach(t=>{if(a.has(t))return;const e=o.find(e=>e.id===t);if(e)return r.appendChild(e.cloneNode(!0)),void a.add(t);for(const e of i){const n=e.querySelector(`#${CSS.escape(t)}`);if(n){let e=r.querySelector("defs");e||(e=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.appendChild(e)),e.appendChild(n.cloneNode(!0)),a.add(t);break}}})}(t)}catch(t){}try{o=await Kt(t,n,e)}catch(t){throw t}try{await Te(t,o,n,e)}catch(t){}await async function(t){if(!t)return;const e=t.querySelectorAll?t.querySelectorAll("img"):[];for(const t of e)try{const e=t.getAttribute("src")||t.currentSrc||"";if(Ve(e)){const n=await $e(e);t.setAttribute("src",n)}const n=t.getAttribute("srcset");if(n&&n.includes("blob:")){const e=Oe(n);let o=!1;for(const t of e)if(Ve(t.url))try{t.url=await $e(t.url),o=!0}catch{}o&&t.setAttribute("srcset",je(e))}}catch{}const n=t.querySelectorAll?t.querySelectorAll("image"):[];for(const t of n)try{const e="http://www.w3.org/1999/xlink",n=t.getAttribute("href")||t.getAttributeNS?.(e,"href");if(Ve(n)){const o=await $e(n);t.setAttribute("href",o),t.removeAttributeNS?.(e,"href")}}catch{}const o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(const t of o)try{const e=t.getAttribute("style");if(e&&e.includes("blob:")){const n=await Ue(e);t.setAttribute("style",n)}}catch{}const i=t.querySelectorAll?t.querySelectorAll("style"):[];for(const t of i)try{const e=t.textContent||"";e.includes("blob:")&&(t.textContent=await Ue(e))}catch{}const r=["poster"];for(const e of r){const n=t.querySelectorAll?t.querySelectorAll(`[${e}^='blob:']`):[];for(const t of n)try{const n=t.getAttribute(e);Ve(n)&&t.setAttribute(e,await $e(n))}catch{}}}(o);try{const t=o.querySelectorAll("style[data-sd]");for(const e of t)r+=e.textContent||"",e.remove()}catch{}const a=function(t){const e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map;let o=1;for(const t of e)n.set(t,"c"+o++);return n}(n.styleMap);i=Array.from(a.entries()).map(([t,e])=>`.${e}{${t}}`).join(""),i=r+i;for(const[t,e]of n.styleMap.entries()){if("STYLE"===t.tagName)continue;if(t.getRootNode&&t.getRootNode()instanceof ShadowRoot){t.setAttribute("style",e.replace(/;/g,"; "));continue}const n=a.get(e);n&&t.classList.add(n);const o=t.style?.backgroundImage,i=t.dataset?.snapdomHasIcon;o&&"none"!==o&&(t.style.backgroundImage=o),i&&(t.style.verticalAlign="middle",t.style.display="inline")}for(const[t,e]of n.nodeMap.entries()){const n=e.scrollLeft,o=e.scrollTop;if((n||o)&&t instanceof HTMLElement){t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";const e=document.createElement("div");for(e.style.transform=`translate(${-n}px, ${-o}px)`,e.style.willChange="transform",e.style.display="inline-block",e.style.width="100%";t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}}if(function(t,e){if(!t||!e)return;const n=t.scrollTop||0;if(!n)return;"static"===getComputedStyle(e).position&&(e.style.position="relative");const o=t.getBoundingClientRect(),i=t.clientHeight,r="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){const s=a.currentNode,c=getComputedStyle(s),l=c.position;if("sticky"!==l&&"-webkit-sticky"!==l)continue;const u=Pe(c.top),d=Pe(c.bottom);if(null==u&&null==d)continue;const h=Fe(e,Ne(s,t),r);if(!h)continue;const m=s.getBoundingClientRect(),f=m.width,p=m.height,g=m.left-o.left;if(!(f>0&&p>0))continue;if(!Number.isFinite(g))continue;const y=null!=u?u+n:n+(i-p-d);if(!Number.isFinite(y))continue;const w=Number.parseInt(c.zIndex,10),b=Number.isFinite(w),v=b?Math.max(w,1)+1:2,x=b?w-1:0,S=h.cloneNode(!1);S.setAttribute(r,"1"),S.style.position="sticky",S.style.left=`${g}px`,S.style.top=`${y}px`,S.style.width=`${f}px`,S.style.height=`${p}px`,S.style.visibility="hidden",S.style.zIndex=String(x),S.style.overflow="hidden",S.style.background="transparent",S.style.boxShadow="none",S.style.filter="none",h.parentElement?.insertBefore(S,h),h.style.position="absolute",h.style.left=`${g}px`,h.style.top=`${y}px`,h.style.bottom="auto",h.style.zIndex=String(v),h.style.pointerEvents="none"}}(t,o instanceof HTMLElement&&o.firstElementChild instanceof HTMLElement?o.firstElementChild:o),t===n.nodeMap.get(o)){const e=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,e);const i=function(t){if(!t||"none"===t)return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(t,e)=>{const n=e.split(",").map(t=>t.trim());return 6!==n.length?`matrix(${e})`:(n[4]="0",n[5]="0",`matrix(${n.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(t,e)=>{const n=e.split(",").map(t=>t.trim());return 16!==n.length?`matrix3d(${e})`:(n[12]="0",n[13]="0",`matrix3d(${n.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}(e.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=i||""}for(const[t,e]of n.nodeMap.entries())"PRE"===e.tagName&&(t.style.marginTop="0",t.style.marginBlockStart="0");return{clone:o,classCSS:i,styleCache:n.styleCache}}var He=new Map;async function $e(t){if(wt.resource?.has(t))return wt.resource.get(t);if(He.has(t))return He.get(t);const e=(async()=>{const e=await kt(t,{as:"dataURL",silent:!0});if(!e.ok||"string"!=typeof e.data)throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return wt.resource?.set(t,e.data),e.data})();He.set(t,e);try{const n=await e;return He.set(t,n),n}catch(e){throw He.delete(t),e}}var Be=/\bblob:[^)"'\s]+/g;async function Ue(t){if(!t||-1===t.indexOf("blob:"))return t;const e=Array.from(new Set(t.match(Be)||[]));if(0===e.length)return t;let n=t;for(const t of e)try{const e=await $e(t);n=n.split(t).join(e)}catch{}return n}function Ve(t){return"string"==typeof t&&t.startsWith("blob:")}function Oe(t){return(t||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{const e=t.match(/^(\S+)(\s+.+)?$/);return e?{url:e[1],desc:e[2]||""}:null}).filter(Boolean)}function je(t){return t.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function ze(t){if(!t)return()=>{};const e=function(t){const e=getComputedStyle(t);let n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();const o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}(t);if(e<=0)return()=>{};if(!function(t){return!(t.childElementCount>0)&&Array.from(t.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}(t))return()=>{};const n=getComputedStyle(t),o=Math.round(function(t){const e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return e&&"normal"!==e?e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(1.2*n):Math.round(1.2*n)}(n)*e+function(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}(n)),i=t.textContent??"",r=i;if(t.scrollHeight<=o+.5)return()=>{};let a=0,s=i.length,c=-1;for(;a<=s;){const e=a+s>>1;t.textContent=i.slice(0,e)+"…",t.scrollHeight<=o+.5?(c=e,a=e+1):s=e-1}return t.textContent=(c>=0?i.slice(0,c):"")+"…",()=>{t.textContent=r}}async function Xe(t,e){if(!t)throw new Error("Element cannot be null or undefined");!function(t="soft"){switch(t){case"auto":return wt.session.styleMap=new Map,void(wt.session.nodeMap=new Map);case"soft":default:return wt.session.styleMap=new Map,wt.session.nodeMap=new Map,void(wt.session.styleCache=new WeakMap);case"full":return;case"disabled":wt.session.styleMap=new Map,wt.session.nodeMap=new Map,wt.session.styleCache=new WeakMap,wt.computedStyle=new WeakMap,wt.baseStyle=new Map,wt.defaultStyle=new Map,wt.image=new Map,wt.background=new Map,wt.resource=new Map,wt.font=new Set}}(e.cache);const n=e.fast,o=!!e.straighten,i=!!e.noShadows;let r,a,s,c,l,u="",d="",h=null;const m=ze(t);try{({clone:r,classCSS:a,styleCache:s}=await De(t,e)),o&&r&&(h=function(t,e){if(!t||!e||!e.style)return null;const n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}const o=n.transform||"none";if("none"===o)try{const n=Ge(t);if(1===n.a&&0===n.b&&0===n.c&&1===n.d)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}const i=o.match(/^matrix\(\s*([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t.trim()));if(6===t.length&&t.every(Number.isFinite)){const[n,o,i,r]=t,a=Math.sqrt(n*n+o*o)||0;let s=0,c=0,l=0,u=0,d=0,h=0;a>0&&(s=n/a,c=o/a,l=s*i+c*r,u=i-s*l,d=r-c*l,h=Math.sqrt(u*u+d*d)||0,h>0?l/=h:l=0);const m=a,f=0,p=l*h,g=h;try{e.style.transform=`matrix(${m}, ${f}, ${p}, ${g}, 0, 0)`}catch{}return{a:m,b:f,c:p,d:g}}}try{const t=String(o).trim();return e.style.transform=t+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}(t,r)),i&&r&&function(t,e){if(!t||!e||!e.style)return;const n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}const o=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch{}}(t,r)}finally{m()}await new Promise(t=>{Bt(async()=>{await async function(t,e={}){const n=Array.from(t.querySelectorAll("img")),o=async t=>{if(!t.getAttribute("src")){const e=t.currentSrc||t.src||"";e&&t.setAttribute("src",e)}t.removeAttribute("srcset"),t.removeAttribute("sizes");const n=t.src||"";if(!n)return;const o=await kt(n,{as:"dataURL",useProxy:e.useProxy});if(o.ok&&"string"==typeof o.data&&o.data.startsWith("data:"))return t.src=o.data,t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100));const{fallbackURL:i}=e||{};if(i)try{const o=parseInt(t.dataset?.snapdomWidth||"",10)||0,r=parseInt(t.dataset?.snapdomHeight||"",10)||0,a=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,c=parseFloat(t.style?.width||"")||0,l=parseFloat(t.style?.height||"")||0,u=o||c||a||t.width||void 0,d=r||l||s||t.height||void 0,h="function"==typeof i?await i({width:u,height:d,src:n,element:t}):i;if(h){const n=await kt(h,{as:"dataURL",useProxy:e.useProxy});return t.src=n.data,!t.width&&u&&(t.width=u),!t.height&&d&&(t.height=d),t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100))}}catch{}const r=t.width||t.naturalWidth||100,a=t.height||t.naturalHeight||100;if(!1!==e.placeholders){const e=document.createElement("div");e.style.cssText=[`width:${r}px`,`height:${a}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${a}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),e.textContent="img",t.replaceWith(e)}else{const e=document.createElement("div");e.style.cssText=`display:inline-block;width:${r}px;height:${a}px;visibility:hidden;`,t.replaceWith(e)}};for(let t=0;t<n.length;t+=4){const e=n.slice(t,t+4).map(o);await Promise.allSettled(e)}}(r,e),t()},{fast:n})}),await new Promise(o=>{Bt(async()=>{await async function(t,e,n,o={}){const i=[[t,e]],r=["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"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){const[t,e]=i.shift(),c=n.get(t)||Dt(t);n.has(t)||n.set(t,c);const l=(()=>{const t=c.getPropertyValue("border-image"),e=c.getPropertyValue("border-image-source");return t&&"none"!==t||e&&"none"!==e})();for(const t of r){const n=c.getPropertyValue(t);if(!n||"none"===n)continue;const i=$t(n),r=await Promise.all(i.map(t=>Lt(t,o)));r.some(t=>t&&"none"!==t&&!/^url\(undefined/.test(t))&&e.style.setProperty(t,r.join(", "))}for(const t of a){const n=c.getPropertyValue(t);n&&"initial"!==n&&e.style.setProperty(t,n)}if(l)for(const t of s){const n=c.getPropertyValue(t);n&&"initial"!==n&&e.style.setProperty(t,n)}const u=Array.from(t.children),d=Array.from(e.children);for(let t=0;t<Math.min(u.length,d.length);t++)i.push([u[t],d[t]])}}(t,r,s,e),o()},{fast:n})}),e.embedFonts&&await new Promise(o=>{Bt(async()=>{const n=xe(t),i=function(t){const e=new Set,n=t=>{if(t)for(const n of t)e.add(n.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){const t=o.currentNode;if(t.nodeType===Node.TEXT_NODE)n(t.nodeValue||"");else if(t.nodeType===Node.ELEMENT_NODE){const o=t;for(const t of["::before","::after"]){const i=getComputedStyle(o,t),r=i?.getPropertyValue("content");if(r&&"none"!==r)if(/^"/.test(r)||/^'/.test(r))n(r.slice(1,-1));else{const t=r.match(/\\[0-9A-Fa-f]{1,6}/g);if(t)for(const n of t)try{e.add(parseInt(n.slice(1),16))}catch{}}}}}return e}(t);if(Ut()){const t=new Set(Array.from(n).map(t=>String(t).split("__")[0]).filter(Boolean));await async function(t,e=2){try{await document.fonts.ready}catch{}const n=Array.from(t||[]).filter(Boolean);if(0===n.length)return;const o=()=>{const t=document.createElement("div");t.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(const e of n){const n=document.createElement("span");n.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",n.style.fontFamily=`"${e}"`,n.style.fontWeight="700",n.style.fontStyle="italic",n.style.fontSize="32px",n.style.lineHeight="1",n.style.whiteSpace="nowrap",n.style.margin="0",n.style.padding="0",t.appendChild(n)}document.body.appendChild(t),t.offsetWidth,document.body.removeChild(t)};for(let t=0;t<Math.max(1,e);t++)o(),await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t)))}(t,1)}u=await ve({required:n,usedCodepoints:i,exclude:e.excludeFonts,useProxy:e.useProxy}),o()},{fast:n})});const f=function(t){const e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),"function"==typeof t.querySelectorAll&&t.querySelectorAll("*").forEach(t=>e.add(t.tagName.toLowerCase())),Array.from(e))}(r).sort(),p=f.join(",");wt.baseStyle.has(p)?d=wt.baseStyle.get(p):await new Promise(t=>{Bt(()=>{d=function(t){const e=new Map;for(let n of t){const t=wt.defaultStyle.get(n);if(!t)continue;const o=Object.entries(t).map(([t,e])=>`${t}:${e};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(n))}let n="";for(let[t,o]of e.entries())n+=`${o.join(",")} { ${t} }\n`;return n}(f),wt.baseStyle.set(p,d),t()},{fast:n})}),await new Promise(s=>{Bt(()=>{const n=getComputedStyle(t);const m=t.getBoundingClientRect(),f=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(n.width)||m.width||1)),p=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(n.height)||m.height||1)),g=(t,e=NaN)=>{const n="string"==typeof t?parseFloat(t):t;return Number.isFinite(n)?n:e},y=g(e.width),w=g(e.height);let b=f,v=p;const x=Number.isFinite(y),S=Number.isFinite(w),C=p>0?f/p:1;x&&S?(b=Math.max(1,Math.ceil(y)),v=Math.max(1,Math.ceil(w))):x?(b=Math.max(1,Math.ceil(y)),v=Math.max(1,Math.ceil(b/(C||1)))):S?(v=Math.max(1,Math.ceil(w)),b=Math.max(1,Math.ceil(v*(C||1)))):(b=f,v=p);let E=0,M=0,k=f,A=p;if(o&&h&&Number.isFinite(h.a)){const t=Ze(f,p,{a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},0,0);E=t.minX,M=t.minY,k=t.maxX,A=t.maxY}else{if(!o&&function(t){const e=getComputedStyle(t),n=e.transform||"none";if("none"!==n&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;const o=e.rotate&&"none"!==e.rotate&&"0deg"!==e.rotate,i=e.scale&&"none"!==e.scale&&"1"!==e.scale,r=e.translate&&"none"!==e.translate&&"0px 0px"!==e.translate;return Boolean(o||i||r)}(t)){const e=n.transform&&"none"!==n.transform?n.transform:"",o=function(t){const e={rotate:"0deg",scale:null,translate:null},n="function"==typeof t.computedStyleMap?t.computedStyleMap():null;if(n){const o=t=>{try{return"function"!=typeof n.has||n.has(t)?"function"!=typeof n.get?null:n.get(t):null}catch{return null}},i=o("rotate");if(i)if(i.angle){const t=i.angle;e.rotate="rad"===t.unit?180*t.value/Math.PI+"deg":t.value+t.unit}else i.unit?e.rotate="rad"===i.unit?180*i.value/Math.PI+"deg":i.value+i.unit:e.rotate=String(i);else{const n=getComputedStyle(t);e.rotate=n.rotate&&"none"!==n.rotate?n.rotate:"0deg"}const r=o("scale");if(r){const t="x"in r&&null!=r.x?.value?r.x.value:Array.isArray(r)?r[0]?.value:Number(r)||1,n="y"in r&&null!=r.y?.value?r.y.value:Array.isArray(r)?r[1]?.value:t;e.scale=`${t} ${n}`}else{const n=getComputedStyle(t);e.scale=n.scale&&"none"!==n.scale?n.scale:null}const a=o("translate");if(a){const t="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,n="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,o="x"in a&&a.x?.unit?a.x.unit:"px",i="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${t}${o} ${n}${i}`}else{const n=getComputedStyle(t);e.translate=n.translate&&"none"!==n.translate?n.translate:null}return e}const o=getComputedStyle(t);return e.rotate=o.rotate&&"none"!==o.rotate?o.rotate:"0deg",e.scale=o.scale&&"none"!==o.scale?o.scale:null,e.translate=o.translate&&"none"!==o.translate?o.translate:null,e}(t),i=function(t){const e=function(){if(Ye)return Ye;const t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),Ye=t,t}(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform);t.rotate&&(n.style.rotate=t.rotate);t.scale&&(n.style.scale=t.scale);t.translate&&(n.style.translate=t.translate);e.appendChild(n);const o=Ge(n);return e.removeChild(n),o}({baseTransform:e,rotate:o.rotate||"0deg",scale:o.scale,translate:o.translate}),{ox:r,oy:a}=function(t,e,n){const o=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,r]=[o[0]||"0",o[1]||"0"],a=(t,e)=>{const n=t.toLowerCase();return"left"===n||"top"===n?0:"center"===n?e/2:"right"===n||"bottom"===n?e:n.endsWith("px")?parseFloat(n)||0:n.endsWith("%")?(parseFloat(n)||0)*e/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:a(i,e),oy:a(r,n)}}(n,f,p),s=Ze(f,p,i.is2D?i:new DOMMatrix(i.toString()),r,a);E=s.minX,M=s.minY,k=s.maxX,A=s.maxY}}const L=function(t){const e=t.boxShadow||"";if(!e||"none"===e)return{top:0,right:0,bottom:0,left:0};const n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(t=>t.trim());let o=0,i=0,r=0,a=0;for(const t of n){const e=t.match(/-?\d+(\.\d+)?px/g)?.map(t=>parseFloat(t))||[];if(e.length<2)continue;const[n,s,c=0,l=0]=e,u=Math.abs(n)+c+l,d=Math.abs(s)+c+l;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),r=Math.max(r,d+Math.max(s,0)),o=Math.max(o,d+Math.max(-s,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(r),left:Math.ceil(a)}}(n),I=function(t){const e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}(n),R=function(t){if("none"===(t.outlineStyle||"none"))return{top:0,right:0,bottom:0,left:0};const e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}(n),T=function(t){const e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||"none"===e)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};const n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[];let o=0,i=0,r=0,a=0,s=!1;for(const t of n){s=!0;const e=t.match(/-?\d+(?:\.\d+)?px/gi)?.map(t=>parseFloat(t))||[],[n=0,c=0,l=0]=e,u=Math.abs(n)+l,d=Math.abs(c)+l;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),r=Math.max(r,d+Math.max(c,0)),o=Math.max(o,d+Math.max(-c,0))}return{bleed:{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(r),left:Math.ceil(a)},has:s}}(n),P=i?{top:0,right:0,bottom:0,left:0}:{top:L.top+I.top+R.top+T.bleed.top,right:L.right+I.right+R.right+T.bleed.right,bottom:L.bottom+I.bottom+R.bottom+T.bleed.bottom,left:L.left+I.left+R.left+T.bleed.left};E-=P.left,M-=P.top,k+=P.right,A+=P.bottom;const N=Math.max(1,Math.ceil(k-E)),F=Math.max(1,Math.ceil(A-M)),W=Math.max(1,Math.round(N*(x||S?b/f:1))),D=Math.max(1,Math.round(F*(S||x?v/p:1))),H="http://www.w3.org/2000/svg",$=(Ut()?1:0)+(o?1:0),B=document.createElementNS(H,"foreignObject"),U=Math.floor(E),V=Math.floor(M);B.setAttribute("x",String(-(U-$))),B.setAttribute("y",String(-(V-$))),B.setAttribute("width",String(Math.ceil(f+2*$))),B.setAttribute("height",String(Math.ceil(p+2*$))),B.style.overflow="visible";const O=document.createElement("style");O.textContent=d+u+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a,B.appendChild(O);const j=document.createElement("div");j.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),j.style.width=`${f}px`,j.style.height=`${p}px`,j.style.overflow="visible",r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),j.appendChild(r),B.appendChild(j);const z=(new XMLSerializer).serializeToString(B),X=N+2*$,Z=F+2*$,G=x||S;e.meta={w0:f,h0:p,vbW:X,vbH:Z,targetW:b,targetH:v};const Y=Ut()&&G?X:W+2*$,_=Ut()&&G?Z:D+2*$;l=`<svg xmlns="${H}" width="${Y}" height="${_}" viewBox="0 0 ${X} ${Z}">`+z+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,s()},{fast:n})});const g=document.getElementById("snapdom-sandbox");return g&&"absolute"===g.style.position&&g.remove(),c}function Ze(t,e,n,o,i){const r=n.a,a=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(t,e){let n=t-o,d=e-i,h=r*n+s*d,m=a*n+c*d;return h+=o+l,m+=i+u,[h,m]}const h=[d(0,0),d(t,0),d(0,e),d(t,e)];let m=1/0,f=1/0,p=-1/0,g=-1/0;for(const[t,e]of h)t<m&&(m=t),e<f&&(f=e),t>p&&(p=t),e>g&&(g=e);return{minX:m,minY:f,maxX:p,maxY:g,width:p-m,height:g-f}}function Ge(t){const e=getComputedStyle(t).transform;if(!e||"none"===e)return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Ye=null;function _e(t){const e=function(t){let e=[],n="",o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&o++,")"===r&&(o=Math.max(0,o-1)),";"===r&&0===o?(e.push(n),n=""):n+=r}return n.trim()&&e.push(n),e.map(t=>t.trim()).filter(Boolean)}(t);let n=null,o=null,i=null;const r=[];for(const t of e){const e=t.indexOf(":");if(e<0)continue;const a=t.slice(0,e).trim().toLowerCase(),s=t.slice(e+1).trim();"box-shadow"===a?i=s:"filter"===a?n=s:"-webkit-filter"===a?o=s:r.push([a,s])}if(i){const t=function(t){const e=[];let n="",o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&o++,")"===r&&(o=Math.max(0,o-1)),","===r&&0===o?(e.push(n.trim()),n=""):n+=r}n.trim()&&e.push(n.trim());const i=[];for(const t of e){if(/\binset\b/i.test(t))continue;const e=t.match(/-?\d+(?:\.\d+)?px/gi)||[],[n="0px",o="0px",r="0px"]=e;let a=t.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," ");const s=!!a&&","!==a;i.push(`drop-shadow(${n} ${o} ${r}${s?` ${a}`:""})`)}return i.join(" ")}(i);t&&(n=n?`${n} ${t}`:t,o=o?`${o} ${t}`:t)}const a=[...r];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([t,e])=>`${t}:${e}`).join(";")}function qe(t){return t=(t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,e)=>t.replace(e,function(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(t,e,n)=>`${e}{${_e(n)}}`)}(e)))).replace(/style=(['"])([\s\S]*?)\1/gi,(t,e,n)=>`style=${e}${_e(n)}${e}`)}function Je(t){if(!Ut()||("string"!=typeof(e=t)||!/^data:image\/svg\+xml/i.test(e)))return t;var e;try{const e=function(t){const e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}(t),n=qe(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}catch{return t}}async function Qe(t,e){let{width:n,height:o,scale:i=1,dpr:r=1,meta:a={}}=e;t=Je(t);const s=new Image;s.loading="eager",s.decoding="sync",s.crossOrigin="anonymous",s.src=t,await s.decode();const c=s.naturalWidth,l=s.naturalHeight,u=Number.isFinite(a.w0)?a.w0:c,d=Number.isFinite(a.h0)?a.h0:l;let h,m;const f=Number.isFinite(n),p=Number.isFinite(o);if(f&&p)h=Math.max(1,n),m=Math.max(1,o);else if(f){const t=n/Math.max(1,u);h=n,m=Math.round(d*t)}else if(p){const t=o/Math.max(1,d);m=o,h=Math.round(u*t)}else h=c,m=l;h=Math.round(h*i),m=Math.round(m*i);const g=document.createElement("canvas");g.width=Math.ceil(h*r),g.height=Math.ceil(m*r),g.style.width=`${h}px`,g.style.height=`${m}px`;const y=g.getContext("2d");return 1!==r&&y.scale(r,r),y.drawImage(s,0,0,h,m),g}async function Ke(t,e){const n=await Qe(t,e),o=e.backgroundColor?At(n,e.backgroundColor):n,i=new Image;return i.src=o.toDataURL(`image/${e.format}`,e.quality),await i.decode(),i.style.width=o.width/e.dpr+"px",i.style.height=o.height/e.dpr+"px",i}async function tn(t,e){const{scale:n=1,width:o,height:i,meta:r={}}=e,a=Number.isFinite(o),s=Number.isFinite(i),c=Number.isFinite(n)&&1!==n||a||s;if(Ut()&&c){return await Ke(t,{...e,format:"png",quality:1,meta:r})}const l=new Image;if(l.decoding="sync",l.loading="eager",l.src=t,await l.decode(),a&&s)l.style.width=`${o}px`,l.style.height=`${i}px`;else if(a){const t=Number.isFinite(r.w0)?r.w0:l.naturalWidth,e=Number.isFinite(r.h0)?r.h0:l.naturalHeight,n=o/Math.max(1,t);l.style.width=`${o}px`,l.style.height=`${Math.round(e*n)}px`}else if(s){const t=Number.isFinite(r.w0)?r.w0:l.naturalWidth,e=Number.isFinite(r.h0)?r.h0:l.naturalHeight,n=i/Math.max(1,e);l.style.height=`${i}px`,l.style.width=`${Math.round(t*n)}px`}else{const e=Math.round(l.naturalWidth*n),o=Math.round(l.naturalHeight*n);if(l.style.width=`${e}px`,l.style.height=`${o}px`,"string"==typeof t&&t.startsWith("data:image/svg+xml"))try{const n=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${e}"`).replace(/height="[^"]*"/,`height="${o}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,l.src=t}catch{}}return l}async function en(t,e){const n=e.type;if("svg"===n){const e=decodeURIComponent(t.split(",")[1]);return new Blob([e],{type:"image/svg+xml"})}const o=await Qe(t,e),i=e.backgroundColor?At(o,e.backgroundColor):o;return new Promise(t=>i.toBlob(e=>t(e),`image/${n}`,e.quality))}var nn=Symbol("snapdom.internal"),on=!1;async function rn(t,e){if(!t)throw new Error("Element cannot be null or undefined");const n=function(t={}){const e=t.format??"png",n=function(t){if("string"==typeof t){const e=t.toLowerCase().trim();if("disabled"===e||"full"===e||"auto"===e||"soft"===e)return e}return"soft"}(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:!1!==t.placeholders,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:"string"==typeof t.useProxy?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpg","jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",straighten:t.straighten??!1,noShadows:t.noShadows??!1}}(e);if(Ut()&&(!0===n.embedFonts||function(t){const e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){const t=e.currentNode,n=getComputedStyle(t),o=n.backgroundImage&&"none"!==n.backgroundImage,i=n.maskImage&&"none"!==n.maskImage||n.webkitMaskImage&&"none"!==n.webkitMaskImage;if(o||i)return!0}return!1}(t)))for(let n=0;n<3;n++)try{await an(t,e),on=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&function(t){const e=Array.isArray(t)?t:[t];for(const t of e)t instanceof RegExp?ee.push(t):"string"==typeof t&&ee.push(new RegExp(t,"i"))}(n.iconFonts),n.snap||(n.snap={toPng:(t,e)=>rn.toPng(t,e),toSvg:(t,e)=>rn.toSvg(t,e)}),rn.capture(t,n,nn)}async function an(t,e){if(on)return;const n={...e,fast:!0,embedFonts:!0,scale:.2};let o;try{o=await Xe(t,n)}catch{return}await new Promise(t=>{const e=new Image;e.decoding="sync",e.loading="eager",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.width="10px",e.style.height="10px",e.style.opacity="0.01",e.style.transform="translateZ(10px)",e.style.willChange="transform,opacity;",e.src=o;document.body.appendChild(e),(async()=>{await new Promise(t=>setTimeout(t,100)),e&&e.parentNode&&e.parentNode.removeChild(e),on=!0,t()})()})}rn.capture=async(t,e,n)=>{if(n!==nn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");const o=await Xe(t,e),i=t=>({...e,...t||{}}),r=t=>e=>{const n=i({...e||{},format:t}),r="jpeg"===t||"jpg"===t,a=null==n.backgroundColor||"transparent"===n.backgroundColor;return r&&a&&(n.backgroundColor="#ffffff"),Ke(o,n)};return{url:o,toRaw:()=>o,toImg:t=>tn(o,i(t)),toSvg:t=>tn(o,i(t)),toCanvas:t=>Qe(o,i(t)),toBlob:t=>en(o,i(t)),toPng:r("png"),toJpg:r("jpeg"),toWebp:r("webp"),download:t=>async function(t,e){if(e.dpr=1,"svg"===e.format){const n=await en(t,{...e,type:"svg"}),o=URL.createObjectURL(n),i=document.createElement("a");return i.href=o,i.download=e.filename,i.click(),void URL.revokeObjectURL(o)}const n=await Qe(t,e),o=e.backgroundColor?At(n,e.backgroundColor):n,i=document.createElement("a");i.href=o.toDataURL(`image/${e.format}`,e.quality),i.download=e.filename,i.click()}(o,i(t))}},rn.toRaw=(t,e)=>rn(t,e).then(t=>t.toRaw()),rn.toImg=(t,e)=>rn(t,e).then(t=>t.toImg()),rn.toSvg=(t,e)=>rn(t,e).then(t=>t.toSvg()),rn.toCanvas=(t,e)=>rn(t,e).then(t=>t.toCanvas()),rn.toBlob=(t,e)=>rn(t,e).then(t=>t.toBlob()),rn.toPng=(t,e)=>rn(t,{...e,format:"png"}).then(t=>t.toPng()),rn.toJpg=(t,e)=>rn(t,{...e,format:"jpeg"}).then(t=>t.toJpg()),rn.toWebp=(t,e)=>rn(t,{...e,format:"webp"}).then(t=>t.toWebp()),rn.download=(t,e)=>rn(t,e).then(t=>t.download());class sn{constructor(t,e={}){this.targetElement=null,this.isRunning=!1,this.screenshotCount=0,this.screenshotHistory=[],this.lastScreenshotTime=0,this.error=null,this.isEnabled=!1,this.isUploading=!1,this.uploadError=null,this.uploadProgress={success:0,failed:0},this.currentUploadConfig=null,this.worker=null,this.screenshotTimer=null,this.screenshotContext=null,this.messageHandler=null,this.dynamicInterval=null,this.expirationTimer=null,this.imageProxyCache=new Map,this.indexedDBCache=null,this.indexedDBReady=!1,this.intersectionObserver=null,this.visibleElementsCache=new Set,this.preconnected=!1,this.imageDownloadQueue=new Map,this.activeDownloads=new Set,this.maxConcurrentImageDownloads=5,this.globalErrorHandler=null,this.globalRejectionHandler=null,this.targetElement=t,this.options={interval:e.interval??5e3,quality:e.quality??.3,scale:e.scale??1,maxHistory:e.maxHistory??10,compress:e.compress??!1,maxWidth:e.maxWidth??1600,maxHeight:e.maxHeight??900,outputFormat:e.outputFormat??"webp",enableCORS:e.enableCORS??!0,proxyUrl:e.proxyUrl??"",useProxy:e.useProxy??!0,engine:e.engine??"modern-screenshot",corsMode:e.corsMode??"canvas-proxy",silentMode:e.silentMode??!1,maxRetries:e.maxRetries??2,preloadImages:e.preloadImages??!1,maxConcurrentDownloads:e.maxConcurrentDownloads??10,onlyVisibleImages:e.onlyVisibleImages??!0,imageCacheTTL:e.imageCacheTTL??6e5,useIndexedDB:e.useIndexedDB??!0,usePreconnect:e.usePreconnect??!0,imageLoadTimeout:e.imageLoadTimeout??5e3,useIntersectionObserver:e.useIntersectionObserver??!0,fetchPriority:e.fetchPriority??"high",maxCacheSize:e.maxCacheSize??50,maxCacheAge:e.maxCacheAge??864e5,maxImageSize:e.maxImageSize??5,skipLargeImages:e.skipLargeImages??!0},this.setupMessageListener(),this.setupVisibilityChangeListener(),this.startCacheCleanup(),this.options.usePreconnect&&this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()&&this.preconnectProxy(),this.options.useIntersectionObserver&&this.options.onlyVisibleImages&&this.initIntersectionObserver(),this.options.useIndexedDB&&this.initIndexedDB().catch(()=>{this.options.silentMode})}setTargetElement(t){if(this.targetElement!==t&&this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}this.targetElement=t}setupMessageListener(){this.messageHandler||(this.messageHandler=t=>{this.handleIframeMessage(t)},window.addEventListener("message",this.messageHandler))}setupVisibilityChangeListener(){document.addEventListener("visibilitychange",()=>{document.hidden,this.options.silentMode})}handleIframeMessage(t){try{if(!t.data||"checkScreenshot"!==t.data.type)return;this.options.silentMode;const e=this.parseUploadConfig(t.data.data);if(!e)return void(this.uploadError="解析上传配置失败");this.currentUploadConfig=e;const n=Date.now();if(!(e.ttl>0&&e.ttl>n))return this.options.silentMode||e.ttl,this.stopScreenshot(),this.isEnabled=!1,this.currentUploadConfig=null,void(this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null));{this.isEnabled||(this.options.silentMode,this.isEnabled=!0),this.dynamicInterval=e.duration||this.options.interval;const t=e.ttl-n;if(!this.options.silentMode){Math.ceil(t/6e4)}this.takeScreenshotAndUpload(e),this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null),this.expirationTimer=setTimeout(()=>{this.options.silentMode,this.stopScreenshot(),this.isEnabled=!1,this.currentUploadConfig=null,this.expirationTimer=null},t)}}catch(t){this.uploadError=t instanceof Error?t.message:String(t)}}async takeScreenshotAndUpload(t){this.isRunning&&(this.options.silentMode,this.stopScreenshot()),this.startScreenshot(this.dynamicInterval||t.duration||this.options.interval);try{if(await this.takeScreenshot()){await new Promise(t=>setTimeout(t,100));const e=this.getLatestScreenshot();e?(this.isUploading=!0,this.uploadError=null,this.uploadScreenshot(e,t).then(t=>{t&&this.options.silentMode}).catch(t=>{this.uploadError=t instanceof Error?t.message:String(t)}).finally(()=>{this.isUploading=!1})):this.options.silentMode}}catch(t){this.uploadError=t instanceof Error?t.message:String(t)}}parseUploadConfig(t){try{const e="string"==typeof t?t:JSON.stringify(t),n=JSON.parse(e);return n.uploadUrl&&n.contentType?(("number"!=typeof n.duration||n.duration<=0)&&(n.duration=this.options.interval),"number"!=typeof n.ttl&&("number"==typeof n.expirationMinutes&&n.expirationMinutes>0?n.ttl=Date.now()+60*n.expirationMinutes*1e3:n.ttl=0),n):null}catch(t){return null}}startScreenshot(t){if(!this.isEnabled)return;const e=t||this.dynamicInterval||this.options.interval;this.isRunning&&(this.options.silentMode,this.stopScreenshot()),this.options.silentMode,this.isRunning=!0,!this.worker&&this.options.compress&&(this.worker=this.createWorker()),this.screenshotTimer=setInterval(async()=>{if(this.isRunning&&this.isEnabled&&!document.hidden&&(await this.takeScreenshot(),this.currentUploadConfig)){const t=this.getLatestScreenshot();t&&!this.isUploading&&this.uploadScreenshot(t,this.currentUploadConfig).catch(t=>{})}},e)}stopScreenshot(){this.isRunning&&(this.options.silentMode,this.isRunning=!1,this.screenshotTimer&&(clearInterval(this.screenshotTimer),this.screenshotTimer=null))}async captureOnce(t=!1){return!(!this.isEnabled&&!t)&&await this.takeScreenshot()}async takeScreenshot(){if(!this.targetElement)return!1;this.setupGlobalErrorHandlers();try{this.options.silentMode,await Promise.all([this.waitForStylesAndFonts(),this.waitForFonts()]),await new Promise(t=>requestAnimationFrame(()=>{requestAnimationFrame(()=>t())}));const t=this.options.engine||"modern-screenshot";let e;this.options.silentMode,this.options.preloadImages&&this.options.enableCORS&&"modern-screenshot"===t?(this.cleanExpiredCache(),this.options.useIndexedDB&&await this.cleanIndexedDBCache(),await this.preprocessNetworkImages(this.targetElement),await this.waitForImagesToLoad(this.targetElement)):(this.cleanExpiredCache(),this.options.useIndexedDB&&await this.cleanIndexedDBCache()),await new Promise(t=>setTimeout(t,50)),e="snapdom"===t?await this.takeScreenshotWithSnapdom(this.targetElement):"html2canvas"===t?await this.takeScreenshotWithHtml2Canvas(this.targetElement):await this.takeScreenshotWithModernScreenshot(this.targetElement);const n=Date.now();this.screenshotCount++,this.lastScreenshotTime=n,this.screenshotHistory.length>=this.options.maxHistory&&this.screenshotHistory.shift(),this.screenshotHistory.push(e);e.split(",")[1];this.options.silentMode;const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4;return this.options.compress&&!o&&!i&&this.worker&&(this.options.silentMode,this.worker.postMessage({type:"COMPRESS_IMAGE",data:{dataUrl:e,maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,quality:this.options.quality,outputFormat:this.options.outputFormat,timestamp:n,count:this.screenshotCount}})),this.error=null,!0}catch(t){const e=t instanceof Error?t.message:String(t);return e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin")||e.includes("XMLHttpRequest")||e.includes("Status:0")?this.options.silentMode:this.error=e,!1}finally{this.removeGlobalErrorHandlers()}}async takeScreenshotWithSnapdom(t){this.options.silentMode;try{const e=t.getBoundingClientRect();if(0===e.width||0===e.height)throw new Error("元素尺寸为 0,无法截图");const n={};if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){let t=this.options.proxyUrl.trim();t.includes("?url=")||(t=t.endsWith("?")?t+"url=":t+"?url="),n.useProxy=t,this.options.silentMode}else this.options.silentMode||this.options.useProxy&&(!this.options.proxyUrl||this.options.proxyUrl.trim());let o;switch(this.options.outputFormat||"png"){case"jpeg":o=await rn.toJpg(t,n);break;case"webp":o=await rn.toWebp(t,n);break;default:o=await rn.toPng(t,n)}const i=o.src;if(!i||i.length<100)throw new Error("生成的 base64 数据无效或过短");return this.options.silentMode,i}catch(t){const e=t instanceof Error?t.message:String(t);throw("EncodingError"===(t instanceof Error?t.name:"Unknown")||e.includes("cannot be decoded")||e.includes("CORS")||e.includes("cross-origin"))&&this.options.silentMode,t}}async takeScreenshotWithHtml2Canvas(t){this.options.silentMode;try{const n=t.getBoundingClientRect();if(0===n.width||0===n.height)throw new Error("元素尺寸为 0,无法截图");const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4;let r=t.scrollWidth||t.clientWidth||t.offsetWidth,a=t.scrollHeight||t.clientHeight||t.offsetHeight;t!==document.body&&t!==document.documentElement||(r=Math.max(t.scrollWidth,t.offsetWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth,window.innerWidth),a=Math.max(t.scrollHeight,t.offsetHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight,window.innerHeight));const{width:s,height:c}=this.calculateCompressedSize(r,a,this.options.maxWidth,this.options.maxHeight),l=s<r?s:Math.min(r,this.options.maxWidth),u=c<a?c:Math.min(a,this.options.maxHeight),d=o||i?Math.max(.65*this.options.quality,.2):this.options.quality,h={backgroundColor:"#ffffff",scale:1!==this.options.scale?o?.7:this.options.scale:o?.7:1,useCORS:this.options.enableCORS,allowTaint:!this.options.enableCORS,logging:!this.options.silentMode,width:l,height:u,removeContainer:!0,imageTimeout:this.options.imageLoadTimeout||5e3,ignoreElements:t=>{const e=window.getComputedStyle(t);return"none"===e.display||"hidden"===e.visibility||"0"===e.opacity}};this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()&&(h.onclone=t=>{t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src");if(!e)return;try{if(new URL(e,window.location.href).origin===window.location.origin)return}catch{}const n=this.getCachedImage(e);n&&(t.src=n)})}),this.options.silentMode;const m=await e(t,h);let f,p="image/png";if("webp"!==this.options.outputFormat||o)"jpeg"===this.options.outputFormat&&(p="image/jpeg",f=d);else try{const t=document.createElement("canvas");t.width=1,t.height=1;-1!==t.toDataURL("image/webp").indexOf("webp")&&(p="image/webp",f=d)}catch{p="image/jpeg",f=d}const g="image/png"===p?m.toDataURL(p):m.toDataURL(p,f);if(!g||g.length<100)throw new Error("生成的截图数据无效或过短");return this.options.silentMode,g}catch(t){const e=t instanceof Error?t.message:String(t);throw this.options.silentMode||e.includes("CORS")||e.includes("cross-origin"),t}}async takeScreenshotWithModernScreenshot(t){let e,n;this.options.silentMode,t===document.body||t===document.documentElement?(e=Math.max(t.scrollWidth,t.offsetWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth,window.innerWidth),n=Math.max(t.scrollHeight,t.offsetHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight,window.innerHeight)):(e=t.scrollWidth||t.clientWidth||t.offsetWidth,n=t.scrollHeight||t.clientHeight||t.offsetHeight),this.options.silentMode||t===document.body||document.documentElement;const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,r=o||i?Math.max(.65*this.options.quality,.2):this.options.quality,{width:a,height:s}=this.calculateCompressedSize(e,n,this.options.maxWidth,this.options.maxHeight),c=a<e?a:Math.min(e,this.options.maxWidth),l=s<n?s:Math.min(n,this.options.maxHeight),u=t.getBoundingClientRect();if(0===u.width||0===u.height)throw new Error("元素尺寸为 0,无法截图");if(this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}const d={workerNumber:o||i?1:2,quality:r,fetchFn:async t=>{if(t.startsWith("data:")||t.startsWith("blob:"))return t;try{if(new URL(t,window.location.href).origin===window.location.origin)return t}catch(t){}if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){const e=this.getCachedImage(t);if(e)return this.options.silentMode,e;if(this.options.useIndexedDB){const e=await this.getIndexedDBCache(t);if(e)return this.setCachedImage(t,e),this.options.silentMode,e}try{const e=new URLSearchParams({url:t,maxWidth:String(this.options.maxWidth||1600),maxHeight:String(this.options.maxHeight||900),quality:String(Math.round(100*(this.options.quality||.4))),format:this.options.outputFormat||"webp"});let n=this.options.proxyUrl;n=n.replace(/[?&]$/,"");const o=`${n}?${e.toString()}`,i=new AbortController,r=setTimeout(()=>i.abort(),this.options.imageLoadTimeout);try{const e={method:"GET",mode:"cors",credentials:"omit",headers:{Accept:"image/*"},cache:"no-cache",signal:i.signal};"priority"in e&&(e.priority=this.options.fetchPriority);const n=await fetch(o,e);if(clearTimeout(r),!n.ok)throw new Error(`代理请求失败: ${n.status}`);const a=await n.blob(),s=await this.blobToDataUrl(a);return this.setCachedImage(t,s),this.options.useIndexedDB&&await this.setIndexedDBCache(t,s),s}catch(t){throw clearTimeout(r),t}}catch(e){return this.options.silentMode,t}}if(this.options.enableCORS){const e=this.getCachedImage(t);if(e)return this.options.silentMode,e;if(this.options.useIndexedDB){const e=await this.getIndexedDBCache(t);if(e)return this.setCachedImage(t,e),this.options.silentMode,e}if(this.imageDownloadQueue.has(t))return this.options.silentMode,await this.imageDownloadQueue.get(t);if(this.activeDownloads.size>=this.maxConcurrentImageDownloads)return this.options.silentMode,t;const n=this.downloadImageWithoutProxy(t);this.imageDownloadQueue.set(t,n),this.activeDownloads.add(t);try{return await n}finally{this.imageDownloadQueue.delete(t),this.activeDownloads.delete(t)}}return t},fetch:{requestInit:{cache:"no-cache"},bypassingCache:!0},maximumCanvasSize:16777216};c&&l?(d.width=c,d.height=l,this.options.silentMode||t===document.body||document.documentElement):this.options.silentMode,1!==this.options.scale?d.scale=o?.7:this.options.scale:o&&(d.scale=.7),this.options.silentMode,this.screenshotContext=await B(t,d);try{const t=await yt(this.screenshotContext);if(!t||t.length<100)throw new Error("生成的截图数据无效或过短");if("png"!==this.options.outputFormat){const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("无法获取 canvas context");const i=new Image;await new Promise((o,r)=>{i.onload=()=>{e.width=i.width,e.height=i.height,n.drawImage(i,0,0),o()},i.onerror=r,i.src=t});let a="image/jpeg",s=r;if("webp"===this.options.outputFormat&&!o)try{const t=document.createElement("canvas");t.width=1,t.height=1;-1!==t.toDataURL("image/webp").indexOf("webp")&&(a="image/webp")}catch{a="image/jpeg"}return"image/png"===a?e.toDataURL(a):e.toDataURL(a,s)}return t}catch(t){t instanceof Error?t.message:String(t);throw this.options.silentMode,t}finally{if(this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}}}preconnectProxy(){if(!this.preconnected&&this.options.proxyUrl)try{const t=new URL(this.options.proxyUrl).origin,e=document.createElement("link");e.rel="preconnect",e.href=t,e.crossOrigin="anonymous",document.head.appendChild(e),this.preconnected=!0,this.options.silentMode}catch(t){}}initIntersectionObserver(){"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting?this.visibleElementsCache.add(t.target):this.visibleElementsCache.delete(t.target)})},{root:null,rootMargin:"50px",threshold:.01}))}async initIndexedDB(){return new Promise((t,e)=>{const n=indexedDB.open("screenshot-cache",1);n.onerror=()=>e(n.error),n.onsuccess=()=>{this.indexedDBCache=n.result,this.indexedDBReady=!0,this.cleanIndexedDBCache().catch(()=>{}),t()},n.onupgradeneeded=t=>{const e=t.target.result;if(!e.objectStoreNames.contains("images")){e.createObjectStore("images",{keyPath:"url"}).createIndex("timestamp","timestamp",{unique:!1})}}})}async getIndexedDBCache(t){if(!this.indexedDBReady||!this.indexedDBCache)return null;try{const e=this.indexedDBCache.transaction(["images"],"readonly"),n=e.objectStore("images").get(t);return new Promise(e=>{n.onsuccess=()=>{const o=n.result;if(o){if(Date.now()-o.timestamp>this.options.maxCacheAge)return this.deleteIndexedDBCache(t),void e(null);e(o.dataUrl)}else e(null)},n.onerror=()=>e(null)})}catch{return null}}async setIndexedDBCache(t,e){if(this.indexedDBReady&&this.indexedDBCache)try{const n=await this.getIndexedDBCacheSize(),o=this.estimateDataUrlSize(e),i=1024*(this.options.maxCacheSize||50)*1024;n+o>i&&await this.cleanIndexedDBCacheBySize(i-o);const r=this.indexedDBCache.transaction(["images"],"readwrite");r.objectStore("images").put({url:t,dataUrl:e,timestamp:Date.now()})}catch{}}estimateDataUrlSize(t){const e=t.split(",")[1]||"";return Math.ceil(.75*e.length)+30}async getIndexedDBCacheSize(){if(!this.indexedDBReady||!this.indexedDBCache)return 0;try{const t=this.indexedDBCache.transaction(["images"],"readonly"),e=t.objectStore("images").getAll();return new Promise(t=>{e.onsuccess=()=>{const n=e.result||[];let o=0;n.forEach(t=>{o+=this.estimateDataUrlSize(t.dataUrl)}),t(o)},e.onerror=()=>t(0)})}catch{return 0}}async cleanIndexedDBCache(){if(this.indexedDBReady&&this.indexedDBCache)try{const t=this.indexedDBCache.transaction(["images"],"readwrite").objectStore("images"),e=t.index("timestamp").getAll();return new Promise(n=>{e.onsuccess=()=>{const o=e.result||[],i=Date.now(),r=[];let a=0;const s=1024*(this.options.maxCacheSize||50)*1024;o.sort((t,e)=>t.timestamp-e.timestamp),o.forEach(t=>{i-t.timestamp>this.options.maxCacheAge?r.push(t.url):a+=this.estimateDataUrlSize(t.dataUrl)});const c=[...r];if(a>s)for(const t of o)if(!r.includes(t.url)&&(a-=this.estimateDataUrlSize(t.dataUrl),c.push(t.url),a<=s))break;c.forEach(e=>{t.delete(e)}),c.length>0&&this.options.silentMode,n()},e.onerror=()=>n()})}catch{}}async cleanIndexedDBCacheBySize(t){if(this.indexedDBReady&&this.indexedDBCache)try{const e=this.indexedDBCache.transaction(["images"],"readwrite").objectStore("images"),n=e.index("timestamp").getAll();return new Promise(o=>{n.onsuccess=()=>{const i=n.result||[];i.sort((t,e)=>t.timestamp-e.timestamp);let r=0;const a=[];if(i.forEach(t=>{r+=this.estimateDataUrlSize(t.dataUrl)}),r>t)for(const e of i){if(r<=t)break;r-=this.estimateDataUrlSize(e.dataUrl),a.push(e.url)}a.forEach(t=>{e.delete(t)}),a.length>0&&this.options.silentMode,o()},n.onerror=()=>o()})}catch{}}async deleteIndexedDBCache(t){if(this.indexedDBReady&&this.indexedDBCache)try{const e=this.indexedDBCache.transaction(["images"],"readwrite");e.objectStore("images").delete(t)}catch{}}isElementVisible(t,e){if(!this.options.onlyVisibleImages)return!0;if(this.options.useIntersectionObserver&&this.intersectionObserver){if(this.visibleElementsCache.has(t))return!0;this.intersectionObserver.observe(t)}try{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect(),i=!(n.bottom<o.top||n.top>o.bottom||n.right<o.left||n.left>o.right)&&n.width>0&&n.height>0&&"none"!==window.getComputedStyle(t).display&&"hidden"!==window.getComputedStyle(t).visibility&&"0"!==window.getComputedStyle(t).opacity;return this.options.useIntersectionObserver&&this.intersectionObserver&&(i?this.visibleElementsCache.add(t):this.visibleElementsCache.delete(t)),i}catch{return!0}}async preprocessNetworkImages(t){const e=t.querySelectorAll("img"),n=Array.from(e).filter(e=>{const n=e.src.startsWith("blob:"),o=e.src.startsWith("data:"),i=e.src.startsWith(window.location.origin),r=this.isElementVisible(e,t);return!n&&!o&&!i&&r});if(0===n.length)return;if(!this.options.silentMode){e.length}if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){this.options.silentMode;const t=this.options.maxConcurrentDownloads||10,e=[];for(let o=0;o<n.length;o+=t)e.push(n.slice(o,o+t));await Promise.all(e.map(async t=>{await Promise.all(t.map(async t=>{const e=t.src;if(!this.getCachedImage(e))try{const t=await this.proxyImage(e);t&&this.setCachedImage(e,t)}catch(t){this.options.silentMode}}))})),this.options.silentMode}}async proxyImage(t){if(!this.options.proxyUrl||""===this.options.proxyUrl.trim())throw new Error("proxyUrl 未配置");const e=new URLSearchParams({url:t,maxWidth:String(this.options.maxWidth||1600),maxHeight:String(this.options.maxHeight||900),quality:String(Math.round(100*(this.options.quality||.4))),format:this.options.outputFormat||"webp"});let n=this.options.proxyUrl;n=n.replace(/[?&]$/,"");const o=`${n}?${e.toString()}`;this.options.silentMode;const i=await fetch(o,{method:"GET",mode:"cors",credentials:"omit",headers:{Accept:"image/*"}});if(!i.ok){const t=await i.text().catch(()=>"");throw new Error(`代理请求失败: ${i.status} ${i.statusText}${t?` - ${t.substring(0,200)}`:""}`)}const r=await i.blob(),a=await this.blobToDataUrl(r);return this.options.silentMode,a}async downloadImageWithoutProxy(t){try{const e=new AbortController,n=setTimeout(()=>e.abort(),this.options.imageLoadTimeout||5e3),o=await fetch(t,{method:"GET",mode:"cors",credentials:"omit",cache:"no-cache",signal:e.signal}).catch(()=>null).finally(()=>{clearTimeout(n)});if(o&&o.ok){const e=o.headers.get("content-length");if(e){const t=parseInt(e,10)/1048576;if(t>(this.options.maxImageSize||5)){if(this.options.skipLargeImages)return this.options.silentMode,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";this.options.silentMode}}const n=await o.blob(),i=n.size/1048576;if(i>(this.options.maxImageSize||5)){if(this.options.skipLargeImages)return this.options.silentMode,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";this.options.silentMode}const r=await this.blobToDataUrl(n);return this.setCachedImage(t,r),this.options.useIndexedDB&&await this.setIndexedDBCache(t,r),r}return t}catch(e){return this.options.silentMode,t}}blobToDataUrl(t){return new Promise((e,n)=>{const o=new FileReader,i=setTimeout(()=>{n(new Error("图片转换超时"))},1e4);o.onload=()=>{clearTimeout(i),e(o.result)},o.onerror=t=>{clearTimeout(i),n(t)},o.readAsDataURL(t)})}async waitForImagesToLoad(t){const e=t.querySelectorAll("img"),n=[];Array.from(e).forEach(t=>{if(t.complete)return;const e=this.options.imageLoadTimeout||5e3;n.push(Promise.race([new Promise(e=>{t.onload=()=>e(),t.onerror=()=>e()}),new Promise(t=>{setTimeout(()=>t(),e)})]))}),n.length>0&&await Promise.all(n)}async waitForStylesAndFonts(){return new Promise(t=>{requestAnimationFrame(()=>{setTimeout(()=>{t()},30)})})}async waitForFonts(){if(!document.fonts)return Promise.resolve();try{await document.fonts.ready,await new Promise(t=>setTimeout(t,100))}catch{}}calculateCompressedSize(t,e,n,o){let i=t,r=e;if(i>n||r>o){const t=n/i,e=o/r,a=Math.min(t,e);i=Math.round(i*a),r=Math.round(r*a)}return{width:i,height:r}}createWorker(){if("undefined"==typeof Worker||"undefined"==typeof OffscreenCanvas)return null;try{const t=new Blob(["\n self.onmessage = function(e) {\n const { type, data } = e.data;\n if (type === 'COMPRESS_IMAGE') {\n // 压缩逻辑(简化版)\n self.postMessage({\n type: 'SCREENSHOT_RESULT',\n data: { compressed: { dataUrl: data.dataUrl } }\n });\n }\n };\n "],{type:"application/javascript"}),e=URL.createObjectURL(t),n=new Worker(e);return n.onmessage=t=>{const{type:e,data:n}=t.data;"SCREENSHOT_RESULT"===e&&n?.compressed&&this.screenshotHistory.length>0&&(this.screenshotHistory[this.screenshotHistory.length-1]=n.compressed.dataUrl)},n.onerror=t=>{},n}catch(t){return null}}setupGlobalErrorHandlers(){this.globalErrorHandler=t=>{const e=t.message||t.error?.message||"";return!(e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin"))||(t.preventDefault(),t.stopPropagation(),!1)},this.globalRejectionHandler=t=>{const e=t.reason?.message||String(t.reason)||"";return!(e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin"))||(t.preventDefault(),!1)},window.addEventListener("error",this.globalErrorHandler,!0),window.addEventListener("unhandledrejection",this.globalRejectionHandler,!0)}removeGlobalErrorHandlers(){this.globalErrorHandler&&(window.removeEventListener("error",this.globalErrorHandler,!0),this.globalErrorHandler=null),this.globalRejectionHandler&&(window.removeEventListener("unhandledrejection",this.globalRejectionHandler,!0),this.globalRejectionHandler=null)}async uploadScreenshot(t,e){try{this.options.silentMode;const n=this.dataUrlToBlob(t,e.contentType),o=await fetch(e.uploadUrl,{method:"PUT",body:n,headers:{"Content-Type":e.contentType}});if(200===o.status||204===o.status)return this.options.silentMode,this.uploadProgress.success++,!0;{const t=await o.text().catch(()=>""),e=`上传失败: HTTP ${o.status} ${o.statusText}${t?` - ${t.substring(0,200)}`:""}`;return this.uploadError=e,this.uploadProgress.failed++,!1}}catch(t){const e=t instanceof Error?t.message:String(t);return this.uploadError=`上传异常: ${e}`,this.uploadProgress.failed++,!1}}dataUrlToBlob(t,e){const n=t.split(","),o=n[0].match(/:(.*?);/),i=o?o[1]:e,r=atob(n[1]);let a=r.length;const s=new Uint8Array(a);for(;a--;)s[a]=r.charCodeAt(a);return new Blob([s],{type:i})}getLatestScreenshot(){return this.screenshotHistory[this.screenshotHistory.length-1]||null}enable(t){this.isEnabled=t,!t&&this.isRunning&&this.stopScreenshot()}destroy(){if(this.stopScreenshot(),this.worker&&(this.worker.terminate(),this.worker=null),this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null),this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.removeGlobalErrorHandlers(),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,this.visibleElementsCache.clear()),this.indexedDBCache&&(this.indexedDBCache.close(),this.indexedDBCache=null,this.indexedDBReady=!1),this.imageProxyCache.clear()}getCachedImage(t){const e=this.imageProxyCache.get(t);if(!e)return null;return Date.now()-e.timestamp>this.options.imageCacheTTL?(this.imageProxyCache.delete(t),null):e.dataUrl}setCachedImage(t,e){this.imageProxyCache.set(t,{dataUrl:e,timestamp:Date.now()})}cleanExpiredCache(){const t=Date.now(),e=[];this.imageProxyCache.forEach((n,o)=>{t-n.timestamp>this.options.imageCacheTTL&&e.push(o)}),e.forEach(t=>{this.imageProxyCache.delete(t)}),e.length>0&&this.options.silentMode}startCacheCleanup(){setInterval(()=>{if(this.cleanExpiredCache(),this.options.useIndexedDB&&this.cleanIndexedDBCache().catch(()=>{}),!this.options.silentMode){this.imageProxyCache.size}},3e5)}getState(){return{isRunning:this.isRunning,screenshotCount:this.screenshotCount,lastScreenshotTime:this.lastScreenshotTime,error:this.error,isEnabled:this.isEnabled,isUploading:this.isUploading,uploadError:this.uploadError,uploadProgress:{...this.uploadProgress},currentUploadConfig:this.currentUploadConfig}}}var cn=function(){return cn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},cn.apply(this,arguments)};function ln(t,e,n,o){return new(n||(n=Promise))(function(i,r){function a(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((o=o.apply(t,e||[])).next())})}function un(t,e){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function dn(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var hn="4.6.2";function mn(t,e){return new Promise(function(n){return setTimeout(n,t,e)})}function fn(t){return!!t&&"function"==typeof t.then}function pn(t,e){try{var n=t();fn(n)?n.then(function(t){return e(!0,t)},function(t){return e(!1,t)}):e(!0,n)}catch(t){e(!1,t)}}function gn(t,e,n){return void 0===n&&(n=16),ln(this,void 0,void 0,function(){var o,i,r,a;return un(this,function(s){switch(s.label){case 0:o=Array(t.length),i=Date.now(),r=0,s.label=1;case 1:return r<t.length?(o[r]=e(t[r],r),(a=Date.now())>=i+n?(i=a,[4,new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++r,[3,1];case 4:return[2,o]}})})}function yn(t){return t.then(void 0,function(){}),t}function wn(t){return parseInt(t)}function bn(t){return parseFloat(t)}function vn(t,e){return"number"==typeof t&&isNaN(t)?e:t}function xn(t){return t.reduce(function(t,e){return t+(e?1:0)},0)}function Sn(t,e){if(void 0===e&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var n=1/e;return Math.round(t*n)/n}function Cn(t,e){var n=t[0]>>>16,o=65535&t[0],i=t[1]>>>16,r=65535&t[1],a=e[0]>>>16,s=65535&e[0],c=e[1]>>>16,l=0,u=0,d=0,h=0;d+=(h+=r+(65535&e[1]))>>>16,h&=65535,u+=(d+=i+c)>>>16,d&=65535,l+=(u+=o+s)>>>16,u&=65535,l+=n+a,l&=65535,t[0]=l<<16|u,t[1]=d<<16|h}function En(t,e){var n=t[0]>>>16,o=65535&t[0],i=t[1]>>>16,r=65535&t[1],a=e[0]>>>16,s=65535&e[0],c=e[1]>>>16,l=65535&e[1],u=0,d=0,h=0,m=0;h+=(m+=r*l)>>>16,m&=65535,d+=(h+=i*l)>>>16,h&=65535,d+=(h+=r*c)>>>16,h&=65535,u+=(d+=o*l)>>>16,d&=65535,u+=(d+=i*c)>>>16,d&=65535,u+=(d+=r*s)>>>16,d&=65535,u+=n*l+o*c+i*s+r*a,u&=65535,t[0]=u<<16|d,t[1]=h<<16|m}function Mn(t,e){var n=t[0];32===(e%=64)?(t[0]=t[1],t[1]=n):e<32?(t[0]=n<<e|t[1]>>>32-e,t[1]=t[1]<<e|n>>>32-e):(e-=32,t[0]=t[1]<<e|n>>>32-e,t[1]=n<<e|t[1]>>>32-e)}function kn(t,e){0!==(e%=64)&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function An(t,e){t[0]^=e[0],t[1]^=e[1]}var Ln=[4283543511,3981806797],In=[3301882366,444984403];function Rn(t){var e=[0,t[0]>>>1];An(t,e),En(t,Ln),e[1]=t[0]>>>1,An(t,e),En(t,In),e[1]=t[0]>>>1,An(t,e)}var Tn=[2277735313,289559509],Pn=[1291169091,658871167],Nn=[0,5],Fn=[0,1390208809],Wn=[0,944331445];function Dn(t,e){var n=function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++){var o=t.charCodeAt(n);if(o>127)return(new TextEncoder).encode(t);e[n]=o}return e}(t);e=e||0;var o,i=[0,n.length],r=i[1]%16,a=i[1]-r,s=[0,e],c=[0,e],l=[0,0],u=[0,0];for(o=0;o<a;o+=16)l[0]=n[o+4]|n[o+5]<<8|n[o+6]<<16|n[o+7]<<24,l[1]=n[o]|n[o+1]<<8|n[o+2]<<16|n[o+3]<<24,u[0]=n[o+12]|n[o+13]<<8|n[o+14]<<16|n[o+15]<<24,u[1]=n[o+8]|n[o+9]<<8|n[o+10]<<16|n[o+11]<<24,En(l,Tn),Mn(l,31),En(l,Pn),An(s,l),Mn(s,27),Cn(s,c),En(s,Nn),Cn(s,Fn),En(u,Pn),Mn(u,33),En(u,Tn),An(c,u),Mn(c,31),Cn(c,s),En(c,Nn),Cn(c,Wn);l[0]=0,l[1]=0,u[0]=0,u[1]=0;var d=[0,0];switch(r){case 15:d[1]=n[o+14],kn(d,48),An(u,d);case 14:d[1]=n[o+13],kn(d,40),An(u,d);case 13:d[1]=n[o+12],kn(d,32),An(u,d);case 12:d[1]=n[o+11],kn(d,24),An(u,d);case 11:d[1]=n[o+10],kn(d,16),An(u,d);case 10:d[1]=n[o+9],kn(d,8),An(u,d);case 9:d[1]=n[o+8],An(u,d),En(u,Pn),Mn(u,33),En(u,Tn),An(c,u);case 8:d[1]=n[o+7],kn(d,56),An(l,d);case 7:d[1]=n[o+6],kn(d,48),An(l,d);case 6:d[1]=n[o+5],kn(d,40),An(l,d);case 5:d[1]=n[o+4],kn(d,32),An(l,d);case 4:d[1]=n[o+3],kn(d,24),An(l,d);case 3:d[1]=n[o+2],kn(d,16),An(l,d);case 2:d[1]=n[o+1],kn(d,8),An(l,d);case 1:d[1]=n[o],An(l,d),En(l,Tn),Mn(l,31),En(l,Pn),An(s,l)}return An(s,i),An(c,i),Cn(s,c),Cn(c,s),Rn(s),Rn(c),Cn(s,c),Cn(c,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function Hn(t,e,n,o){var i=Object.keys(t).filter(function(t){return!function(t,e){for(var n=0,o=t.length;n<o;++n)if(t[n]===e)return!0;return!1}(n,t)}),r=yn(gn(i,function(n){return function(t,e){var n=yn(new Promise(function(n){var o=Date.now();pn(t.bind(null,e),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=Date.now()-o;if(!t[0])return n(function(){return{error:t[1],duration:i}});var r=t[1];if(function(t){return"function"!=typeof t}(r))return n(function(){return{value:r,duration:i}});n(function(){return new Promise(function(t){var e=Date.now();pn(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=i+Date.now()-e;if(!n[0])return t({error:n[1],duration:r});t({value:n[1],duration:r})})})})})}));return function(){return n.then(function(t){return t()})}}(t[n],e)},o));return function(){return ln(this,void 0,void 0,function(){var t,e,n,a;return un(this,function(s){switch(s.label){case 0:return[4,r];case 1:return[4,gn(s.sent(),function(t){return yn(t())},o)];case 2:return t=s.sent(),[4,Promise.all(t)];case 3:for(e=s.sent(),n={},a=0;a<i.length;++a)n[i[a]]=e[a];return[2,n]}})})}}function $n(){var t=window,e=navigator;return xn(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function Bn(){var t=window,e=navigator;return xn(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,0===(e.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function Un(){var t=window;return xn(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,0===navigator.vendor.indexOf("Apple"),"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function Vn(){var t=window,e=t.HTMLElement,n=t.Document;return xn(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),n&&"pointerLockElement"in n.prototype])>=4}function On(){var t,e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser)}function jn(){var t,e,n=window;return xn(["buildID"in navigator,"MozAppearance"in(null!==(e=null===(t=document.documentElement)||void 0===t?void 0:t.style)&&void 0!==e?e:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function zn(){var t=window,e=navigator,n=t.CSS,o=t.HTMLButtonElement;return xn([!("getStorageUpdates"in e),o&&"popover"in o.prototype,"CSSCounterStyleRule"in t,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Xn(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function Zn(){var t=Bn(),e=jn(),n=window,o=navigator,i="connection";return t?xn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!e&&xn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Gn(t){var e=new Error(t);return e.name=t,e}function Yn(t,e,n){var o,i,r;return void 0===n&&(n=50),ln(this,void 0,void 0,function(){var a,s;return un(this,function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,mn(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(t,n){var o=!1,i=function(){o=!0,t()};s.onload=i,s.onerror=function(t){o=!0,n(t)};var r=s.style;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",e&&"srcdoc"in s?s.srcdoc=e:s.src="about:blank",a.body.appendChild(s);var c=function(){var t,e;o||("complete"===(null===(e=null===(t=s.contentWindow)||void 0===t?void 0:t.document)||void 0===e?void 0:e.readyState)?i():setTimeout(c,10))};c()})];case 5:c.sent(),c.label=6;case 6:return(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body)?[3,8]:[4,mn(n)];case 7:return c.sent(),[3,6];case 8:return[4,t(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return null===(r=s.parentNode)||void 0===r||r.removeChild(s),[7];case 11:return[2]}})})}function _n(t){for(var e=function(t){for(var e,n,o="Unexpected syntax '".concat(t,"'"),i=/^\s*([a-z-]*)(.*)$/i.exec(t),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(t,e){a[t]=a[t]||[],a[t].push(e)};;){var l=s.exec(i[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(o);c(d[1],null!==(n=null!==(e=d[4])&&void 0!==e?e:d[5])&&void 0!==n?n:"");break;default:throw new Error(o)}}return[r,a]}(t),n=e[0],o=e[1],i=document.createElement(null!=n?n:"div"),r=0,a=Object.keys(o);r<a.length;r++){var s=a[r],c=o[s].join(" ");"style"===s?qn(i.style,c):i.setAttribute(s,c)}return i}function qn(t,e){for(var n=0,o=e.split(";");n<o.length;n++){var i=o[n],r=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(r){var a=r[1],s=r[2],c=r[4];t.setProperty(a,s,c||"")}}}var Jn=["monospace","sans-serif","serif"],Qn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Kn(t){return t.toDataURL()}var to,eo;function no(){var t=this;return function(){if(void 0===eo){var t=function(){var e=oo();io(e)?eo=setTimeout(t,2500):(to=e,eo=void 0)};t()}}(),function(){return ln(t,void 0,void 0,function(){var t;return un(this,function(e){switch(e.label){case 0:return io(t=oo())?to?[2,dn([],to,!0)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,Xn()]:[3,2]:[3,2];case 1:e.sent(),t=oo(),e.label=2;case 2:return io(t)||(to=t),[2,t]}var n})})}}function oo(){var t=screen;return[vn(bn(t.availTop),null),vn(bn(t.width)-bn(t.availWidth)-vn(bn(t.availLeft),0),null),vn(bn(t.height)-bn(t.availHeight)-vn(bn(t.availTop),0),null),vn(bn(t.availLeft),null)]}function io(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function ro(t){var e;return ln(this,void 0,void 0,function(){var n,o,i,r,a,s,c;return un(this,function(l){switch(l.label){case 0:for(n=document,o=n.createElement("div"),i=new Array(t.length),r={},ao(o),c=0;c<t.length;++c)"DIALOG"===(a=_n(t[c])).tagName&&a.show(),ao(s=n.createElement("div")),s.appendChild(a),o.appendChild(s),i[c]=a;l.label=1;case 1:return n.body?[3,3]:[4,mn(50)];case 2:return l.sent(),[3,1];case 3:n.body.appendChild(o);try{for(c=0;c<t.length;++c)i[c].offsetParent||(r[t[c]]=!0)}finally{null===(e=o.parentNode)||void 0===e||e.removeChild(o)}return[2,r]}})})}function ao(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function so(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function co(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}function lo(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function uo(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function ho(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function mo(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var fo=Math,po=function(){return 0};var go={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var yo=function(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}t=e}};var wo=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),bo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),vo=["FRAGMENT_SHADER","VERTEX_SHADER"],xo=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],So="WEBGL_debug_renderer_info";function Co(t){if(t.webgl)return t.webgl.context;var e,n=document.createElement("canvas");n.addEventListener("webglCreateContextError",function(){return e=void 0});for(var o=0,i=["webgl","experimental-webgl"];o<i.length;o++){var r=i[o];try{e=n.getContext(r)}catch(t){}if(e)break}return t.webgl={context:e},e}function Eo(t,e,n){var o=t.getShaderPrecisionFormat(t[e],t[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Mo(t){return Object.keys(t.__proto__).filter(ko)}function ko(t){return"string"==typeof t&&!t.match(/[^A-Z0-9_x]/)}function Ao(){return jn()}function Lo(){return Bn()||Un()}function Io(t){return"function"==typeof t.getParameter}var Ro={fonts:function(){var t=this;return Yn(function(e,n){var o=n.document;return ln(t,void 0,void 0,function(){var t,e,n,i,r,a,s,c,l,u,d;return un(this,function(h){for((t=o.body).style.fontSize="48px",(e=o.createElement("div")).style.setProperty("visibility","hidden","important"),n={},i={},r=function(t){var n=o.createElement("span"),i=n.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=t,n.textContent="mmMwWLliI0O&1",e.appendChild(n),n},a=function(t,e){return r("'".concat(t,"',").concat(e))},s=function(){for(var t={},e=function(e){t[e]=Jn.map(function(t){return a(e,t)})},n=0,o=Qn;n<o.length;n++){e(o[n])}return t},c=function(t){return Jn.some(function(e,o){return t[o].offsetWidth!==n[e]||t[o].offsetHeight!==i[e]})},l=function(){return Jn.map(r)}(),u=s(),t.appendChild(e),d=0;d<Jn.length;d++)n[Jn[d]]=l[d].offsetWidth,i[Jn[d]]=l[d].offsetHeight;return[2,Qn.filter(function(t){return c(u[t])})]})})})},domBlockers:function(t){var e=(void 0===t?{}:t).debug;return ln(this,void 0,void 0,function(){var t,n,o,i,r;return un(this,function(a){switch(a.label){case 0:return Un()||Zn()?(s=atob,t={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},n=Object.keys(t),[4,ro((r=[]).concat.apply(r,n.map(function(e){return t[e]})))]):[2,void 0];case 1:return o=a.sent(),e&&function(t,e){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];"\n".concat(i,":");for(var r=0,a=t[i];r<a.length;r++){var s=a[r];"\n ".concat(e[s]?"🚫":"➡️"," ").concat(s)}}}(t,o),(i=n.filter(function(e){var n=t[e];return xn(n.map(function(t){return o[t]}))>.6*n.length})).sort(),[2,i]}var s})})},fontPreferences:function(){return function(t,e){void 0===e&&(e=4e3);return Yn(function(n,o){var i=o.document,r=i.body,a=r.style;a.width="".concat(e,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",Bn()?r.style.zoom="".concat(1/o.devicePixelRatio):Un()&&(r.style.zoom="reset");var s=i.createElement("div");return s.textContent=dn([],Array(e/20|0),!0).map(function(){return"word"}).join(" "),r.appendChild(s),t(i,r)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}(function(t,e){for(var n={},o={},i=0,r=Object.keys(go);i<r.length;i++){var a=r[i],s=go[a],c=s[0],l=void 0===c?{}:c,u=s[1],d=void 0===u?"mmMwWLliI0fiflO&1":u,h=t.createElement("span");h.textContent=d,h.style.whiteSpace="nowrap";for(var m=0,f=Object.keys(l);m<f.length;m++){var p=f[m],g=l[p];void 0!==g&&(h.style[p]=g)}n[a]=h,e.append(t.createElement("br"),h)}for(var y=0,w=Object.keys(go);y<w.length;y++){o[a=w[y]]=n[a].getBoundingClientRect().width}return o})},audio:function(){return Un()&&zn()&&On()||Bn()&&(t=navigator,e=window,n=Audio.prototype,o=e.visualViewport,xn(["srLatency"in n,"srChannelCount"in n,"devicePosture"in t,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3)&&function(){var t=window,e=t.URLPattern;return xn(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Un()&&!Vn()&&!function(){var t=window;return xn(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}())return-1;var n=4500,o=new e(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;var r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);var a=function(t){var e=3,n=500,o=500,i=5e3,r=function(){},a=new Promise(function(a,s){var c=!1,l=0,u=0;t.oncomplete=function(t){return a(t.renderedBuffer)};var d=function(){setTimeout(function(){return s(Gn("timeout"))},Math.min(o,u+i-Date.now()))},h=function(){try{var o=t.startRendering();switch(fn(o)&&yn(o),t.state){case"running":u=Date.now(),c&&d();break;case"suspended":document.hidden||l++,c&&l>=e?s(Gn("suspended")):setTimeout(h,n)}}catch(t){s(t)}};h(),r=function(){c||(c=!0,u>0&&d())}});return[a,r]}(o),s=a[0],c=a[1],l=yn(s.then(function(t){return function(t){for(var e=0,n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}(t.getChannelData(0).subarray(n))},function(t){if("timeout"===t.name||"suspended"===t.name)return-3;throw t}));return function(){return c(),l}}();var t,e,n,o},screenFrame:function(){var t=this;if(Un()&&zn()&&On())return function(){return Promise.resolve(void 0)};var e=no();return function(){return ln(t,void 0,void 0,function(){var t,n;return un(this,function(o){switch(o.label){case 0:return[4,e()];case 1:return t=o.sent(),[2,[(n=function(t){return null===t?null:Sn(t,10)})(t[0]),n(t[1]),n(t[2]),n(t[3])]]}})})}},canvas:function(){return function(t){var e,n,o,i=!1,r=function(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}(),a=r[0],s=r[1];!function(t,e){return!(!e||!t.toDataURL)}(a,s)?n=o="unsupported":(i=function(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}(s),t?n=o="skipped":(e=function(t,e){!function(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(n,4,45)}(t,e);var n=Kn(t),o=Kn(t);if(n!==o)return["unstable","unstable"];!function(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var n=0,o=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<o.length;n++){var i=o[n],r=i[0],a=i[1],s=i[2];e.fillStyle=r,e.beginPath(),e.arc(a,s,40,0,2*Math.PI,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,2*Math.PI,!0),e.arc(60,60,20,0,2*Math.PI,!0),e.fill("evenodd")}(t,e);var i=Kn(t);return[i,n]}(a,s),n=e[0],o=e[1]));return{winding:i,geometry:n,text:o}}(Un()&&zn()&&On())},osCpu:function(){return navigator.oscpu},languages:function(){var t,e=navigator,n=[],o=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==o&&n.push([o]),Array.isArray(e.languages))Bn()&&xn([!("MediaSettingsRange"in(t=window)),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3||n.push(e.languages);else if("string"==typeof e.languages){var i=e.languages;i&&n.push(i.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return vn(bn(navigator.deviceMemory),void 0)},screenResolution:function(){var t,e,n;if(!(Un()&&zn()&&On()))return t=screen,(n=[(e=function(t){return vn(wn(t),null)})(t.width),e(t.height)]).sort().reverse(),n},hardwareConcurrency:function(){return vn(wn(navigator.hardwareConcurrency),void 0)},timezone:function(){var t,e=null===(t=window.Intl)||void 0===t?void 0:t.DateTimeFormat;if(e){var n=(new e).resolvedOptions().timeZone;if(n)return n}var o,i=(o=(new Date).getFullYear(),-Math.max(bn(new Date(o,0,1).getTimezoneOffset()),bn(new Date(o,6,1).getTimezoneOffset())));return"UTC".concat(i>=0?"+":"").concat(i)},sessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},localStorage:function(){try{return!!window.localStorage}catch(t){return!0}},indexedDB:function(){var t,e;if(!($n()||(t=window,e=navigator,xn(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!$n())))try{return!!window.indexedDB}catch(t){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var t=navigator.platform;return"MacIntel"===t&&Un()&&!Vn()?function(){if("iPad"===navigator.platform)return!0;var t=screen,e=t.width/t.height;return xn(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}()?"iPad":"iPhone":t},plugins:function(){var t=navigator.plugins;if(t){for(var e=[],n=0;n<t.length;++n){var o=t[n];if(o){for(var i=[],r=0;r<o.length;++r){var a=o[r];i.push({type:a.type,suffixes:a.suffixes})}e.push({name:o.name,description:o.description,mimeTypes:i})}}return e}},touchSupport:function(){var t,e=navigator,n=0;void 0!==e.maxTouchPoints?n=wn(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var t=[],e=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<n.length;e++){var o=n[e],i=window[o];i&&"object"==typeof i&&t.push(o)}return t.sort()},cookiesEnabled:function(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=-1!==t.cookie.indexOf("cookietest=");return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch(t){return!1}},colorGamut:function(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var n=e[t];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}},invertedColors:function(){return!!so("inverted")||!so("none")&&void 0},forcedColors:function(){return!!co("active")||!co("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=100;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}},contrast:function(){return lo("no-preference")?0:lo("high")||lo("more")?1:lo("low")||lo("less")?-1:lo("forced")?10:void 0},reducedMotion:function(){return!!uo("reduce")||!uo("no-preference")&&void 0},reducedTransparency:function(){return!!ho("reduce")||!ho("no-preference")&&void 0},hdr:function(){return!!mo("high")||!mo("standard")&&void 0},math:function(){var t,e=fo.acos||po,n=fo.acosh||po,o=fo.asin||po,i=fo.asinh||po,r=fo.atanh||po,a=fo.atan||po,s=fo.sin||po,c=fo.sinh||po,l=fo.cos||po,u=fo.cosh||po,d=fo.tan||po,h=fo.tanh||po,m=fo.exp||po,f=fo.expm1||po,p=fo.log1p||po;return{acos:e(.12312423423423424),acosh:n(1e308),acoshPf:(t=1e154,fo.log(t+fo.sqrt(t*t-1))),asin:o(.12312423423423424),asinh:i(1),asinhPf:function(t){return fo.log(t+fo.sqrt(t*t+1))}(1),atanh:r(.5),atanhPf:function(t){return fo.log((1+t)/(1-t))/2}(.5),atan:a(.5),sin:s(-1e300),sinh:c(1),sinhPf:function(t){return fo.exp(t)-1/fo.exp(t)/2}(1),cos:l(10.000000000123),cosh:u(1),coshPf:function(t){return(fo.exp(t)+1/fo.exp(t))/2}(1),tan:d(-1e300),tanh:h(1),tanhPf:function(t){return(fo.exp(2*t)-1)/(fo.exp(2*t)+1)}(1),exp:m(1),expm1:f(1),expm1Pf:function(t){return fo.exp(t)-1}(1),log1p:p(10),log1pPf:function(t){return fo.log(1+t)}(10),powPI:function(t){return fo.pow(fo.PI,t)}(-100)}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]},applePay:function(){var t=window.ApplePaySession;if("function"!=typeof(null==t?void 0:t.canMakePayments))return-1;if(yo())return-3;try{return t.canMakePayments()?1:0}catch(t){return function(t){if(t instanceof Error&&"InvalidAccessError"===t.name&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}(t)}},privateClickMeasurement:function(){var t,e=document.createElement("a"),n=null!==(t=e.attributionSourceId)&&void 0!==t?t:e.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Zn()||Un()))return-2;if(!window.AudioContext)return-1;var t=(new AudioContext).baseLatency;return null==t?-1:isFinite(t)?t:-3},dateTimeLocale:function(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return e||""===e?e:-3},webGlBasics:function(t){var e,n,o,i,r,a,s=Co(t.cache);if(!s)return-1;if(!Io(s))return-2;var c=Ao()?null:s.getExtension(So);return{version:(null===(e=s.getParameter(s.VERSION))||void 0===e?void 0:e.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function(t){var e=Co(t.cache);if(!e)return-1;if(!Io(e))return-2;var n=e.getSupportedExtensions(),o=e.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(var l=0,u=Object.keys(o);l<u.length;l++){var d=u[l];r.push("".concat(d,"=").concat(o[d]))}for(var h=0,m=Mo(e);h<m.length;h++){var f=e[x=m[h]];a.push("".concat(x,"=").concat(f).concat(wo.has(f)?"=".concat(e.getParameter(f)):""))}if(n)for(var p=0,g=n;p<g.length;p++){var y=g[p];if(!(y===So&&Ao()||"WEBGL_polygon_mode"===y&&Lo())){var w=e.getExtension(y);if(w)for(var b=0,v=Mo(w);b<v.length;b++){var x;f=w[x=v[b]];s.push("".concat(x,"=").concat(f).concat(bo.has(f)?"=".concat(e.getParameter(f)):""))}else i.push(y)}}for(var S=0,C=vo;S<C.length;S++)for(var E=C[S],M=0,k=xo;M<k.length;M++){var A=k[M],L=Eo(e,E,A);c.push("".concat(E,".").concat(A,"=").concat(L.join(",")))}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function To(t){var e=function(t){if(Zn())return.4;if(Un())return!Vn()||zn()&&On()?.3:.5;var e="value"in t.platform?t.platform.value:"";if(/^Win/.test(e))return.6;if(/^Mac/.test(e))return.5;return.7}(t),n=function(t){return Sn(.99+.01*t,1e-4)}(e);return{score:e,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(n))}}function Po(t){return Dn(function(t){for(var e="",n=0,o=Object.keys(t).sort();n<o.length;n++){var i=o[n],r=t[i],a="error"in r?"error":JSON.stringify(r.value);e+="".concat(e?"|":"").concat(i.replace(/([:|\\])/g,"\\$1"),":").concat(a)}return e}(t))}function No(t){return void 0===t&&(t=50),function(t,e){void 0===e&&(e=1/0);var n=window.requestIdleCallback;return n?new Promise(function(t){return n.call(window,function(){return t()},{timeout:e})}):mn(Math.min(t,e))}(t,2*t)}function Fo(t,e){Date.now();return{get:function(n){return ln(this,void 0,void 0,function(){var o,i;return un(this,function(r){switch(r.label){case 0:return Date.now(),[4,t()];case 1:return o=r.sent(),i=function(t){var e,n=To(t);return{get visitorId(){return void 0===e&&(e=Po(this.components)),e},set visitorId(t){e=t},confidence:n,components:t,version:hn}}(o),e||null==n||n.debug,[2,i]}})})}}}var Wo={load:function(t){var e;return void 0===t&&(t={}),ln(this,void 0,void 0,function(){var n,o,i;return un(this,function(r){switch(r.label){case 0:return(null===(e=t.monitoring)||void 0===e||e)&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(hn,"/npm-monitoring"),!0),t.send()}catch(t){}}(),n=t.delayFallback,o=t.debug,[4,No(n)];case 1:return r.sent(),i=function(t){return Hn(Ro,t,[])}({cache:{},debug:o}),[2,Fo(i,o)]}})})},hashComponents:Po,componentsToDebugString:function(t){return JSON.stringify(t,function(t,e){return e instanceof Error?cn({name:(n=e).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):e;var n,o},2)}};class Do{constructor(){this.iconManager=null,this.iframeManager=null,this.screenshotManager=null,this.config=null,this.isInitialized=!1}async init(t,e){if(!this.isInitialized){this.config=t;try{const i=await this.getDeviceId(),r=this.buildIframeUrl(t,i),a=e?.iconPosition||void 0;if(this.iconManager=new n(a),await this.iconManager.show(),this.iframeManager=new o({src:r,mode:"auto",width:400,height:600,allowClose:!0,onMessage:(t,e)=>{"new-message"===t&&this.showNotification(0,{pulse:!0})},onClose:()=>{this.iconManager?.forceCleanupDragEvents()},...e}),await this.iframeManager.init(),this.iconManager.onClick(()=>{this.clearNotification(),this.iframeManager?.show()}),t.screenshot){const e=document.body;this.screenshotManager=new sn(e,t.screenshot),this.screenshotManager.enable(!0)}this.isInitialized=!0}catch(t){throw t}}}showIcon(){this.iconManager?.show()}hideIcon(){this.iconManager?.hide()}setIconPosition(t){this.iconManager?.setPosition(t)}setIconCoordinates(t){this.iconManager?.setIconPosition(t)}setIconStyle(t){this.iconManager?.setStyle(t)}openChat(){this.clearNotification(),this.iframeManager?.open()}closeChat(){this.iconManager?.forceCleanupDragEvents(),this.iframeManager?.close()}isChatOpen(){return this.iframeManager?.isIframeOpen()||!1}sendToIframe(t){this.iframeManager?.sendToIframe(t)}getConnectionStatus(){return this.isInitialized}showNotification(t=1,e={}){this.iconManager&&(this.iconManager.showNotification({badgeCount:"string"==typeof t?0:t,badgeText:"string"==typeof t?t:"",pulse:e.pulse||!1}),e.autoHide&&e.autoHide>0&&setTimeout(()=>{this.iconManager?.clearNotification()},e.autoHide))}clearNotification(){this.iconManager?.clearNotification()}setScreenshotTarget(t){this.screenshotManager?.setTargetElement(t)}async captureScreenshot(t=!1){return!!this.screenshotManager&&await this.screenshotManager.captureOnce(t)}enableScreenshot(t){this.screenshotManager&&this.screenshotManager.enable(t)}getScreenshotState(){return this.screenshotManager?.getState()||null}destroy(){this.iconManager?.hide(),this.iframeManager?.close(),this.screenshotManager?.destroy(),this.iconManager=null,this.iframeManager=null,this.screenshotManager=null,this.config=null,this.isInitialized=!1}async getDeviceId(){try{const t=await Wo.load();return(await t.get()).visitorId}catch(t){return"device_"+Date.now()+"_"+Math.random().toString(36).substr(2,9)}}buildIframeUrl(t,e){const n=t.iframeUrl;if(!n||""===n.trim())throw new Error("iframeUrl is required but not provided or is empty");const o=new URL(n);return t.agent&&""!==t.agent.trim()&&o.searchParams.set("Agent",t.agent),t.token&&""!==t.token.trim()&&o.searchParams.set("Authorization",t.token),o.searchParams.set("DeviceSign",e),o.searchParams.set("Referrer",document.referrer),o.toString()}}let Ho=null;const $o=async(t,e)=>{Ho||(Ho=new Do),await Ho.init(t,e)},Bo=()=>{if(!Ho)throw new Error("SDK not initialized. Call init() first.");return Ho},Uo=()=>{Bo().showIcon()},Vo=()=>{Bo().hideIcon()},Oo=t=>{Bo().setIconPosition(t)},jo=t=>{Bo().setIconCoordinates(t)},zo=t=>{Bo().setIconStyle(t)},Xo=()=>{Bo().openChat()},Zo=()=>{Bo().closeChat()},Go=()=>Bo().isChatOpen(),Yo=t=>{Bo().sendToIframe(t)},_o=()=>Bo().getConnectionStatus(),qo=(t=1,e={})=>{Bo().showNotification(t,e)},Jo=()=>{Bo().clearNotification()},Qo=()=>{Bo().destroy(),Ho=null},Ko=t=>{Bo().setScreenshotTarget(t)},ti=async(t=!1)=>{const e=Bo();return await e.captureScreenshot(t)},ei=t=>{Bo().enableScreenshot(t)},ni=()=>Bo().getScreenshotState();var oi={init:$o,getInstance:Bo,showIcon:Uo,hideIcon:Vo,setIconPosition:Oo,setIconCoordinates:jo,setIconStyle:zo,openChat:Xo,closeChat:Zo,isChatOpen:Go,sendToIframe:Yo,getConnectionStatus:_o,showNotification:qo,clearNotification:Jo,setScreenshotTarget:Ko,captureScreenshot:ti,enableScreenshot:ei,getScreenshotState:ni,destroy:Qo};t.CustomerServiceSDK=Do,t.captureScreenshot=ti,t.clearNotification=Jo,t.closeChat=Zo,t.default=oi,t.destroy=Qo,t.enableScreenshot=ei,t.getConnectionStatus=_o,t.getInstance=Bo,t.getScreenshotState=ni,t.hideIcon=Vo,t.init=$o,t.isChatOpen=Go,t.openChat=Xo,t.sendToIframe=Yo,t.setIconCoordinates=jo,t.setIconPosition=Oo,t.setIconStyle=zo,t.setScreenshotTarget=Ko,t.showIcon=Uo,t.showNotification=qo,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","html2canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CustomerSDK={},t.html2canvas)}(this,function(t,e){"use strict";class n{constructor(t){this.iconElement=null,this.badgeElement=null,this.onClickCallback=null,this.notificationCallback=null,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.iconStartX=0,this.iconStartY=0,this.dragMoveHandler=null,this.dragEndHandler=null,this.iconPosition=null,this.iconPosition=t||null}async show(){if(this.iconElement)return;this.iconElement=document.createElement("div"),this.iconElement.className="customer-sdk-icon";const t={position:"fixed",width:"30px",height:"30px",backgroundColor:"transparent",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:"999999",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",userSelect:"none",transition:"transform 0.2s ease",border:"none",outline:"none",overflow:"visible"};this.iconPosition?(void 0!==this.iconPosition.x?(t.left="number"==typeof this.iconPosition.x?`${this.iconPosition.x}px`:this.iconPosition.x,t.right="auto"):t.right="20px",void 0!==this.iconPosition.y?(t.top="number"==typeof this.iconPosition.y?`${this.iconPosition.y}px`:this.iconPosition.y,t.bottom="auto"):t.bottom="80px"):(t.bottom="80px",t.right="20px"),Object.assign(this.iconElement.style,t);const e=document.createElement("img");e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAArKSURBVHgB7Z1NbFTXFcf/93mwaGyEabLoIgFTqWRFMZUitSoIu80ial01SFWrKgsGKXYpWdRtFilRK4xUgbKICosmCKIySKCo2UAE6i61XVroDuOoi2YT02RZVFNwQTAzN+e8N88ej9+8j5n3ce5wf5JhPvyY4f3f/9xzz73vXoUeYKish6oljCiFYQ2MaAebVR3D/Jzf1xpDUPTTggIW6feXoOlH0Q9wS9exRK/Pl6qYX6qoJRiOgoEMvqpHWUjlYJ9iQeEJmTb07y6y2CT6HP99/z01C8MwQmB26OMSyuTIH9LTkSA35oLn9FmKCB/WHmP2YUUtQjhiBV4jqsIoJKJJbOC8ZLHFCczhl75UWXvCFuPUDiBXV5TGeWlhXIzALCx9m6Ni3RqfeRL71PJZVYEAChfYdayDc1klSkXBCRr9caxooQsTuIccG4qbiddxsKjQnbvAlDwNVzfgXK8L2wq30ZSMHcs7GctV4IFX9ZTyXGtM8pQq2i2qnCQ3H0NO5CLwk+radnDYrj3CWB5udpAx7FoS96YVdxVy1XCJzgmfG2RMZg5268P9FI6BzP8TRlN3Q/YvkRGZCOyG5H5cApcVLZFkGbJTF3igrEccErfX+rVZk5XIqbbBmyb1y2oDZqy4yfHbZT6HSJHUHDwwqQ/QP1aBpWvIIOXlM+o8UiAVga246ZOWyF0LbMXNjjRE7kpgbi/oS1yCJTNIoP33zqjL6JCOBW5Up24+sWXHvKDyJplojEal5tEBHWXRLG6tHzNW3BxQ7oTBSxvpnKMDOhKYxbVdofxwu1BUW+DqIBKSWODBSf17K24hjFRLbuk3EYkEbhTHbW25KBxMJR2giJ1k2aRKCJR0VR9jd9ySZmwH26RKCKRBicfWYxJLYGp3j9p2VxA0th43VEeGaBuahRIzVEc6uFbCtBVXIDFDdaiDBw/pUdSp7bXIpY6xsCm5oQ5W9fiNuaUgVHjfuK2DN01ovj/IaIE3PwVs/TL9PEOPv7T2vX/fAe7+H/j4c5hPiItLbQ9SyasmRcOCvvJN4OvPAXueB7Y9He+4a/8CFkjoq1TO/9snMA7tuEbcHvReoINNc++eHcCb48De59E1t+94gp+46rncGNq4OFBg6vfehAEzIl/5FnDkB/GdmpQL1w0SWmP2/lk11vryOoFNyJx3Pgu89eN0HBuHP3zkCc1ttmgCXLwui1ZVlCGYw98Brv82P3GZ174L/P031LY/C9FQs3qg9bU1Dm5MWP8UAuEE6v1D+QobxPErnptFQtWt0mNsb14daI2Daxtk3j+09WnPQUWLy7xJbf6RcciEqlu8rknzS2sEpnT7AITB4v759ewSqU6QLHJjJaLV5/4DieFZorjNSA3XpUfY4ofpFQdLDM/vH5YrLsNO5qRPGs1hekVgGu9N9Z6YbuEQKD1rZVjkrcIuwuYw3dwG74MQ+ITxiTMBN7s/DGmsFKlcgd3ihqAxX253TYIjjahQTVq6qxihIbCuyilLcvlRcrvbDo447GYp6IaLXYGVoPUzjhgSmlthcSW52NfUF3gXBGCqe324pCnFxbqhqcO3Q0iZMckCm4w/Hi0Bvt2FtXWqG2W0v5w5SyhFdsv4boiBV8F3pCRYe3egJ+D/h6AwPewoR0b3yPTw3Mzer0EEvN2BQ/m0CAfzPKpeYY+QpoY3J3Eoj96Mgtn5nKw+ZLdI6QmoOraXoIsP0a1TWoPg6TLv/AW4/R/v9zmZSdJuv/MRsPCZd+xrL8avH/PnXryR7NidQqIRtcHbSkpjiy543feoK54nvX3vbW/Gow+LHWdclgXiYxc+T35su8996yfhRQ1JfXmHVUbBRDmCx11v3wl+fSFi4vobHwT/Dh977ZPOPveNP0VPwJPQ5JB5hzJfTjgNrt5q/x7PYQ7j48/av7cQ8l7U5164gVDiNDuZowwROIwoJy096PzYXkCEwFEnOmzgPyrRGt/V+bGhnxvRFZIyWV6GwA/C33+3HNxOc6ITdaIPv9j5se0+15TZJkxf/zempyhWb0SBbHsG+NEL7d8fooRlfGTV6Tu+4g0rvv4SIknz2Be+CvzqJW/UKAxu2//4V4hAbZrQi0Vn0uySfx5Hz8B3Kf70XRQOLzIuIkT79+r2ClHZeV5QN2nJoXqliLnQ1wy8L7cdgu4xvuuQyrchgKj+rClwJBJ0sZKDNURsY37xH+gJrna06G9GKMw7vHU5BCDsyu+YizcgBl1nB/dhEUI4cQVGw8mipIuUzeuUHspwMMMnx6h1MVo4LuwCLVVJYL4LTUqixRyqwEj4whQVnqkPzNo6jSeiXGxiWyzNvWRadyzME1hjFoL4ecWswsfF67Lcy/iaenc2lOQ4mOFB9uNS18FogUOzxJvA/d7RymSdwQn9X2mryp4uy55Oy1Hm278LnvVRKFTbuH9WbeGHq7VoR5aLmXbTbaTw6w8Eiusx5z9YvcO/hg8hjKAJc1LgPOGCsHbXh5LmlZ3SVgTeUJW5/6AvspQSIH8fyeIytb7VpHlFYHdVFiUrm/bhk8rhuujM2p9GK1lcsu/cw9Ory/yvXSdLYJhm/OWUipyKyhGEEyrJOQGjW3aCXSOwG6aFjC75FL1Wlu9anqGxZEDfvDk8M2sEdsuWSo6LixSXmwPu37JrTamsaYVKc3hm1q34rh1ycb34JQ2LEJdF5RB84oqZ5VJVw7rNpIMXBP+ZnqFQPYqCyEtc7sNyCOa7H1hQnmpjQhgORGOeihvr1hcI3rNB4ViRAv/vAfD9t5EpQgsUHUPJ1amg19vvujKpP7Xb2ZkBDw0un1GBm3K0nTZLbfFBWMxAU8RtQ/jOZwW3xZZowtzLhE98V+2vDIsMVD080oYKfP+0mpVavrR4/d6wfQuZyFtXSoquEGHVLQvcMd9ajAgbKfASVUa0DdXy0DjVWrUKIvbyKzbhkkNUYtVM7LsLbagWAodmB2Nxfz22wDZUy0BTnzdOaPZJdH8whYWTHPthKQY698vvkQYJSLwEGq9BXO13N68UvztpL5Gk3W0m8R3+PGZccrCfroxFWHKBxU3S7jbT8SKGAxN6hA6ekTaXuuegpKrah91J2t1mOl6jY/msmlfKDkhkDZ/jTsVlulqE5d4ZdVlpK3JWUMZ8kM8xuiCVdWY3TegydaHOwZIaLC5FyQq6JLWFhK3I6ZGWuExq62Tdoy9EV8t+W+3qAjp3fA7TEpdJfSnwoUN6uFbHjJ3ukwzuCtEfLG6qN+mkvtIdlzT7qM9m+8mJmOd+btriMpksZeiK/Ai7bVkzBnSOSk9hrJuuUBiZ79YwMKmnqCt11BZEWqD2lgcOktaWk5LLdhy2XV7HXNVBOSvXNpPrfiuDk3qartxfPLFuzsm1zeS+oU7DzdPk5sLvf8qZ3FzbTGE7JvG28qqOc09A2J6jVHbanaFaAAVvieVVwOhbHO01oblfqxwcLEpYn8IF9mmUOqfooYjdyLugUMe2IkZgn0boLhvVRnPy5OAyDe2dlyKsjziBfdxkrIZRcnWZnu6DTOZ0HZc3DKKydFKJrMGLFbiZFbGBl8FiF9XN4oEUhVvSRW3GCIFb4TDOW9NTSByln11ZJWi8zDKvxMsLe/J6ntLCbxyMFLiVoSk9VH2IEVd03rKedzX3XD7EO3AG7gvlDc3ddR8qLLpZr6LX6iRoHxZLGzFvgkOj+ALBlx6CtCZy6AAAAABJRU5ErkJggg==",e.style.width="100%",e.style.height="100%",e.style.objectFit="cover",e.style.display="block",e.alt="Customer Service",e.onload=()=>{this.iconElement&&(e.style.opacity="1",e.style.visibility="visible")},e.onerror=t=>{},e.style.opacity="1",e.style.visibility="visible";const n=document.createElement("div");Object.assign(n.style,{width:"100%",height:"100%",borderRadius:"50%",overflow:"hidden",position:"relative"}),n.appendChild(e),this.iconElement.appendChild(n),this.setupDragEvents(),document.body.appendChild(this.iconElement)}forceCleanupDragEvents(){if(this.dragMoveHandler)try{document.removeEventListener("mousemove",this.dragMoveHandler),document.removeEventListener("touchmove",this.dragMoveHandler)}catch(t){}if(this.dragEndHandler)try{document.removeEventListener("mouseup",this.dragEndHandler),document.removeEventListener("touchend",this.dragEndHandler)}catch(t){}this.isDragging=!1,this.iconElement&&(this.iconElement.style.transition="transform 0.2s ease",this.iconElement.style.cursor="pointer")}hide(){this.forceCleanupDragEvents(),this.iconElement&&(this.iconElement.remove(),this.iconElement=null,this.onClickCallback=null,this.dragMoveHandler=null,this.dragEndHandler=null)}setPosition(t){}setIconPosition(t){if(this.iconPosition=t,this.iconElement){void 0!==t.x&&(this.iconElement.style.left="number"==typeof t.x?`${t.x}px`:t.x,this.iconElement.style.right="auto"),void 0!==t.y&&(this.iconElement.style.top="number"==typeof t.y?`${t.y}px`:t.y,this.iconElement.style.bottom="auto");const e=this.iconElement.getBoundingClientRect();this.iconStartX=e.left,this.iconStartY=e.top}}setStyle(t){}onClick(t){this.onClickCallback=t}onNotification(t){this.notificationCallback=t}showNotification(t){if(!this.iconElement)return;const{showBadge:e=!0,badgeCount:n=0,badgeText:o="",pulse:i=!1}=t;(e||n>0)&&this.createBadge(n,o,i),this.notificationCallback&&this.notificationCallback({badgeCount:n,badgeText:o,pulse:i})}clearNotification(){this.badgeElement&&(this.badgeElement.remove(),this.badgeElement=null)}setupDragEvents(){this.iconElement&&(this.dragMoveHandler=this.handleDragMove.bind(this),this.dragEndHandler=this.handleDragEnd.bind(this),this.iconElement.addEventListener("mousedown",this.handleDragStart.bind(this)),this.iconElement.addEventListener("touchstart",this.handleDragStart.bind(this),{passive:!1}))}handleDragStart(t){if(!this.iconElement)return;if(t.target!==this.iconElement&&!this.iconElement.contains(t.target))return;t.preventDefault(),t.stopPropagation();const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY;this.isDragging=!1,this.dragStartX=e,this.dragStartY=n;const o=this.iconElement.getBoundingClientRect();this.iconStartX=o.left,this.iconStartY=o.top,this.iconElement.style.transition="none",this.iconElement.style.cursor="grabbing";const i=t=>{const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY,o=e-this.dragStartX,r=n-this.dragStartY;(Math.abs(o)>5||Math.abs(r)>5)&&(this.isDragging=!0,"touches"in t?document.removeEventListener("touchmove",i):document.removeEventListener("mousemove",i),this.dragMoveHandler&&this.dragEndHandler&&("touches"in t?(document.addEventListener("touchmove",this.dragMoveHandler,{passive:!1}),document.addEventListener("touchend",this.dragEndHandler)):(document.addEventListener("mousemove",this.dragMoveHandler),document.addEventListener("mouseup",this.dragEndHandler))))};"touches"in t?(document.addEventListener("touchmove",i,{passive:!1}),document.addEventListener("touchend",this.dragEndHandler)):(document.addEventListener("mousemove",i),document.addEventListener("mouseup",this.dragEndHandler))}handleDragMove(t){if(!this.iconElement||!this.isDragging)return;const e="touches"in t?t.touches[0].clientX:t.clientX,n="touches"in t?t.touches[0].clientY:t.clientY,o=t.target;if(o&&o!==this.iconElement&&!this.iconElement.contains(o)){if("IFRAME"===o.tagName||o.closest("iframe")||o.closest(".customer-sdk-container")||o.closest(".customer-sdk-overlay"))return void this.handleDragEnd()}const i=e-this.dragStartX,r=n-this.dragStartY,a=this.iconElement.getBoundingClientRect(),s=a.left+a.width/2,c=a.top+a.height/2;if(Math.sqrt(Math.pow(e-s,2)+Math.pow(n-c,2))>3*Math.max(a.width,a.height))return void this.handleDragEnd();t.preventDefault(),t.stopPropagation();const l=this.iconStartX+i,u=this.iconStartY+r,d=window.innerWidth-this.iconElement.offsetWidth,h=window.innerHeight-this.iconElement.offsetHeight,m=Math.max(0,Math.min(l,d)),f=Math.max(0,Math.min(u,h));this.iconElement.style.left=`${m}px`,this.iconElement.style.top=`${f}px`,this.iconElement.style.right="auto",this.iconElement.style.bottom="auto"}handleDragEnd(t){this.iconElement&&(this.dragMoveHandler&&(document.removeEventListener("mousemove",this.dragMoveHandler),document.removeEventListener("touchmove",this.dragMoveHandler)),this.dragEndHandler&&(document.removeEventListener("mouseup",this.dragEndHandler),document.removeEventListener("touchend",this.dragEndHandler)),this.iconElement.style.transition="transform 0.2s ease",this.iconElement.style.cursor="pointer",this.isDragging||this.handleClick(),this.isDragging=!1)}handleClick(){this.onClickCallback&&this.onClickCallback()}createBadge(t,e="",n=!1){this.clearNotification(),this.badgeElement=document.createElement("div"),this.badgeElement.className="customer-sdk-icon-badge",this.badgeElement.textContent=t>0?t>99?"99+":t.toString():e||"",Object.assign(this.badgeElement.style,{position:"absolute",top:"-4px",left:"-4px",right:"auto",minWidth:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ff4444",color:"#ffffff",fontSize:"10px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"1000001",boxShadow:"0 -1px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15)",...0===t&&""===e&&{width:"12px",height:"12px",minWidth:"12px",top:"-2px",left:"-2px"},...n&&{animation:"sdk-badge-pulse 1.5s infinite"}}),this.iconElement&&this.iconElement.appendChild(this.badgeElement)}}class o{constructor(t={}){this.iframeElement=null,this.overlayElement=null,this.containerElement=null,this.isOpen=!1,this.isCreated=!1,this.config={src:"",mode:"auto",width:400,height:600,allowClose:!0,...t},this.setupMessageListener()}async init(){try{this.createIframe(),this.isCreated=!0}catch(t){throw t}}show(){if(!this.isOpen){if(!this.isCreated)throw new Error("Iframe not initialized. Call init() first.");try{const t="popup"===this.getActualMode();t&&this.createOverlay(),this.containerElement&&(t?(Object.assign(this.containerElement.style,{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",visibility:"visible",opacity:"1",display:"block"}),this.overlayElement?.appendChild(this.containerElement)):(Object.assign(this.containerElement.style,{position:"fixed",visibility:"visible",opacity:"1",display:"block"}),this.preventBodyScroll(!0))),this.isOpen=!0}catch(t){}}}open(){this.show()}hide(){if(!this.isOpen)return;this.containerElement&&Object.assign(this.containerElement.style,{visibility:"hidden",opacity:"0",display:"none"}),this.overlayElement&&(this.overlayElement.remove(),this.overlayElement=null);"fullscreen"===this.getActualMode()&&this.preventBodyScroll(!1),this.isOpen=!1,this.config.onClose&&this.config.onClose()}close(){this.hide()}destroy(){this.hide(),this.containerElement&&(this.containerElement.remove(),this.containerElement=null,this.iframeElement=null),this.isCreated=!1}isIframeOpen(){return this.isOpen}sendToIframe(t){this.iframeElement&&this.iframeElement.contentWindow&&this.iframeElement.contentWindow.postMessage(t,"*")}createOverlay(){this.overlayElement=document.createElement("div"),this.overlayElement.className="customer-sdk-overlay",Object.assign(this.overlayElement.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"999998",display:"flex",alignItems:"center",justifyContent:"center",cursor:this.config.allowClose?"pointer":"default"}),this.config.allowClose&&this.overlayElement.addEventListener("click",t=>{t.target===this.overlayElement&&this.close()}),document.body.appendChild(this.overlayElement)}createIframe(){this.containerElement=document.createElement("div"),this.containerElement.className="customer-sdk-container",this.iframeElement=document.createElement("iframe"),this.iframeElement.className="customer-sdk-iframe",this.iframeElement.src=this.config.src||"",this.iframeElement.frameBorder="0",this.iframeElement.setAttribute("allow",["microphone","camera","geolocation","clipboard-read","clipboard-write","fullscreen","autoplay","encrypted-media"].join("; ")),this.iframeElement.setAttribute("sandbox",["allow-same-origin","allow-scripts","allow-forms","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-storage-access-by-user-activation"].join(" "));const t="popup"===this.getActualMode();this.iframeElement.scrolling=t?"auto":"no";const e={width:t?`${this.config.width}px`:"100%",height:t?`${this.config.height}px`:"100%",maxWidth:t?"450px":"100%",maxHeight:t?"700px":"100%",backgroundColor:"#ffffff",borderRadius:t?"12px":"12px 12px 0 0",boxShadow:t?"0 20px 40px rgba(0, 0, 0, 0.15)":"0 -4px 16px rgba(0, 0, 0, 0.25)",border:"none",position:"fixed",zIndex:"999999",...t?{top:"50%",left:"50%",transform:"translate(-50%, -50%)"}:{top:"0",left:"0",bottom:"0",right:"0",transform:"none",overflow:"hidden",position:"fixed"},visibility:"hidden",opacity:"0",display:"none"};Object.assign(this.containerElement.style,e);const n={width:"100%",height:"100%",border:"none",borderRadius:"inherit",...t?{}:{overflow:"hidden",scrollbarWidth:"none",msOverflowStyle:"none",WebkitScrollbar:"none"}};Object.assign(this.iframeElement.style,n),this.containerElement.appendChild(this.iframeElement),this.iframeElement.addEventListener("load",()=>{t||this.injectMobileStyles()}),document.body.appendChild(this.containerElement)}injectMobileStyles(){if(this.iframeElement)try{const t=this.iframeElement.contentDocument||this.iframeElement.contentWindow?.document;if(t){const e=t.createElement("style");e.textContent="\n /* 移动端iframe全屏样式优化 */\n * {\n -webkit-overflow-scrolling: touch !important;\n }\n \n body, html, #app, .container {\n overflow: auto !important;\n -webkit-overflow-scrolling: touch !important;\n }\n \n /* 隐藏所有滚动条 */\n ::-webkit-scrollbar {\n width: 0px !important;\n height: 0px !important;\n background: transparent !important;\n }\n \n /* Firefox */\n html {\n scrollbar-width: none !important;\n }\n \n /* IE/Edge */\n body {\n -ms-overflow-style: none !important;\n }\n \n /* 确保内容可以滚动 */\n body {\n overflow: auto !important;\n height: 100vh !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n ",t.head?.appendChild(e)}}catch(t){}}preventBodyScroll(t){if(t){const t=window.scrollY;Object.assign(document.body.style,{position:"fixed",top:`-${t}px`,width:"100%",overflow:"hidden"}),document.body.setAttribute("data-scroll-position",t.toString())}else{const t=parseInt(document.body.getAttribute("data-scroll-position")||"0");Object.assign(document.body.style,{position:"",top:"",width:"",overflow:""}),document.body.removeAttribute("data-scroll-position"),window.scrollTo(0,t)}}isMobileDevice(){return window.innerWidth<=768||/Android|iPhone|iPad|iPod|Opera Mini|IEMobile/i.test(navigator.userAgent)}getActualMode(){return"auto"===this.config.mode?this.isMobileDevice()?"fullscreen":"popup":this.config.mode}setupMessageListener(){window.addEventListener("message",t=>{this.config.src&&t.origin!==new URL(this.config.src).origin||this.handleIframeMessage(t.data)},!1)}handleIframeMessage(t){let e;if("string"==typeof t)e=t;else{if(!t||!t.type)return;e=t.type}switch(e){case"iframe_ready":break;case"close_iframe":case"close":this.close();break;case"resize_iframe":case"resize":t.width&&t.height&&this.resizeIframe(t.width,t.height);break;case"new-message":this.config.onMessage&&this.config.onMessage(e,t)}}resizeIframe(t,e){this.iframeElement&&(this.iframeElement.style.width=`${t}px`,this.iframeElement.style.height=`${e}px`)}}const i="p".charCodeAt(0),r="H".charCodeAt(0),a="Y".charCodeAt(0),s="s".charCodeAt(0);let c;function l(t){let e=-1;c||(c=function(){const t=new Int32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n}return t}());for(let n=0;n<t.length;n++)e=c[255&(e^t[n])]^e>>>8;return-1^e}function u(t,e,n=!1){const o=new Uint8Array(13);e*=39.3701,o[0]=i,o[1]=r,o[2]=a,o[3]=s,o[4]=e>>>24,o[5]=e>>>16,o[6]=e>>>8,o[7]=255&e,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;const c=l(o),u=new Uint8Array(4);if(u[0]=c>>>24,u[1]=c>>>16,u[2]=c>>>8,u[3]=255&c,n){const e=function(t){for(let e=t.length-1;e>=4;e--)if(9===t[e-4]&&t[e-3]===i&&t[e-2]===r&&t[e-1]===a&&t[e]===s)return e-3;return 0}(t);return t.set(o,e),t.set(u,e+13),t}{const e=new Uint8Array(4);e[0]=0,e[1]=0,e[2]=0,e[3]=9;const n=new Uint8Array(54);return n.set(t,0),n.set(e,33),n.set(o,37),n.set(u,50),n}}const d="undefined"!=typeof window,h=d&&"Worker"in window,m=d&&"atob"in window,f=d&&"btoa"in window,p=d?window.navigator?.userAgent:"",g=p.includes("Chrome"),y=p.includes("AppleWebKit")&&!g,w=p.includes("Firefox"),b=t=>1===t.nodeType,v=t=>"object"==typeof t.className,x=t=>"image"===t.tagName,S=t=>b(t)&&void 0!==t.style&&!v(t),C=t=>8===t.nodeType,E=t=>"IMG"===t.tagName,M=t=>"VIDEO"===t.tagName,k=t=>"SLOT"===t.tagName;function A(t){const e=t?.createElement?.("canvas");return e&&(e.height=e.width=1),Boolean(e)&&"toDataURL"in e&&Boolean(e.toDataURL("image/webp").includes("image/webp"))}const L=t=>t.startsWith("data:");function I(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(d&&t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;if(!d)return t;const n=R().implementation.createHTMLDocument(),o=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(i),e&&(o.href=e),i.href=t,i.href}function R(t){return(t&&b(t)?t?.ownerDocument:t)??window.document}const P="http://www.w3.org/2000/svg";const T=t=>function(t,e){return new Promise((n,o)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>o(i.error),i.onabort=()=>o(new Error(`Failed read blob to ${e}`)),i.readAsDataURL(t)})}(t,"dataUrl");function N(t,e){const n=R(e).createElement("img");return n.decoding="sync",n.loading="eager",n.src=t,n}function F(t,e){return new Promise(n=>{const{timeout:o,ownerDocument:i,onError:r,onWarn:a}=e??{},s="string"==typeof t?N(t,R(i)):t;let c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(o&&(c=setTimeout(u,o)),M(s)){const t=s.currentSrc||s.src;if(!t)return s.poster?F(s.poster,e).then(n):u();if(s.readyState>=2)return u();const o=u,i=e=>{a?.("Failed video load",t,e),r?.(e),u()};l=()=>{s.removeEventListener("loadeddata",o),s.removeEventListener("error",i)},s.addEventListener("loadeddata",o,{once:!0}),s.addEventListener("error",i,{once:!0})}else{const t=x(s)?s.href.baseVal:s.currentSrc||s.src;if(!t)return u();const e=async()=>{if(E(s)&&"decode"in s)try{await s.decode()}catch(e){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||t,e)}u()},n=e=>{a?.("Failed image load",s.dataset.originalSrc||t,e),u()};if(E(s)&&s.complete)return e();l=()=>{s.removeEventListener("load",e),s.removeEventListener("error",n)},s.addEventListener("load",e,{once:!0}),s.addEventListener("error",n,{once:!0})}})}const D=function(){let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)}();function W(t){return t?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function H(t){return{time:e=>t&&void 0,timeEnd:e=>t&&void 0,warn:(...e)=>t&&void 0}}async function $(t,e){return(n=t)&&"__CONTEXT__"in n?t:U(t,{...e,autoDestruct:!0});var n}async function U(t,e){const{scale:n=1,workerUrl:o,workerNumber:i=1}=e||{},r=Boolean(e?.debug),a=e?.features??!0,s=t.ownerDocument??(d?window.document:void 0),c=t.ownerDocument?.defaultView??(d?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:r,fetch:{requestInit:(m=e?.fetch?.bypassingCache,{cache:m?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:H(r),node:t,ownerDocument:s,ownerWindow:c,dpi:1===n?null:96*n,svgStyleElement:B(s),svgDefsElement:s?.createElementNS(P,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:h&&o&&i?i:0})].map(()=>{try{const t=new Worker(o);return t.onmessage=async t=>{const{url:e,result:n}=t.data;n?l.get(e)?.resolve?.(n):l.get(e)?.reject?.(new Error(`Error receiving message from worker: ${e}`))},t.onmessageerror=t=>{const{url:e}=t.data;l.get(e)?.reject?.(new Error(`Error receiving message from worker: ${e}`))},t}catch(t){return u.log.warn("Failed to new Worker",t),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[A(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:a,isEnable:t=>"restoreScrollPosition"===t?"boolean"!=typeof a&&(a[t]??!1):"boolean"==typeof a?a:a[t]??!0,shadowRoots:[]};var m;u.log.time("wait until load"),await async function(t,e){S(t)&&(E(t)||M(t)?await F(t,e):await Promise.all(["img","video"].flatMap(n=>Array.from(t.querySelectorAll(n)).map(t=>F(t,e)))))}(t,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:f,height:p}=function(t,e){let{width:n,height:o}=e;if(b(t)&&(!n||!o)){const e=t.getBoundingClientRect();n=n||e.width||Number(t.getAttribute("width"))||0,o=o||e.height||Number(t.getAttribute("height"))||0}return{width:n,height:o}}(t,u);return u.width=f,u.height=p,u}function B(t){if(!t)return;const e=t.createElement("style"),n=e.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return e.appendChild(n),e}async function V(t,e){const{log:n,timeout:o,drawImageCount:i,drawImageInterval:r}=e;n.time("image to canvas");const a=await F(t,{timeout:o,onWarn:e.log.warn}),{canvas:s,context2d:c}=function(t,e){const{width:n,height:o,scale:i,backgroundColor:r,maximumCanvasSize:a}=e,s=t.createElement("canvas");s.width=Math.floor(n*i),s.height=Math.floor(o*i),s.style.width=`${n}px`,s.style.height=`${o}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const c=s.getContext("2d");c&&r&&(c.fillStyle=r,c.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:c}}(t.ownerDocument,e),l=()=>{try{c?.drawImage(a,0,0,s.width,s.height)}catch(t){e.log.warn("Failed to drawImage",t)}};if(l(),e.isEnable("fixSvgXmlDecode"))for(let t=0;t<i;t++)await new Promise(e=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),e()},t+r)});return e.drawImageCount=0,n.timeEnd("image to canvas"),s}function O(t,e){if(t.ownerDocument)try{const e=t.toDataURL();if("data:,"!==e)return N(e,t.ownerDocument)}catch(t){e.log.warn("Failed to clone canvas",t)}const n=t.cloneNode(!1),o=t.getContext("2d"),i=n.getContext("2d");try{return o&&i&&i.putImageData(o.getImageData(0,0,t.width,t.height),0,0),n}catch(t){e.log.warn("Failed to clone canvas",t)}return n}function j(t,e){return(t=>"CANVAS"===t.tagName)(t)?O(t,e):(t=>"IFRAME"===t.tagName)(t)?function(t,e){try{if(t?.contentDocument?.body)return tt(t.contentDocument.body,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return t.cloneNode(!1)}(t,e):E(t)?function(t){const e=t.cloneNode(!1);return t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager"),e}(t):M(t)?async function(t,e){if(t.ownerDocument&&!t.currentSrc&&t.poster)return N(t.poster,t.ownerDocument);const n=t.cloneNode(!1);n.crossOrigin="anonymous",t.currentSrc&&t.currentSrc!==t.src&&(n.src=t.currentSrc);const o=n.ownerDocument;if(o){let i=!0;if(await F(n,{onError:()=>i=!1,onWarn:e.log.warn}),!i)return t.poster?N(t.poster,t.ownerDocument):n;n.currentTime=t.currentTime,await new Promise(t=>{n.addEventListener("seeked",t,{once:!0})});const r=o.createElement("canvas");r.width=t.offsetWidth,r.height=t.offsetHeight;try{const t=r.getContext("2d");t&&t.drawImage(n,0,0,r.width,r.height)}catch(o){return e.log.warn("Failed to clone video",o),t.poster?N(t.poster,t.ownerDocument):n}return O(r,e)}return n}(t,e):t.cloneNode(!1)}const z=["width","height","-webkit-text-fill-color"],X=["stroke","fill"];function Z(t,e,n){const{defaultComputedStyles:o}=n,i=t.nodeName.toLowerCase(),r=v(t)&&"svg"!==i,a=r?X.map(e=>[e,t.getAttribute(e)]).filter(([,t])=>null!==t):[],s=[r&&"svg",i,a.map((t,e)=>`${t}=${e}`).join(","),e].filter(Boolean).join(":");if(o.has(s))return o.get(s);const c=function(t){let e=t.sandbox;if(!e){const{ownerDocument:n}=t;try{n&&(e=n.createElement("iframe"),e.id=`__SANDBOX__${D()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",n.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',t.sandbox=e)}catch(e){t.log.warn("Failed to getSandBox",e)}}return e}(n),l=c?.contentWindow;if(!l)return new Map;const u=l?.document;let d,h;r?(d=u.createElementNS(P,"svg"),h=d.ownerDocument.createElementNS(d.namespaceURI,i),a.forEach(([t,e])=>{h.setAttributeNS(null,t,e)}),d.appendChild(h)):d=h=u.createElement(i),h.textContent=" ",u.body.appendChild(d);const m=l.getComputedStyle(h,e),f=new Map;for(let t=m.length,e=0;e<t;e++){const t=m.item(e);z.includes(t)||f.set(t,m.getPropertyValue(t))}return u.body.removeChild(d),o.set(s,f),f}function G(t,e,n){const o=new Map,i=[],r=new Map;if(n)for(const t of n)a(t);else for(let e=t.length,n=0;n<e;n++){a(t.item(n))}for(let t=i.length,e=0;e<t;e++)r.get(i[e])?.forEach((t,e)=>o.set(e,t));function a(n){const a=t.getPropertyValue(n),s=t.getPropertyPriority(n),c=n.lastIndexOf("-"),l=c>-1?n.substring(0,c):void 0;if(l){let t=r.get(l);t||(t=new Map,r.set(l,t)),t.set(n,[a,s])}(e.get(n)!==a||s)&&(l?i.push(l):o.set(n,[a,s]))}return o}const Y=[":before",":after"],q=[":-webkit-scrollbar",":-webkit-scrollbar-button",":-webkit-scrollbar-thumb",":-webkit-scrollbar-track",":-webkit-scrollbar-track-piece",":-webkit-scrollbar-corner",":-webkit-resizer"];const _=new Set(["symbol"]);async function J(t,e,n,o,i){if(b(n)&&((t=>"STYLE"===t.tagName)(n)||(t=>"SCRIPT"===t.tagName)(n)))return;if(o.filter&&!o.filter(n))return;_.has(e.nodeName)||_.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;const r=await tt(n,o,!1,i);o.isEnable("restoreScrollPosition")&&function(t,e){if(!S(t)||!S(e))return;const{scrollTop:n,scrollLeft:o}=t;if(!n&&!o)return;const{transform:i}=e.style,r=new DOMMatrix(i),{a:a,b:s,c:c,d:l}=r;r.a=1,r.b=0,r.c=0,r.d=1,r.translateSelf(-o,-n),r.a=a,r.b=s,r.c=c,r.d=l,e.style.transform=r.toString()}(t,r),e.appendChild(r)}async function Q(t,e,n,o){let i=t.firstChild;b(t)&&t.shadowRoot&&(i=t.shadowRoot?.firstChild,n.shadowRoots.push(t.shadowRoot));for(let r=i;r;r=r.nextSibling)if(!C(r))if(b(r)&&k(r)&&"function"==typeof r.assignedNodes){const i=r.assignedNodes();for(let r=0;r<i.length;r++)await J(t,e,i[r],n,o)}else await J(t,e,r,n,o)}const K=/^[\w-:]+$/;async function tt(t,e,n=!1,o){const{ownerDocument:i,ownerWindow:r,fontFamilies:a,onCloneEachNode:s}=e;if(i&&(t=>3===t.nodeType)(t))return o&&/\S/.test(t.data)&&o(t.data),i.createTextNode(t.data);if(i&&r&&b(t)&&(S(t)||v(t))){const o=await j(t,e);if(e.isEnable("removeAbnormalAttributes")){const t=o.getAttributeNames();for(let e=t.length,n=0;n<e;n++){const e=t[n];K.test(e)||o.removeAttribute(e)}}const i=e.currentNodeStyle=function(t,e,n,o){const{ownerWindow:i,includeStyleProperties:r,currentParentNodeStyle:a}=o,s=e.style,c=i.getComputedStyle(t),l=Z(t,null,o);a?.forEach((t,e)=>{l.delete(e)});const u=G(c,l,r);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&e.classList.add("______background-clip--text"),g&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||t.scrollWidth!==t.clientWidth||u.set("text-overflow",["clip",""]));for(let t=s.length,e=0;e<t;e++)s.removeProperty(s.item(e));return u.forEach(([t,e],n)=>{s.setProperty(n,t,e)}),u}(t,o,n,e);n&&function(t,e){const{backgroundColor:n,width:o,height:i,style:r}=e,a=t.style;if(n&&a.setProperty("background-color",n,"important"),o&&a.setProperty("width",`${o}px`,"important"),i&&a.setProperty("height",`${i}px`,"important"),r)for(const t in r)a[t]=r[t]}(o,e);let r=!1;if(e.isEnable("copyScrollbar")){const e=[i.get("overflow-x")?.[0],i.get("overflow-y")?.[0]];r=e.includes("scroll")||(e.includes("auto")||e.includes("overlay"))&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)}const c=i.get("text-transform")?.[0],l=W(i.get("font-family")?.[0]),u=l?t=>{"uppercase"===c?t=t.toUpperCase():"lowercase"===c?t=t.toLowerCase():"capitalize"===c&&(t=t[0].toUpperCase()+t.substring(1)),l.forEach(e=>{let n=a.get(e);n||a.set(e,n=new Set),t.split("").forEach(t=>n.add(t))})}:void 0;return function(t,e,n,o,i){const{ownerWindow:r,svgStyleElement:a,svgStyles:s,currentNodeStyle:c}=o;function l(n){const a=r.getComputedStyle(t,n);let l=a.getPropertyValue("content");if(!l||"none"===l)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,"");const u=[D()],d=Z(t,n,o);c?.forEach((t,e)=>{d.delete(e)});const h=G(a,d,o.includeStyleProperties);h.delete("content"),h.delete("-webkit-locale"),"text"===h.get("background-clip")?.[0]&&e.classList.add("______background-clip--text");const m=[`content: '${l}';`];if(h.forEach(([t,e],n)=>{m.push(`${n}: ${t}${e?" !important":""};`)}),1===m.length)return;try{e.className=[e.className,...u].join(" ")}catch(t){return void o.log.warn("Failed to copyPseudoClass",t)}const f=m.join("\n ");let p=s.get(f);p||(p=[],s.set(f,p)),p.push(`.${u[0]}:${n}`)}a&&r&&(Y.forEach(l),n&&q.forEach(l))}(t,o,r,e,u),function(t,e){((t=>"TEXTAREA"===t.tagName)(t)||(t=>"INPUT"===t.tagName)(t)||(t=>"SELECT"===t.tagName)(t))&&e.setAttribute("value",t.value)}(t,o),M(t)||await Q(t,o,e,u),await(s?.(o)),o}const c=t.cloneNode(!1);return await Q(t,c,e),await(s?.(c)),c}function et(t){if(t.ownerDocument=void 0,t.ownerWindow=void 0,t.svgStyleElement=void 0,t.svgDefsElement=void 0,t.svgStyles.clear(),t.defaultComputedStyles.clear(),t.sandbox){try{t.sandbox.remove()}catch(e){t.log.warn("Failed to destroyContext",e)}t.sandbox=void 0}t.workers=[],t.fontFamilies.clear(),t.fontCssTexts.clear(),t.requests.clear(),t.tasks=[],t.shadowRoots=[]}function nt(t,e){const{url:n,requestType:o="text",responseType:i="text",imageDom:r}=e;let a=n;const{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:h,placeholderImage:m},font:f,workers:p,fontFamilies:g}=t;"image"===o&&(y||w)&&t.drawImageCount++;let b=l.get(n);if(!b){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const e=o.startsWith("font")&&f&&f.minify,w=new Set;if(e){o.split(";")[1].split(",").forEach(t=>{g.has(t)&&g.get(t).forEach(t=>w.add(t))})}const v=e&&w.size,x={url:a,timeout:s,responseType:v?"arrayBuffer":i,headers:"image"===o?{accept:c}:void 0,...d};b={type:o,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(u&&"image"===o){const t=await u(n);if(t)return t}return!y&&n.startsWith("http")&&p.length?new Promise((t,e)=>{p[l.size&p.length-1].postMessage({rawUrl:n,...x}),b.resolve=t,b.reject=e}):function(t){const{url:e,timeout:n,responseType:o,...i}=t,r=new AbortController,a=n?setTimeout(()=>r.abort(),n):void 0;return fetch(e,{signal:r.signal,...i}).then(t=>{if(!t.ok)throw new Error("Failed fetch, not 2xx response",{cause:t});switch(o){case"arrayBuffer":return t.arrayBuffer();case"dataUrl":return t.blob().then(T);default:return t.text()}}).finally(()=>clearTimeout(a))}(x)})().catch(e=>{if(l.delete(n),"image"===o&&m)return t.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof m?m:m(r);throw e}),l.set(n,b)}return b.response}async function ot(t,e,n,o){if(!it(t))return t;for(const[i,r]of function(t,e){const n=[];return t.replace(rt,(t,o,i)=>(n.push([i,I(i,e)]),t)),n.filter(([t])=>!L(t))}(t,e))try{const e=await nt(n,{url:r,requestType:o?"image":"text",responseType:"dataUrl"});t=t.replace(at(i),`$1${e}$3`)}catch(t){n.log.warn("Failed to fetch css data url",i,t)}return t}function it(t){return/url\((['"]?)([^'"]+?)\1\)/.test(t)}const rt=/url\((['"]?)([^'"]+?)\1\)/g;function at(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}const st=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function ct(t,e){const{tasks:n}=e;b(t)&&((E(t)||x(t))&&n.push(...function(t,e){if(E(t)){const n=t.currentSrc||t.src;if(!L(n))return[nt(e,{url:n,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(e=>{e&&(t.srcset="",t.dataset.originalSrc=n,t.src=e||"")})];(y||w)&&e.drawImageCount++}else if(v(t)&&!L(t.href.baseVal)){const n=t.href.baseVal;return[nt(e,{url:n,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(e=>{e&&(t.dataset.originalSrc=n,t.href.baseVal=e||"")})]}return[]}(t,e)),"use"===t.tagName&&n.push(...function(t,e){const{ownerDocument:n,svgDefsElement:o}=e,i=t.getAttribute("href")??t.getAttribute("xlink:href");if(!i)return[];const[r,a]=i.split("#");if(a){const i=`#${a}`,s=e.shadowRoots.reduce((t,e)=>t??e.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(r&&t.setAttribute("href",i),o?.querySelector(i))return[];if(s)return o?.appendChild(s.cloneNode(!0)),[];if(r)return[nt(e,{url:r,responseType:"text"}).then(t=>{o?.insertAdjacentHTML("beforeend",t)})]}return[]}(t,e))),S(t)&&n.push(...function(t,e){return st.map(n=>{const o=t.getPropertyValue(n);return o&&"none"!==o?((y||w)&&e.drawImageCount++,ot(o,null,e,!0).then(e=>{e&&o!==e&&t.setProperty(n,e,t.getPropertyPriority(n))})):null}).filter(Boolean)}(t.style,e)),t.childNodes.forEach(t=>{ct(t,e)})}async function lt(t,e){const{ownerDocument:n,svgStyleElement:o,fontFamilies:i,fontCssTexts:r,tasks:a,font:s}=e;if(n&&o&&i.size)if(s&&s.cssText){const t=ft(s.cssText,e);o.appendChild(n.createTextNode(`${t}\n`))}else{const t=Array.from(n.styleSheets).filter(t=>{try{return"cssRules"in t&&Boolean(t.cssRules.length)}catch(n){return e.log.warn(`Error while reading CSS rules from ${t.href}`,n),!1}});await Promise.all(t.flatMap(t=>Array.from(t.cssRules).map(async(n,o)=>{if("CSSImportRule"===n.constructor.name){let i=o+1;const r=n.href;let a="";try{a=await nt(e,{url:r,requestType:"text",responseType:"text"})}catch(t){e.log.warn(`Error fetch remote css import from ${r}`,t)}const s=a.replace(rt,(t,e,n)=>t.replace(n,I(n,r)));for(const n of function(t){if(null==t)return[];const e=[];let n=t.replace(ut,"");for(;;){const t=dt.exec(n);if(!t)break;e.push(t[0])}n=n.replace(dt,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=o.exec(n);if(t)i.lastIndex=o.lastIndex;else{if(t=i.exec(n),!t)break;o.lastIndex=i.lastIndex}e.push(t[0])}return e}(s))try{t.insertRule(n,n.startsWith("@import")?i+=1:t.cssRules.length)}catch(t){e.log.warn("Error inserting rule from remote css import",{rule:n,error:t})}}})));t.flatMap(t=>Array.from(t.cssRules)).filter(t=>"CSSFontFaceRule"===t.constructor.name&&it(t.style.getPropertyValue("src"))&&W(t.style.getPropertyValue("font-family"))?.some(t=>i.has(t))).forEach(t=>{const i=t,s=r.get(i.cssText);s?o.appendChild(n.createTextNode(`${s}\n`)):a.push(ot(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,e).then(t=>{t=ft(t,e),r.set(i.cssText,t),o.appendChild(n.createTextNode(`${t}\n`))}))})}}const ut=/(\/\*[\s\S]*?\*\/)/g,dt=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const ht=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ft(t,e){const{font:n}=e,o=n?n?.preferredFormat:void 0;return o?t.replace(mt,t=>{for(;;){const[e,,n]=ht.exec(t)||[];if(!n)return"";if(n===o)return`src: ${e};`}}):t}async function pt(t,e){const n=await $(t,e);if(b(n.node)&&v(n.node))return n.node;const{ownerDocument:o,log:i,tasks:r,svgStyleElement:a,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:h,onEmbedNode:m,onCreateForeignObjectSvg:f}=n;i.time("clone node");const p=await tt(n.node,n,!0);if(a&&o){let t="";c.forEach((e,n)=>{t+=`${e.join(",\n")} {\n ${n}\n}\n`}),a.appendChild(o.createTextNode(t))}i.timeEnd("clone node"),await(h?.(p)),!1!==l&&b(p)&&(i.time("embed web font"),await lt(0,n),i.timeEnd("embed web font")),i.time("embed node"),ct(p,n);const g=r.length;let y=0;u?.(y,g),await Promise.all([...Array.from({length:4})].map(async()=>{for(;;){const t=r.pop();if(!t)break;try{await t}catch(t){n.log.warn("Failed to run task",t)}u?.(++y,g)}})),i.timeEnd("embed node"),await(m?.(p));const w=function(t,e){const{width:n,height:o}=e,i=function(t,e,n){const o=R(n).createElementNS(P,"svg");return o.setAttributeNS(null,"width",t.toString()),o.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${t} ${e}`),o}(n,o,t.ownerDocument),r=i.ownerDocument.createElementNS(i.namespaceURI,"foreignObject");return r.setAttributeNS(null,"x","0%"),r.setAttributeNS(null,"y","0%"),r.setAttributeNS(null,"width","100%"),r.setAttributeNS(null,"height","100%"),r.append(t),i.appendChild(r),i}(p,n);return s&&w.insertBefore(s,w.children[0]),a&&w.insertBefore(a,w.children[0]),d&&et(n),await(f?.(w)),w}async function gt(t,e){const n=await $(t,e),o=await pt(n),i=function(t,e){let n=(new XMLSerializer).serializeToString(t);return e&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=B(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(P,"defs"),n.svgStyles.clear());const r=N(i,o.ownerDocument);return await V(r,n)}async function yt(t,e){return async function(t,e){const n=await $(t,e),{log:o,quality:i,type:r,dpi:a}=n,s=await gt(n);o.time("canvas to data url");let c=s.toDataURL(r,i);if(["image/png","image/jpeg"].includes(r)&&a&&m&&f){const[t,e]=c.split(",");let n=0,o=!1;if("image/png"===r){const t=function(t){let e=t.indexOf("AAlwSFlz");return-1===e&&(e=t.indexOf("AAAJcEhZ")),-1===e&&(e=t.indexOf("AAAACXBI")),e}(e);t>=0?(n=4*Math.ceil((t+28)/3),o=!0):n=44}else"image/jpeg"===r&&(n=24);const i=e.substring(0,n),s=e.substring(n),l=window.atob(i),d=new Uint8Array(l.length);for(let t=0;t<d.length;t++)d[t]=l.charCodeAt(t);const h="image/png"===r?u(d,a,o):function(t,e){return t[13]=1,t[14]=e>>8,t[15]=255&e,t[16]=e>>8,t[17]=255&e,t}(d,a);c=[t,",",window.btoa(String.fromCharCode(...h)),s].join("")}return o.timeEnd("canvas to data url"),c}(await $(t,{...e,type:"image/png"}))}var wt={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function bt(t){const e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;const n=e[2].trim();return n.startsWith("#")?null:n}function vt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}var xt=function(t="[snapDOM]",{ttlMs:e=3e5,maxEntries:n=12}={}){const o=new Map;let i=0;function r(t,r,a){if(i>=n)return;const s=Date.now();(o.get(r)||0)>s||(o.set(r,s+e),i++,"warn"===t&&console&&console.warn||console&&console.error)}return{warnOnce(t,e){r("warn",t)},errorOnce(t,e){r("error",t)},reset(){o.clear(),i=0}}}("[snapDOM]",{ttlMs:18e4,maxEntries:10}),St=new Map,Ct=new Map;function Et(t,e){if(!e)return!1;if(function(t){return/^data:|^blob:|^about:blank$/i.test(t)}(t))return!1;if(function(t,e){try{const n="undefined"!=typeof location&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,i=new URL(o||".",n),r=new URL(t,n);if(r.origin===i.origin)return!0;const a=r.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}(t,e))return!1;try{const e="undefined"!=typeof location&&location.href?location.href:"http://localhost/",n=new URL(t,e);return"undefined"==typeof location||n.origin!==location.origin}catch{return!!e}}function Mt(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}async function kt(t,e={}){const n=e.as??"blob",o=e.timeout??3e3,i=e.useProxy||"",r=e.errorTTL??8e3,a=e.headers||{},s=!!e.silent;if(/^data:/i.test(t))try{if("text"===n)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if("dataURL"===n)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};const[,e="",o=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(o):decodeURIComponent(o),r=new Uint8Array([...i].map(t=>t.charCodeAt(0))),a=new Blob([r],{type:(e||"").split(";")[0]||""});return{ok:!0,data:a,status:200,url:t,fromCache:!1,mime:a.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{const e=await fetch(t);if(!e.ok)return{ok:!1,data:null,status:e.status,url:t,fromCache:!1,reason:"http_error"};const o=await e.blob(),i=o.type||e.headers.get("content-type")||"";if("dataURL"===n){return{ok:!0,data:await Mt(o),status:e.status,url:t,fromCache:!1,mime:i}}if("text"===n){return{ok:!0,data:await o.text(),status:e.status,url:t,fromCache:!1,mime:i}}return{ok:!0,data:o,status:e.status,url:t,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return"dataURL"===n?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:"text"===n?"":new Blob([]),status:200,url:t,fromCache:!1};const c=function(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}(t,{as:n,timeout:o,useProxy:i,errorTTL:r}),l=Ct.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&Ct.delete(c);const u=St.get(c);if(u)return u;const d=Et(t,i)?function(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",vt(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${vt(t)}`;const n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}(t,i):t;let h=e.credentials;if(!h)try{const e="undefined"!=typeof location&&location.href?location.href:"http://localhost/",n=new URL(t,e),o="undefined"!=typeof location&&n.origin===location.origin;h=o?"include":"omit"}catch{h="omit"}const m=new AbortController,f=setTimeout(()=>m.abort("timeout"),o),p=(async()=>{try{const o=await fetch(d,{signal:m.signal,credentials:h,headers:a});if(!o.ok){const i={ok:!1,data:null,status:o.status,url:d,fromCache:!1,reason:"http_error"};if(r>0&&Ct.set(c,{until:Date.now()+r,result:i}),!s){const e=`${o.status} ${o.statusText||""}`.trim();xt.warnOnce(`http:${o.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${e} while fetching ${n} ${t}`)}return e.onError&&e.onError(i),i}if("text"===n){return{ok:!0,data:await o.text(),status:o.status,url:d,fromCache:!1}}const i=await o.blob(),l=i.type||o.headers.get("content-type")||"";if("dataURL"===n){return{ok:!0,data:await Mt(i),status:o.status,url:d,fromCache:!1,mime:l}}return{ok:!0,data:i,status:o.status,url:d,fromCache:!1,mime:l}}catch(i){const a=i&&"object"==typeof i&&"name"in i&&"AbortError"===i.name?String(i.message||"").includes("timeout")?"timeout":"abort":"network",l={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:a};if(!/^blob:/i.test(t)&&r>0&&Ct.set(c,{until:Date.now()+r,result:l}),!s){const e=`${a}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,i="timeout"===a?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:"abort"===a?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;xt.errorOnce(e,i)}return e.onError&&e.onError(l),l}finally{clearTimeout(f),St.delete(c)}})();return St.set(c,p),p}function At(t,e){if(!e||!t.width||!t.height)return t;const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}async function Lt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||"none"===t.trim())return t;const n=bt(t);if(!n)return t;const o=vt(n);if(wt.background.has(o)){const t=wt.background.get(o);return t?`url("${t}")`:"none"}try{const t=await kt(o,{as:"dataURL",useProxy:e.useProxy});return t.ok?(wt.background.set(o,t.data),`url("${t.data}")`):(wt.background.set(o,null),"none")}catch{return wt.background.set(o,null),"none"}}var It=new Set(["meta","script","noscript","title","link","template"]),Rt=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);var Pt=/(?:^|-)(animation|transition)(?:-|$)/i,Tt=/^(--|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,Nt=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function Ft(t){const e=String(t).toLowerCase();return!!Nt.has(e)||(!!Tt.test(e)||!!Pt.test(e))}function Dt(t,e){if(e=String(e||"").toLowerCase(),Rt.has(e))return"";const n=[],o=function(t){if(t=String(t).toLowerCase(),Rt.has(t)){const e={};return wt.defaultStyle.set(t,e),e}if(wt.defaultStyle.has(t))return wt.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));const n=document.createElement(t);n.style.all="initial",e.appendChild(n);const o=getComputedStyle(n),i={};for(let t of o){if(Ft(t))continue;const e=o.getPropertyValue(t);i[t]=e}return e.removeChild(n),wt.defaultStyle.set(t,i),i}(e);for(let[e,i]of Object.entries(t)){if(Ft(e))continue;const t=o[e];i&&i!==t&&n.push(`${e}:${i}`)}return n.sort(),n.join(";")}function Wt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=wt.computedStyle.get(t);if(n||(n=new Map,wt.computedStyle.set(t,n)),!n.has(e)){const o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Ht(t){const e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function $t(t){const e=[];let n=0,o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&n++,")"===r&&n--,","===r&&0===n&&(e.push(t.slice(o,i).trim()),o=i+1)}return e.push(t.slice(o).trim()),e}function Ut(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function Bt(){const t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),o=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||o}var Vt=new WeakMap,Ot=new Map,jt=0;function zt(){jt++}var Xt=!1;var Zt=new WeakMap;function Gt(t,e=null,n={}){const o=Vt.get(t);if(o&&o.epoch===jt)return o.snapshot;const i=e||getComputedStyle(t),r=function(t,e={}){const n={},o=t.getPropertyValue("visibility");for(let e=0;e<t.length;e++){const o=t[e];let i=t.getPropertyValue(o);"background-image"!==o&&"content"!==o||!i.includes("url(")||i.includes("data:")||(i="none"),n[o]=i}if(e.embedFonts){const e=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(const o of e)if(!n[o])try{const e=t.getPropertyValue(o);e&&(n[o]=e)}catch{}}return"hidden"===o&&(n.opacity="0"),n}(i,n);return function(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;const o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;if(function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}(t))return;const i=e.position;if("absolute"===i||"fixed"===i||"sticky"===i)return;if("none"!==e.transform)return;if(function(t){if(t.backgroundImage&&"none"!==t.backgroundImage)return!0;if(t.backgroundColor&&"rgba(0, 0, 0, 0)"!==t.backgroundColor&&"transparent"!==t.backgroundColor)return!0;if((parseFloat(t.borderTopWidth)||0)>0)return!0;if((parseFloat(t.borderBottomWidth)||0)>0)return!0;if((parseFloat(t.paddingTop)||0)>0)return!0;if((parseFloat(t.paddingBottom)||0)>0)return!0;const e=t.overflowBlock||t.overflowY||"visible";return"visible"!==e}(e))return;if(function(t){const e=t.parentElement;if(!e)return!1;const n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}(t))return;if(!function(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;const n=t.firstElementChild,o=t.lastElementChild;if(n&&"BR"===n.tagName||o&&"BR"===o.tagName)return!0;const i=t.scrollHeight;if(0===i)return!1;const r=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return i>r+a}(t,e))return;delete n.height,delete n["block-size"]}(t,i,r),Vt.set(t,{epoch:jt,snapshot:r}),r}async function Yt(t,e,n,o){if("STYLE"===t.tagName)return;const i=function(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Ot,defaultStyle:wt.defaultStyle,baseStyle:wt.baseStyle,image:wt.image,resource:wt.resource,background:wt.background,font:wt.font},options:e||{}}:{session:wt.session,persist:{snapshotKeyCache:Ot,defaultStyle:wt.defaultStyle,baseStyle:wt.baseStyle,image:wt.image,resource:wt.resource,background:wt.background,font:wt.font},options:t||e||{}}}(n,o),r=i.options&&i.options.cache||"auto";if("disabled"!==r&&function(t=document.documentElement){if(!Xt){Xt=!0;try{new MutationObserver(()=>zt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>zt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{const t=document.fonts;t&&(t.addEventListener?.("loadingdone",zt),t.ready?.then(()=>zt()).catch(()=>{}))}catch{}}}(document.documentElement),"disabled"!==r||i.session.__bumpedForDisabled||(zt(),Ot.clear(),i.session.__bumpedForDisabled=!0),Rt.has(t.tagName?.toLowerCase())){const n=t.getAttribute?.("style");n&&e.setAttribute("style",n)}const{session:a,persist:s}=i;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));const c=Gt(t,a.styleCache.get(t),i.options),l=function(t){let e=Zt.get(t);return e||(e=Object.entries(t).sort((t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0).map(([t,e])=>`${t}:${e}`).join(";"),Zt.set(t,e),e)}(c);let u=s.snapshotKeyCache.get(l);if(!u){u=Dt(c,t.tagName?.toLowerCase()||"div"),s.snapshotKeyCache.set(l,u)}a.styleMap.set(e,u)}function qt(t,e,n){return Promise.all(t.map(t=>new Promise(o=>{!function i(){Ut(n=>{!n||"function"!=typeof n.timeRemaining||n.timeRemaining()>0?e(t,o):i()},{fast:n})}()})))}function _t(t,e){return t?t=(t=(t=(t=(t=t.replace(/:host\(([^)]+)\)/g,(t,n)=>`:where(${e}:is(${n.trim()}))`)).replace(/:host\b/g,`:where(${e})`)).replace(/:host-context\(([^)]+)\)/g,(t,n)=>`:where(:where(${n.trim()}) ${e})`)).replace(/::slotted\(([^)]+)\)/g,(t,n)=>`:where(${e} ${n.trim()})`)).replace(/(^|})(\s*)([^@}{]+){/g,(t,n,o,i)=>{const r=function(t,e,n=!0){return t.split(",").map(t=>t.trim()).filter(Boolean).map(t=>{if(t.startsWith(":where("))return t;if(t.startsWith("@"))return t;const o=n?(i=(i=t).trim())?/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(i)?i:`${i}:not([data-sd-slotted])`:i:t;var i;return`:where(${e} ${o})`}).join(", ")}(i,e,!0);return`${n}${o}${r}{`}):""}function Jt(t,e){try{let n=getComputedStyle(t).getPropertyValue(e).trim();if(n)return n}catch{}try{let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(t)return t}catch{}return""}async function Qt(t,e,n){const o=await async function(t,e=3){const n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}};let o=n(),i=0;for(;i<e&&(!o||!o.body&&!o.documentElement);)await new Promise(t=>setTimeout(t,0)),o=n(),i++;return o&&(o.body||o.documentElement)?o:null}(t,3);if(!o)throw new Error("iframe document not accessible/ready");const{contentWidth:i,contentHeight:r,rect:a}=function(t){const e=t.getBoundingClientRect();let n=0,o=0,i=0,r=0;try{const e=getComputedStyle(t);n=parseFloat(e.borderLeftWidth)||0,o=parseFloat(e.borderRightWidth)||0,i=parseFloat(e.borderTopWidth)||0,r=parseFloat(e.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(e.width-(n+o))),contentHeight:Math.max(0,Math.round(e.height-(i+r))),rect:e}}(t),s=n?.snap;if(!s||"function"!=typeof s.toPng)throw new Error("snapdom.toPng not available in iframe or window");const c={...n,scale:1},l=function(t,e,n){const o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}(o,i,r);let u;try{u=await s.toPng(o.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${i}px`,u.style.height=`${r}px`;const d=document.createElement("div");return e.nodeMap.set(d,t),Yt(t,d,e,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}async function Kt(t,e,n){if(!t)throw new Error("Invalid node");const o=new Set;let i,r=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){const e=(t.localName||t.tagName||"").toLowerCase();if("snapdom-sandbox"===t.id||t.hasAttribute("data-snapdom-sandbox"))return null;if(It.has(e))return null}if(t.nodeType===Node.TEXT_NODE)return t.cloneNode(!0);if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if("exclude"===t.getAttribute("data-capture")){if("hide"===n.excludeMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.excludeMode)return null}if(n.exclude&&Array.isArray(n.exclude))for(const e of n.exclude)try{if(t.matches?.(e)){if("hide"===n.excludeMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.excludeMode)return null}}catch(t){}if("function"==typeof n.filter)try{if(!n.filter(t)){if("hide"===n.filterMode){const e=document.createElement("div"),n=t.getBoundingClientRect();return e.style.cssText=`display:inline-block;width:${n.width}px;height:${n.height}px;visibility:hidden;`,e}if("remove"===n.filterMode)return null}}catch(t){}if("IFRAME"===t.tagName){let o=!1;try{o=!(!t.contentDocument&&!t.contentWindow?.document)}catch{o=!1}if(o)try{return await Qt(t,e,n)}catch(t){}if(n.placeholders){const o=document.createElement("div");return o.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Yt(t,o,e,n),o}{const o=t.getBoundingClientRect(),i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${o.width}px;height:${o.height}px;visibility:hidden;`,Yt(t,i,e,n),i}}if("placeholder"===t.getAttribute("data-capture")){const o=t.cloneNode(!1);e.nodeMap.set(o,t),Yt(t,o,e,n);const i=document.createElement("div");return i.textContent=t.getAttribute("data-placeholder-text")||"",i.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",o.appendChild(i),o}if("CANVAS"===t.tagName){const o=t.toDataURL(),i=document.createElement("img");return i.src=o,i.width=t.width,i.height=t.height,e.nodeMap.set(i,t),Yt(t,i,e,n),i}try{if(i=t.cloneNode(!1),function(t,e){if(!(t instanceof Element&&e instanceof Element))return;const n=t.getAttribute?.("style");let o,i=!(!n||!n.includes("var("));if(!i&&t.attributes?.length){const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t];if(n&&"string"==typeof n.value&&n.value.includes("var(")){i=!0;break}}}if(!i)return;try{o=getComputedStyle(t)}catch{return}const r=t.style;if(r&&r.length)for(let t=0;t<r.length;t++){const n=r[t],i=r.getPropertyValue(n);if(!i||!i.includes("var("))continue;const a=o.getPropertyValue(n);if(a)try{e.style.setProperty(n,a.trim(),r.getPropertyPriority(n))}catch{}}if(t.attributes?.length){const n=t.attributes;for(let t=0;t<n.length;t++){const i=n[t];if(!i||"string"!=typeof i.value||!i.value.includes("var("))continue;const r=i.name;let a="";try{a=o.getPropertyValue(r)}catch{}if(a)try{e.style.setProperty(r,a.trim())}catch{}}}}(t,i),e.nodeMap.set(i,t),"IMG"===t.tagName){!function(t,e){try{const n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}(t,i);try{const e=t.getBoundingClientRect();let n=Math.round(e.width||0),o=Math.round(e.height||0);if(!n||!o){const e=window.getComputedStyle(t),i=parseFloat(e.width)||0,r=parseFloat(e.height)||0,a=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,c=t.width||t.naturalWidth||0,l=t.height||t.naturalHeight||0;n=Math.round(n||i||a||c||0),o=Math.round(o||r||s||l||0)}n&&(i.dataset.snapdomWidth=String(n)),o&&(i.dataset.snapdomHeight=String(o))}catch{}}}catch(t){throw t}if(t instanceof HTMLTextAreaElement){const e=t.getBoundingClientRect();i.style.width=`${e.width}px`,i.style.height=`${e.height}px`}if(t instanceof HTMLInputElement&&(i.value=t.value,i.setAttribute("value",t.value),void 0!==t.checked&&(i.checked=t.checked,t.checked&&i.setAttribute("checked",""),t.indeterminate&&(i.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),Yt(t,i,e,n),t.shadowRoot){let r=function(t,o){if(t.nodeType===Node.ELEMENT_NODE&&"STYLE"===t.tagName)return o(null);Kt(t,e,n).then(t=>{o(t||null)}).catch(()=>{o(null)})};try{const e=t.shadowRoot.querySelectorAll("slot");for(const t of e){let e=[];try{e=t.assignedNodes?.({flatten:!0})||t.assignedNodes?.()||[]}catch{e=t.assignedNodes?.()||[]}for(const t of e)o.add(t)}}catch{}const a=function(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}(e),s=`[data-sd="${a}"]`;try{i.setAttribute("data-sd",a)}catch{}const c=function(t){let e="";try{t.querySelectorAll("style").forEach(t=>{e+=(t.textContent||"")+"\n"});const n=t.adoptedStyleSheets||[];for(const t of n)try{if(t&&t.cssRules)for(const n of t.cssRules)e+=n.cssText+"\n"}catch{}}catch{}return e}(t.shadowRoot),l=_t(c,s),u=function(t,e,n){const o=[];for(const n of e){const e=Jt(t,n);e&&o.push(`${n}: ${e};`)}return o.length?`${n}{${o.join("")}}\n`:""}(t,function(t){const e=new Set;if(!t)return e;const n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;let o;for(;o=n.exec(t);)e.add(o[1]);return e}(c),s);!function(t,e,n){if(!e)return;const o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}(i,u+l,a);const d=document.createDocumentFragment(),h=await qt(Array.from(t.shadowRoot.childNodes),r,n.fast);d.append(...h.filter(t=>!!t)),i.appendChild(d)}if("SLOT"===t.tagName){let o=function(t,o){Kt(t,e,n).then(t=>{var e;t&&(e=t)&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted",""))),o(t||null)}).catch(()=>{o(null)})};const i=t.assignedNodes?.({flatten:!0})||[],r=i.length>0?i:Array.from(t.childNodes),a=document.createDocumentFragment(),s=await qt(Array.from(r),o,n.fast);return a.append(...s.filter(t=>!!t)),a}const s=await qt(Array.from(t.childNodes),function(t,i){if(o.has(t))return i(null);Kt(t,e,n).then(t=>{i(t||null)}).catch(()=>{i(null)})},n.fast);if(i.append(...s.filter(t=>!!t)),null!==r&&i instanceof HTMLSelectElement){i.value=r;for(const t of i.options)t.value===r?t.setAttribute("selected",""):t.removeAttribute("selected")}return null!==a&&i instanceof HTMLTextAreaElement&&(i.textContent=a),i}var te=[/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],ee=[];function ne(t){const e="string"==typeof t?t:"",n=[...te,...ee];for(const t of n)if(t instanceof RegExp&&t.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}async function oe(t,e,n,o=32,i="#000"){e=e.replace(/^['"]+|['"]+$/g,"");const r=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}const a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);const s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);const u=document.createElement("canvas");u.width=Math.max(1,c*r),u.height=Math.max(1,l*r);const d=u.getContext("2d");return d.scale(r,r),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var ie=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function re(t){if(!t)return"";for(let e of t.split(",")){let t=e.trim().replace(/^['"]+|['"]+$/g,"");if(t&&!ie.has(t.toLowerCase()))return t}return""}function ae(t){const e=String(t??"400").trim().toLowerCase();if("normal"===e)return 400;if("bold"===e)return 700;const n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function se(t){const e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function ce(t,e){if(!t)return!1;try{const n=new URL(t,location.href);if(n.origin===location.origin)return!0;const o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(t=>o.endsWith(t)))return!0;const i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i))return!0;for(const t of e){const e=t.toLowerCase().replace(/\s+/g,"+"),n=t.toLowerCase().replace(/\s+/g,"-");if(i.includes(e)||i.includes(n))return!0}return!1}catch{return!1}}function le(t,e){return t?t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(t,n,o)=>{const i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return t;let r=i;try{r=new URL(i,e||location.href).href}catch{}return`url("${r}")`}):t}var ue=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g;async function de(t,e,n){if(!t)return t;const o=new Set;function i(t,e){try{return new URL(t,e||location.href).href}catch{return t}}let r=le(t,e||location.href);return r=await async function t(e,r,a=0){if(a>4)return e;let s,c="",l=0;for(;s=ue.exec(e);){c+=e.slice(l,s.index),l=ue.lastIndex;const u=i((s[2]||s[4]||"").trim(),r);if(o.has(u))continue;o.add(u);let d="";try{const t=await kt(u,{as:"text",useProxy:n,silent:!0});t.ok&&"string"==typeof t.data&&(d=t.data)}catch{}d?(d=le(d,u),d=await t(d,u,a+1),c+=`\n/* inlined: ${u} */\n${d}\n`):c+=s[0]}return c+=e.slice(l),c}(r,e||location.href,0),r}var he=/url\((["']?)([^"')]+)\1\)/g,me=/@font-face[^{}]*\{[^}]*\}/g;function fe(t){if(!t)return[];const e=[],n=t.split(",").map(t=>t.trim()).filter(Boolean);for(const t of n){const n=t.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;const o=n[1],i=n[2],r=t=>{if(!t.includes("?"))return parseInt(t,16);return[parseInt(t.replace(/\?/g,"0"),16),parseInt(t.replace(/\?/g,"F"),16)]};if(i){const t=r(o),n=r(i),a=Array.isArray(t)?t[0]:t,s=Array.isArray(n)?n[1]:n;e.push([Math.min(a,s),Math.max(a,s)])}else{const t=r(o);Array.isArray(t)?e.push([t[0],t[1]]):e.push([t,t])}}return e}function pe(t,e){if(!e.length)return!0;if(!t||0===t.size)return!0;for(const n of t)for(const[t,o]of e)if(n>=t&&n<=o)return!0;return!1}function ge(t,e){const n=[];if(!t)return n;for(const o of t.matchAll(he)){let t=(o[2]||"").trim();if(t&&!t.startsWith("data:")){if(!/^https?:/i.test(t))try{t=new URL(t,e||location.href).href}catch{}n.push(t)}}return n}async function ye(t,e,n=""){let o=t;for(const i of t.matchAll(he)){const t=bt(i[0]);if(!t)continue;let r=t;if(!r.startsWith("http")&&!r.startsWith("data:"))try{r=new URL(r,e||location.href).href}catch{}if(!ne(r))if(wt.resource?.has(r))wt.font?.add(r),o=o.replace(i[0],`url(${wt.resource.get(r)})`);else if(!wt.font?.has(r))try{const t=await kt(r,{as:"dataURL",useProxy:n,silent:!0});if(t.ok&&"string"==typeof t.data){const e=t.data;wt.resource?.set(r,e),wt.font?.add(r),o=o.replace(i[0],`url(${e})`)}}catch{}}return o}function we(t={}){const e=new Set((t.families||[]).map(t=>String(t).toLowerCase())),n=new Set((t.domains||[]).map(t=>String(t).toLowerCase())),o=new Set((t.subsets||[]).map(t=>String(t).toLowerCase()));return(t,i)=>{if(e.size&&e.has(t.family.toLowerCase()))return!0;if(n.size)for(const e of t.srcUrls)try{if(n.has(new URL(e).host.toLowerCase()))return!0}catch{}if(o.size){const t=function(t){if(!t.length)return null;const e=(e,n)=>t.some(([t,o])=>!(o<e||t>n)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),i=e(880,1023),r=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":r?"cyrillic":i?"greek":o?"latin-ext":n?"latin":null}(i);if(t&&o.has(t))return!0}return!1}}async function be(t,e,n,o){let i;try{i=t.cssRules||[]}catch{return}const r=(t,e)=>{try{return new URL(t,e||location.href).href}catch{return t}};for(const t of i){if(t.type===CSSRule.IMPORT_RULE&&t.styleSheet){const i=t.href?r(t.href,e):e;if(o.depth>=4)continue;if(i&&o.visitedSheets.has(i))continue;i&&o.visitedSheets.add(i);const a={...o,depth:(o.depth||0)+1};await be(t.styleSheet,i,n,a);continue}if(t.type===CSSRule.FONT_FACE_RULE){const i=re((t.style.getPropertyValue("font-family")||"").trim());if(!i||ne(i))continue;const r=(t.style.getPropertyValue("font-weight")||"400").trim(),a=(t.style.getPropertyValue("font-style")||"normal").trim(),s=(t.style.getPropertyValue("font-stretch")||"100%").trim(),c=(t.style.getPropertyValue("src")||"").trim(),l=(t.style.getPropertyValue("unicode-range")||"").trim();if(!o.faceMatchesRequired(i,a,r,s))continue;const u=fe(l);if(!pe(o.usedCodepoints,u))continue;const d={family:i,weightSpec:r,styleSpec:a,stretchSpec:s,unicodeRange:l,srcRaw:c,srcUrls:ge(c,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(d,u))continue;if(/url\(/i.test(c)){const t=await ye(c,e||location.href,o.useProxy);await n(`@font-face{font-family:${i};src:${t};font-style:${a};font-weight:${r};font-stretch:${s};${l?`unicode-range:${l};`:""}}`)}else await n(`@font-face{font-family:${i};src:${c};font-style:${a};font-weight:${r};font-stretch:${s};${l?`unicode-range:${l};`:""}}`)}}}async function ve({required:t,usedCodepoints:e,exclude:n,localFonts:o=[],useProxy:i=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);const r=new Map;for(const e of t){const[t,n,o,i]=String(e).split("__");if(!t)continue;const a=r.get(t)||[];a.push({w:parseInt(n,10),s:o,st:parseInt(i,10)}),r.set(t,a)}function a(t,e,n,o){if(!r.has(t))return!1;const i=r.get(t),a=function(t){const e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){const t=ae(n[1]),e=ae(n[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}const o=ae(e);return{min:o,max:o}}(n),s=function(t){const e=String(t||"normal").trim().toLowerCase();return"italic"===e?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}(e),c=function(t){const e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){const t=parseFloat(n[1]),e=parseFloat(n[2]);return{min:Math.min(t,e),max:Math.max(t,e)}}const o=e.match(/(\d+(?:\.\d+)?)\s*%/),i=o?parseFloat(o[1]):100;return{min:i,max:i}}(o),l=a.min!==a.max,u=a.min,d=t=>"normal"===s.kind&&"normal"===t||"normal"!==s.kind&&("italic"===t||"oblique"===t);let h=!1;for(const t of i){const e=l?t.w>=a.min&&t.w<=a.max:t.w===u,n=d(se(t.s)),o=t.st>=c.min&&t.st<=c.max;if(e&&n&&o){h=!0;break}}if(h)return!0;if(!l)for(const t of i){const e=d(se(t.s)),n=t.st>=c.min&&t.st<=c.max;if(Math.abs(u-t.w)<=300&&e&&n)return!0}return!1}const s=we(n),c=function(t,e,n,o){return`fonts-embed-css::req=${Array.from(t||[]).sort().join("|")}::ex=${e?JSON.stringify({families:(e.families||[]).map(t=>String(t).toLowerCase()).sort(),domains:(e.domains||[]).map(t=>String(t).toLowerCase()).sort(),subsets:(e.subsets||[]).map(t=>String(t).toLowerCase()).sort()}):""}::lf=${(n||[]).map(t=>`${(t.family||"").toLowerCase()}::${t.weight||"normal"}::${t.style||"normal"}::${t.src||""}`).sort().join("|")}::px=${o||""}`}(t,n,o,i);if(wt.resource?.has(c))return wt.resource.get(c);const l=function(t){const e=new Set;for(const n of t||[]){const t=String(n).split("__")[0]?.trim();t&&e.add(t)}return e}(t),u=[],d=ue;for(const t of document.querySelectorAll("style")){const e=t.textContent||"";for(const t of e.matchAll(d)){const e=(t[2]||t[4]||"").trim();if(!e||ne(e))continue;!!document.querySelector(`link[rel="stylesheet"][href="${e}"]`)||u.push(e)}}u.length&&await Promise.all(u.map(t=>new Promise(e=>{if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return e(null);const n=document.createElement("link");n.rel="stylesheet",n.href=t,n.setAttribute("data-snapdom","injected-import"),n.onload=()=>e(n),n.onerror=()=>e(null),document.head.appendChild(n)})));let h="";const m=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(t=>!!t.href);for(const t of m)try{if(ne(t.href))continue;let o="",r=!1;try{r=new URL(t.href,location.href).origin===location.origin}catch{}if(!r&&!ce(t.href,l))continue;if(r){const e=Array.from(document.styleSheets).find(e=>e.href===t.href);if(e)try{const t=e.cssRules||[];o=Array.from(t).map(t=>t.cssText).join("")}catch{}}if(!o){if(o=(await kt(t.href,{as:"text",useProxy:i})).data,ne(t.href))continue}o=await de(o,t.href,i);let c="";for(const r of o.match(me)||[]){const o=re((r.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim());if(!o||ne(o))continue;const l=(r.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),u=(r.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),d=(r.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),h=(r.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),m=(r.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),f=ge(m,t.href);if(!a(o,u,l,d))continue;const p=fe(h);if(!pe(e,p))continue;const g={family:o,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:m,srcUrls:f,href:t.href};if(n&&s(g,p))continue;c+=/url\(/i.test(m)?await ye(r,t.href,i):r}c.trim()&&(h+=c)}catch{}const f={requiredIndex:r,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?we(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(const t of document.styleSheets)if(!t.href||!m.some(e=>e.href===t.href))try{const e=t.href||location.href;e&&f.visitedSheets.add(e),await be(t,e,async t=>{h+=t},f)}catch{}try{for(const t of document.fonts||[]){if(!t||!t.family||"loaded"!==t.status||!t._snapdomSrc)continue;const e=String(t.family).replace(/^['"]+|['"]+$/g,"");if(ne(e))continue;if(!r.has(e))continue;if(n?.families&&n.families.some(t=>String(t).toLowerCase()===e.toLowerCase()))continue;let o=t._snapdomSrc;if(!String(o).startsWith("data:"))if(wt.resource?.has(t._snapdomSrc))o=wt.resource.get(t._snapdomSrc),wt.font?.add(t._snapdomSrc);else if(!wt.font?.has(t._snapdomSrc))try{const e=await kt(t._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(!e.ok||"string"!=typeof e.data)continue;o=e.data,wt.resource?.set(t._snapdomSrc,o),wt.font?.add(t._snapdomSrc)}catch{continue}h+=`@font-face{font-family:'${e}';src:url(${o});font-style:${t.style||"normal"};font-weight:${t.weight||"normal"};}`}}catch{}for(const t of o){if(!t||"object"!=typeof t)continue;const e=String(t.family||"").replace(/^['"]+|['"]+$/g,"");if(!e||ne(e))continue;if(!r.has(e))continue;if(n?.families&&n.families.some(t=>String(t).toLowerCase()===e.toLowerCase()))continue;const o=null!=t.weight?String(t.weight):"normal",a=null!=t.style?String(t.style):"normal",s=null!=t.stretchPct?`${t.stretchPct}%`:"100%",c=String(t.src||"");let l=c;if(!l.startsWith("data:"))if(wt.resource?.has(c))l=wt.resource.get(c),wt.font?.add(c);else if(!wt.font?.has(c))try{const t=await kt(c,{as:"dataURL",useProxy:i,silent:!0});if(!t.ok||"string"!=typeof t.data)continue;l=t.data,wt.resource?.set(c,l),wt.font?.add(c)}catch{continue}h+=`@font-face{font-family:'${e}';src:url(${l});font-style:${a};font-weight:${o};font-stretch:${s};}`}return h&&(h=function(t){if(!t)return t;const e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(const i of t.match(e)||[]){const t=re(i.match(/font-family:\s*([^;]+);/i)?.[1]||""),e=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),r=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),a=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),s=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),c=(i.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),l=ge(c,location.href),u=l.length?l.map(t=>String(t).toLowerCase()).sort().join("|"):c.toLowerCase(),d=[String(t||"").toLowerCase(),e,r,a,s.toLowerCase(),u].join("|");n.has(d)||(n.add(d),o.push(i))}if(0===o.length)return t;let i=0;return t.replace(e,()=>o[i++]||"")}(h),wt.resource?.set(c,h)),h}function xe(t){const e=new Set;if(!t)return e;const n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=t=>{const n=re(t.fontFamily);if(!n)return;var o,i,r;e.add((o=t.fontWeight,i=t.fontStyle,r=t.fontStretch,`${n}__${ae(o)}__${se(i)}__${function(t){const e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}(r)}`))};o(getComputedStyle(t));const i=getComputedStyle(t,"::before");i&&i.content&&"none"!==i.content&&o(i);const r=getComputedStyle(t,"::after");for(r&&r.content&&"none"!==r.content&&o(r);n.nextNode();){const t=n.currentNode;o(getComputedStyle(t));const e=getComputedStyle(t,"::before");e&&e.content&&"none"!==e.content&&o(e);const i=getComputedStyle(t,"::after");i&&i.content&&"none"!==i.content&&o(i)}return e}function Se(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function Ce(t,e=!0){const 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"]];let o=Math.max(1,Math.min(3999,t)),i="";for(const[t,e]of n)for(;o>=t;)i+=e,o-=t;return e?i:i.toLowerCase()}function Ee(t,e){switch((e||"decimal").toLowerCase()){case"decimal":default:return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Se(t,!1);case"upper-alpha":return Se(t,!0);case"lower-roman":return Ce(t,!1);case"upper-roman":return Ce(t,!0)}}function Me(t){const e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=t=>{let e=0,n=t?.parentElement;if(!n)return 0;for(const o of n.children){if(o===t)break;"LI"===o.tagName&&e++}return e},i=(t,e,n)=>{const i=(t=>{const e=new Map;for(const[n,o]of t)e.set(n,o.slice());return e})(t);let r,a;try{r=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(r&&"none"!==r)for(const t of r.split(",")){const n=t.trim().split(/\s+/),o=n[0],r=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!o)continue;const a=e.get(o);if(a&&a.length){const t=a.slice();t.push(r),i.set(o,t)}else i.set(o,[r])}try{a=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(a&&"none"!==a)for(const t of a.split(",")){const e=t.trim().split(/\s+/),n=e[0],o=Number.isFinite(Number(e[1]))?Number(e[1]):1;if(!n)continue;const r=i.get(n)||[];0===r.length&&r.push(0),r[r.length-1]+=o,i.set(n,r)}try{if("list-item"===getComputedStyle(n).display&&(t=>t&&"LI"===t.tagName)(n)){const t=n.parentElement;let e=1;if(t&&"OL"===t.tagName){const i=t.getAttribute("start"),r=Number.isFinite(Number(i))?Number(i):1,a=o(n),s=n.getAttribute("value");e=Number.isFinite(Number(s))?Number(s):r+a}else e=1+o(n);const r=i.get("list-item")||[];0===r.length&&r.push(0),r[r.length-1]=e,i.set("list-item",r)}}catch{}return i},r=(t,n,o)=>{const a=i(o,n,t);e.set(t,a);let s=a;for(const e of t.children){s=r(e,a,s)}return a},a=new Map;return r(n,a,a),{get(t,n){const o=e.get(t)?.get(n);return o&&o.length?o[o.length-1]:0},getStack(t,n){const o=e.get(t)?.get(n);return o?o.slice():[]}}}var ke=null,Ae=new WeakMap;function Le(t,e){const n=t.parentElement,o=n?Ae.get(n):null;return o?{get(t,n){const i=e.get(t,n),r=o.get(n);return"number"==typeof r?Math.max(i,r):i},getStack(t,n){const i=e.getStack(t,n);if(!i.length)return i;const r=o.get(n);if("number"==typeof r){const t=i.slice();return t[t.length-1]=Math.max(t[t.length-1],r),t}return i}}:e}function Ie(t,e,n){const o=new Map;function i(t){const e=[];if(!t||"none"===t)return e;for(const n of String(t).split(",")){const t=n.trim().split(/\s+/),o=t[0],i=Number.isFinite(Number(t[1]))?Number(t[1]):void 0;o&&e.push({name:o,num:i})}return e}const r=i(e?.counterReset),a=i(e?.counterIncrement);function s(e){if(o.has(e))return o.get(e).slice();let i=n.getStack(t,e);i=i.length?i.slice():[];const s=r.find(t=>t.name===e);if(s){const t=Number.isFinite(s.num)?s.num:0;i=i.length?[...i,t]:[t]}const c=a.find(t=>t.name===e);if(c){const t=Number.isFinite(c.num)?c.num:1;0===i.length&&(i=[0]),i[i.length-1]+=t}return o.set(e,i.slice()),i}return{get(t,e){const n=s(e);return n.length?n[n.length-1]:0},getStack:(t,e)=>s(e),__incs:a}}function Re(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}const i=o?.content;if(!i||"none"===i||"normal"===i)return{text:"",incs:[]};const r=Ie(t,o,Le(t,n));let a=/\bcounter\s*\(|\bcounters\s*\(/.test(i||"")?function(t,e,n){if(!t||"none"===t)return t;try{const o=/\b(counter|counters)\s*\(([^)]+)\)/g;return(t.replace(o,(t,o,i)=>{const r=String(i).split(",").map(t=>t.trim());if("counter"===o){const t=r[0]?.replace(/^["']|["']$/g,""),o=(r[1]||"decimal").toLowerCase();return Ee(n.get(e,t),o)}{const t=r[0]?.replace(/^["']|["']$/g,""),o=r[1]?.replace(/^["']|["']$/g,"")??"",i=(r[2]||"decimal").toLowerCase(),a=n.getStack(e,t);return a.length?a.map(t=>Ee(t,i)).join(o):""}})||"").replace(/"([^"]*)"/g,"$1")}catch{return"- "}}(i,t,r):i;const s=function(t){if(!t)return"";const e=[],n=/"([^"]*)"/g;let o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):(t||"").replace(/"([^"]*)"/g,"$1")}(a);return{text:s,incs:r.__incs||[]}}async function Pe(t,e,n,o){if(!(t instanceof Element&&e instanceof Element))return;if(!ke)try{ke=Me(t.ownerDocument||document)}catch{}for(const i of["::before","::after","::first-letter"])try{const r=Wt(t,i);if(!r||"function"!=typeof r[Symbol.iterator])continue;if(!("none"!==r.content||"none"!==r.backgroundImage||"transparent"!==r.backgroundColor||"none"!==r.borderStyle&&0!==parseFloat(r.borderWidth)||r.transform&&"none"!==r.transform||"inline"!==r.display))continue;if("::first-letter"===i){const o=getComputedStyle(t);if(!(r.color!==o.color||r.fontSize!==o.fontSize||r.fontWeight!==o.fontWeight))continue;const i=Array.from(e.childNodes).find(t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim().length>0);if(!i)continue;const a=i.textContent,s=a.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),c=s?.[0],l=a.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;const u=document.createElement("span");u.textContent=c,u.dataset.snapdomPseudo="::first-letter";const d=Dt(Ht(r),"span");n.styleMap.set(u,d);const h=document.createTextNode(l);e.replaceChild(h,i),e.insertBefore(u,h);continue}const a=r.content,{text:s,incs:c}=Re(t,i,ke),l=r.backgroundImage,u=r.backgroundColor,d=r.fontFamily,h=parseInt(r.fontSize)||32,m=parseInt(r.fontWeight)||!1,f=r.color||"#000",p=r.borderStyle,g=parseFloat(r.borderWidth),y=r.transform,w=ne(d),b="none"!==a&&""!==s,v=l&&"none"!==l,x=u&&"transparent"!==u&&"rgba(0, 0, 0, 0)"!==u,S=p&&"none"!==p&&g>0,C=y&&"none"!==y;if(!(b||v||x||S||C)){if(c&&c.length&&t.parentElement){const e=Ae.get(t.parentElement)||new Map;for(const{name:n}of c){if(!n)continue;const o=Le(t,ke),r=Ie(t,getComputedStyle(t,i),o).get(t,n);e.set(n,r)}Ae.set(t.parentElement,e)}continue}const E=document.createElement("span");E.dataset.snapdomPseudo=i,E.style.verticalAlign="middle",E.style.pointerEvents="none";const M=Dt(Ht(r),"span");if(n.styleMap.set(E,M),w&&s&&1===s.length){const{dataUrl:t,width:n,height:o}=await oe(s,d,m,h,f),i=document.createElement("img");i.src=t,i.style=`height:${h}px;width:${n/o*h}px;object-fit:contain;`,E.appendChild(i),e.dataset.snapdomHasIcon="true"}else if(s&&s.startsWith("url(")){const t=bt(s);if(t?.trim())try{const e=document.createElement("img"),n=await kt(vt(t),{as:"dataURL",useProxy:o.useProxy});e.src=n.data,e.style=`width:${h}px;height:auto;object-fit:contain;`,E.appendChild(e)}catch(t){}}else!w&&b&&(E.textContent=s);if(E.style.background="none","mask"in E.style&&(E.style.mask="none"),v)try{const t=$t(l),e=await Promise.all(t.map(Lt));E.style.backgroundImage=e.join(", ")}catch(t){}x&&(E.style.backgroundColor=u);const k=E.childNodes.length>0||""!==E.textContent?.trim()||v||x||S||C;if(c&&c.length&&t.parentElement){const e=Ae.get(t.parentElement)||new Map,n=Le(t,ke),o=Ie(t,getComputedStyle(t,i),n);for(const{name:n}of c){if(!n)continue;const i=o.get(t,n);e.set(n,i)}Ae.set(t.parentElement,e)}if(!k)continue;"::before"===i?e.insertBefore(E,e.firstChild):e.appendChild(E)}catch(t){}const i=Array.from(t.children),r=Array.from(e.children).filter(t=>!t.dataset.snapdomPseudo);for(let t=0;t<Math.min(i.length,r.length);t++)await Pe(i[t],r[t],n,o)}function Te(t){if(!t||"auto"===t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Ne(t,e){const n=[];for(let o=t;o&&o!==e;){const t=o.parentElement;if(!t)break;n.push(Array.prototype.indexOf.call(t.children,o)),o=t}return n.reverse()}function Fe(t,e,n){let o=t;for(let t=0;t<e.length;t++){if(o=De(o,n)[e[t]],!o)return null}return o instanceof HTMLElement?o:null}function De(t,e){const n=[],o=t.children;for(let t=0;t<o.length;t++){const i=o[t];i.hasAttribute(e)||n.push(i)}return n}async function We(t,e={}){const n={styleMap:wt.session.styleMap,styleCache:wt.session.styleCache,nodeMap:wt.session.nodeMap};let o,i="",r="";!function(t){const e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,i=e.borderStyle,r=e.borderWidth,a="none"!==n&&parseFloat(o)>0,s="none"===i||0===parseFloat(r);a&&s&&(t.style.border=`${o} solid transparent`)}(t);try{!function(t){if(!t)return;const e=new Set;if(t.querySelectorAll("use").forEach(t=>{const n=t.getAttribute("xlink:href")||t.getAttribute("href");n&&n.startsWith("#")&&e.add(n.slice(1))}),!e.size)return;const n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(t=>"symbol"===t.tagName.toLowerCase()),i=n.filter(t=>"defs"===t.tagName.toLowerCase());let r=t.querySelector("svg.inline-defs-container");r||(r=document.createElementNS("http://www.w3.org/2000/svg","svg"),r.setAttribute("aria-hidden","true"),r.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),r.classList.add("inline-defs-container"),t.insertBefore(r,t.firstChild));const a=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(t=>{a.add(t.id)}),e.forEach(t=>{if(a.has(t))return;const e=o.find(e=>e.id===t);if(e)return r.appendChild(e.cloneNode(!0)),void a.add(t);for(const e of i){const n=e.querySelector(`#${CSS.escape(t)}`);if(n){let e=r.querySelector("defs");e||(e=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.appendChild(e)),e.appendChild(n.cloneNode(!0)),a.add(t);break}}})}(t)}catch(t){}try{o=await Kt(t,n,e)}catch(t){throw t}try{await Pe(t,o,n,e)}catch(t){}await async function(t){if(!t)return;const e=t.querySelectorAll?t.querySelectorAll("img"):[];for(const t of e)try{const e=t.getAttribute("src")||t.currentSrc||"";if(Ve(e)){const n=await $e(e);t.setAttribute("src",n)}const n=t.getAttribute("srcset");if(n&&n.includes("blob:")){const e=Oe(n);let o=!1;for(const t of e)if(Ve(t.url))try{t.url=await $e(t.url),o=!0}catch{}o&&t.setAttribute("srcset",je(e))}}catch{}const n=t.querySelectorAll?t.querySelectorAll("image"):[];for(const t of n)try{const e="http://www.w3.org/1999/xlink",n=t.getAttribute("href")||t.getAttributeNS?.(e,"href");if(Ve(n)){const o=await $e(n);t.setAttribute("href",o),t.removeAttributeNS?.(e,"href")}}catch{}const o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(const t of o)try{const e=t.getAttribute("style");if(e&&e.includes("blob:")){const n=await Be(e);t.setAttribute("style",n)}}catch{}const i=t.querySelectorAll?t.querySelectorAll("style"):[];for(const t of i)try{const e=t.textContent||"";e.includes("blob:")&&(t.textContent=await Be(e))}catch{}const r=["poster"];for(const e of r){const n=t.querySelectorAll?t.querySelectorAll(`[${e}^='blob:']`):[];for(const t of n)try{const n=t.getAttribute(e);Ve(n)&&t.setAttribute(e,await $e(n))}catch{}}}(o);try{const t=o.querySelectorAll("style[data-sd]");for(const e of t)r+=e.textContent||"",e.remove()}catch{}const a=function(t){const e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map;let o=1;for(const t of e)n.set(t,"c"+o++);return n}(n.styleMap);i=Array.from(a.entries()).map(([t,e])=>`.${e}{${t}}`).join(""),i=r+i;for(const[t,e]of n.styleMap.entries()){if("STYLE"===t.tagName)continue;if(t.getRootNode&&t.getRootNode()instanceof ShadowRoot){t.setAttribute("style",e.replace(/;/g,"; "));continue}const n=a.get(e);n&&t.classList.add(n);const o=t.style?.backgroundImage,i=t.dataset?.snapdomHasIcon;o&&"none"!==o&&(t.style.backgroundImage=o),i&&(t.style.verticalAlign="middle",t.style.display="inline")}for(const[t,e]of n.nodeMap.entries()){const n=e.scrollLeft,o=e.scrollTop;if((n||o)&&t instanceof HTMLElement){t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";const e=document.createElement("div");for(e.style.transform=`translate(${-n}px, ${-o}px)`,e.style.willChange="transform",e.style.display="inline-block",e.style.width="100%";t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}}if(function(t,e){if(!t||!e)return;const n=t.scrollTop||0;if(!n)return;"static"===getComputedStyle(e).position&&(e.style.position="relative");const o=t.getBoundingClientRect(),i=t.clientHeight,r="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){const s=a.currentNode,c=getComputedStyle(s),l=c.position;if("sticky"!==l&&"-webkit-sticky"!==l)continue;const u=Te(c.top),d=Te(c.bottom);if(null==u&&null==d)continue;const h=Fe(e,Ne(s,t),r);if(!h)continue;const m=s.getBoundingClientRect(),f=m.width,p=m.height,g=m.left-o.left;if(!(f>0&&p>0))continue;if(!Number.isFinite(g))continue;const y=null!=u?u+n:n+(i-p-d);if(!Number.isFinite(y))continue;const w=Number.parseInt(c.zIndex,10),b=Number.isFinite(w),v=b?Math.max(w,1)+1:2,x=b?w-1:0,S=h.cloneNode(!1);S.setAttribute(r,"1"),S.style.position="sticky",S.style.left=`${g}px`,S.style.top=`${y}px`,S.style.width=`${f}px`,S.style.height=`${p}px`,S.style.visibility="hidden",S.style.zIndex=String(x),S.style.overflow="hidden",S.style.background="transparent",S.style.boxShadow="none",S.style.filter="none",h.parentElement?.insertBefore(S,h),h.style.position="absolute",h.style.left=`${g}px`,h.style.top=`${y}px`,h.style.bottom="auto",h.style.zIndex=String(v),h.style.pointerEvents="none"}}(t,o instanceof HTMLElement&&o.firstElementChild instanceof HTMLElement?o.firstElementChild:o),t===n.nodeMap.get(o)){const e=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,e);const i=function(t){if(!t||"none"===t)return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(t,e)=>{const n=e.split(",").map(t=>t.trim());return 6!==n.length?`matrix(${e})`:(n[4]="0",n[5]="0",`matrix(${n.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(t,e)=>{const n=e.split(",").map(t=>t.trim());return 16!==n.length?`matrix3d(${e})`:(n[12]="0",n[13]="0",`matrix3d(${n.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}(e.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=i||""}for(const[t,e]of n.nodeMap.entries())"PRE"===e.tagName&&(t.style.marginTop="0",t.style.marginBlockStart="0");return{clone:o,classCSS:i,styleCache:n.styleCache}}var He=new Map;async function $e(t){if(wt.resource?.has(t))return wt.resource.get(t);if(He.has(t))return He.get(t);const e=(async()=>{const e=await kt(t,{as:"dataURL",silent:!0});if(!e.ok||"string"!=typeof e.data)throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return wt.resource?.set(t,e.data),e.data})();He.set(t,e);try{const n=await e;return He.set(t,n),n}catch(e){throw He.delete(t),e}}var Ue=/\bblob:[^)"'\s]+/g;async function Be(t){if(!t||-1===t.indexOf("blob:"))return t;const e=Array.from(new Set(t.match(Ue)||[]));if(0===e.length)return t;let n=t;for(const t of e)try{const e=await $e(t);n=n.split(t).join(e)}catch{}return n}function Ve(t){return"string"==typeof t&&t.startsWith("blob:")}function Oe(t){return(t||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{const e=t.match(/^(\S+)(\s+.+)?$/);return e?{url:e[1],desc:e[2]||""}:null}).filter(Boolean)}function je(t){return t.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function ze(t){if(!t)return()=>{};const e=function(t){const e=getComputedStyle(t);let n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();const o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}(t);if(e<=0)return()=>{};if(!function(t){return!(t.childElementCount>0)&&Array.from(t.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}(t))return()=>{};const n=getComputedStyle(t),o=Math.round(function(t){const e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return e&&"normal"!==e?e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(1.2*n):Math.round(1.2*n)}(n)*e+function(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}(n)),i=t.textContent??"",r=i;if(t.scrollHeight<=o+.5)return()=>{};let a=0,s=i.length,c=-1;for(;a<=s;){const e=a+s>>1;t.textContent=i.slice(0,e)+"…",t.scrollHeight<=o+.5?(c=e,a=e+1):s=e-1}return t.textContent=(c>=0?i.slice(0,c):"")+"…",()=>{t.textContent=r}}async function Xe(t,e){if(!t)throw new Error("Element cannot be null or undefined");!function(t="soft"){switch(t){case"auto":return wt.session.styleMap=new Map,void(wt.session.nodeMap=new Map);case"soft":default:return wt.session.styleMap=new Map,wt.session.nodeMap=new Map,void(wt.session.styleCache=new WeakMap);case"full":return;case"disabled":wt.session.styleMap=new Map,wt.session.nodeMap=new Map,wt.session.styleCache=new WeakMap,wt.computedStyle=new WeakMap,wt.baseStyle=new Map,wt.defaultStyle=new Map,wt.image=new Map,wt.background=new Map,wt.resource=new Map,wt.font=new Set}}(e.cache);const n=e.fast,o=!!e.straighten,i=!!e.noShadows;let r,a,s,c,l,u="",d="",h=null;const m=ze(t);try{({clone:r,classCSS:a,styleCache:s}=await We(t,e)),o&&r&&(h=function(t,e){if(!t||!e||!e.style)return null;const n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}const o=n.transform||"none";if("none"===o)try{const n=Ge(t);if(1===n.a&&0===n.b&&0===n.c&&1===n.d)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}const i=o.match(/^matrix\(\s*([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t.trim()));if(6===t.length&&t.every(Number.isFinite)){const[n,o,i,r]=t,a=Math.sqrt(n*n+o*o)||0;let s=0,c=0,l=0,u=0,d=0,h=0;a>0&&(s=n/a,c=o/a,l=s*i+c*r,u=i-s*l,d=r-c*l,h=Math.sqrt(u*u+d*d)||0,h>0?l/=h:l=0);const m=a,f=0,p=l*h,g=h;try{e.style.transform=`matrix(${m}, ${f}, ${p}, ${g}, 0, 0)`}catch{}return{a:m,b:f,c:p,d:g}}}try{const t=String(o).trim();return e.style.transform=t+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}(t,r)),i&&r&&function(t,e){if(!t||!e||!e.style)return;const n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}const o=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch{}}(t,r)}finally{m()}await new Promise(t=>{Ut(async()=>{await async function(t,e={}){const n=Array.from(t.querySelectorAll("img")),o=async t=>{if(!t.getAttribute("src")){const e=t.currentSrc||t.src||"";e&&t.setAttribute("src",e)}t.removeAttribute("srcset"),t.removeAttribute("sizes");const n=t.src||"";if(!n)return;const o=await kt(n,{as:"dataURL",useProxy:e.useProxy});if(o.ok&&"string"==typeof o.data&&o.data.startsWith("data:"))return t.src=o.data,t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100));const{fallbackURL:i}=e||{};if(i)try{const o=parseInt(t.dataset?.snapdomWidth||"",10)||0,r=parseInt(t.dataset?.snapdomHeight||"",10)||0,a=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,c=parseFloat(t.style?.width||"")||0,l=parseFloat(t.style?.height||"")||0,u=o||c||a||t.width||void 0,d=r||l||s||t.height||void 0,h="function"==typeof i?await i({width:u,height:d,src:n,element:t}):i;if(h){const n=await kt(h,{as:"dataURL",useProxy:e.useProxy});return t.src=n.data,!t.width&&u&&(t.width=u),!t.height&&d&&(t.height=d),t.width||(t.width=t.naturalWidth||100),void(t.height||(t.height=t.naturalHeight||100))}}catch{}const r=t.width||t.naturalWidth||100,a=t.height||t.naturalHeight||100;if(!1!==e.placeholders){const e=document.createElement("div");e.style.cssText=[`width:${r}px`,`height:${a}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${a}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),e.textContent="img",t.replaceWith(e)}else{const e=document.createElement("div");e.style.cssText=`display:inline-block;width:${r}px;height:${a}px;visibility:hidden;`,t.replaceWith(e)}};for(let t=0;t<n.length;t+=4){const e=n.slice(t,t+4).map(o);await Promise.allSettled(e)}}(r,e),t()},{fast:n})}),await new Promise(o=>{Ut(async()=>{await async function(t,e,n,o={}){const i=[[t,e]],r=["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"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){const[t,e]=i.shift(),c=n.get(t)||Wt(t);n.has(t)||n.set(t,c);const l=(()=>{const t=c.getPropertyValue("border-image"),e=c.getPropertyValue("border-image-source");return t&&"none"!==t||e&&"none"!==e})();for(const t of r){const n=c.getPropertyValue(t);if(!n||"none"===n)continue;const i=$t(n),r=await Promise.all(i.map(t=>Lt(t,o)));r.some(t=>t&&"none"!==t&&!/^url\(undefined/.test(t))&&e.style.setProperty(t,r.join(", "))}for(const t of a){const n=c.getPropertyValue(t);n&&"initial"!==n&&e.style.setProperty(t,n)}if(l)for(const t of s){const n=c.getPropertyValue(t);n&&"initial"!==n&&e.style.setProperty(t,n)}const u=Array.from(t.children),d=Array.from(e.children);for(let t=0;t<Math.min(u.length,d.length);t++)i.push([u[t],d[t]])}}(t,r,s,e),o()},{fast:n})}),e.embedFonts&&await new Promise(o=>{Ut(async()=>{const n=xe(t),i=function(t){const e=new Set,n=t=>{if(t)for(const n of t)e.add(n.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){const t=o.currentNode;if(t.nodeType===Node.TEXT_NODE)n(t.nodeValue||"");else if(t.nodeType===Node.ELEMENT_NODE){const o=t;for(const t of["::before","::after"]){const i=getComputedStyle(o,t),r=i?.getPropertyValue("content");if(r&&"none"!==r)if(/^"/.test(r)||/^'/.test(r))n(r.slice(1,-1));else{const t=r.match(/\\[0-9A-Fa-f]{1,6}/g);if(t)for(const n of t)try{e.add(parseInt(n.slice(1),16))}catch{}}}}}return e}(t);if(Bt()){const t=new Set(Array.from(n).map(t=>String(t).split("__")[0]).filter(Boolean));await async function(t,e=2){try{await document.fonts.ready}catch{}const n=Array.from(t||[]).filter(Boolean);if(0===n.length)return;const o=()=>{const t=document.createElement("div");t.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(const e of n){const n=document.createElement("span");n.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",n.style.fontFamily=`"${e}"`,n.style.fontWeight="700",n.style.fontStyle="italic",n.style.fontSize="32px",n.style.lineHeight="1",n.style.whiteSpace="nowrap",n.style.margin="0",n.style.padding="0",t.appendChild(n)}document.body.appendChild(t),t.offsetWidth,document.body.removeChild(t)};for(let t=0;t<Math.max(1,e);t++)o(),await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t)))}(t,1)}u=await ve({required:n,usedCodepoints:i,exclude:e.excludeFonts,useProxy:e.useProxy}),o()},{fast:n})});const f=function(t){const e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),"function"==typeof t.querySelectorAll&&t.querySelectorAll("*").forEach(t=>e.add(t.tagName.toLowerCase())),Array.from(e))}(r).sort(),p=f.join(",");wt.baseStyle.has(p)?d=wt.baseStyle.get(p):await new Promise(t=>{Ut(()=>{d=function(t){const e=new Map;for(let n of t){const t=wt.defaultStyle.get(n);if(!t)continue;const o=Object.entries(t).map(([t,e])=>`${t}:${e};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(n))}let n="";for(let[t,o]of e.entries())n+=`${o.join(",")} { ${t} }\n`;return n}(f),wt.baseStyle.set(p,d),t()},{fast:n})}),await new Promise(s=>{Ut(()=>{const n=getComputedStyle(t);const m=t.getBoundingClientRect(),f=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(n.width)||m.width||1)),p=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(n.height)||m.height||1)),g=(t,e=NaN)=>{const n="string"==typeof t?parseFloat(t):t;return Number.isFinite(n)?n:e},y=g(e.width),w=g(e.height);let b=f,v=p;const x=Number.isFinite(y),S=Number.isFinite(w),C=p>0?f/p:1;x&&S?(b=Math.max(1,Math.ceil(y)),v=Math.max(1,Math.ceil(w))):x?(b=Math.max(1,Math.ceil(y)),v=Math.max(1,Math.ceil(b/(C||1)))):S?(v=Math.max(1,Math.ceil(w)),b=Math.max(1,Math.ceil(v*(C||1)))):(b=f,v=p);let E=0,M=0,k=f,A=p;if(o&&h&&Number.isFinite(h.a)){const t=Ze(f,p,{a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},0,0);E=t.minX,M=t.minY,k=t.maxX,A=t.maxY}else{if(!o&&function(t){const e=getComputedStyle(t),n=e.transform||"none";if("none"!==n&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;const o=e.rotate&&"none"!==e.rotate&&"0deg"!==e.rotate,i=e.scale&&"none"!==e.scale&&"1"!==e.scale,r=e.translate&&"none"!==e.translate&&"0px 0px"!==e.translate;return Boolean(o||i||r)}(t)){const e=n.transform&&"none"!==n.transform?n.transform:"",o=function(t){const e={rotate:"0deg",scale:null,translate:null},n="function"==typeof t.computedStyleMap?t.computedStyleMap():null;if(n){const o=t=>{try{return"function"!=typeof n.has||n.has(t)?"function"!=typeof n.get?null:n.get(t):null}catch{return null}},i=o("rotate");if(i)if(i.angle){const t=i.angle;e.rotate="rad"===t.unit?180*t.value/Math.PI+"deg":t.value+t.unit}else i.unit?e.rotate="rad"===i.unit?180*i.value/Math.PI+"deg":i.value+i.unit:e.rotate=String(i);else{const n=getComputedStyle(t);e.rotate=n.rotate&&"none"!==n.rotate?n.rotate:"0deg"}const r=o("scale");if(r){const t="x"in r&&null!=r.x?.value?r.x.value:Array.isArray(r)?r[0]?.value:Number(r)||1,n="y"in r&&null!=r.y?.value?r.y.value:Array.isArray(r)?r[1]?.value:t;e.scale=`${t} ${n}`}else{const n=getComputedStyle(t);e.scale=n.scale&&"none"!==n.scale?n.scale:null}const a=o("translate");if(a){const t="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,n="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,o="x"in a&&a.x?.unit?a.x.unit:"px",i="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${t}${o} ${n}${i}`}else{const n=getComputedStyle(t);e.translate=n.translate&&"none"!==n.translate?n.translate:null}return e}const o=getComputedStyle(t);return e.rotate=o.rotate&&"none"!==o.rotate?o.rotate:"0deg",e.scale=o.scale&&"none"!==o.scale?o.scale:null,e.translate=o.translate&&"none"!==o.translate?o.translate:null,e}(t),i=function(t){const e=function(){if(Ye)return Ye;const t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),Ye=t,t}(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform);t.rotate&&(n.style.rotate=t.rotate);t.scale&&(n.style.scale=t.scale);t.translate&&(n.style.translate=t.translate);e.appendChild(n);const o=Ge(n);return e.removeChild(n),o}({baseTransform:e,rotate:o.rotate||"0deg",scale:o.scale,translate:o.translate}),{ox:r,oy:a}=function(t,e,n){const o=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,r]=[o[0]||"0",o[1]||"0"],a=(t,e)=>{const n=t.toLowerCase();return"left"===n||"top"===n?0:"center"===n?e/2:"right"===n||"bottom"===n?e:n.endsWith("px")?parseFloat(n)||0:n.endsWith("%")?(parseFloat(n)||0)*e/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:a(i,e),oy:a(r,n)}}(n,f,p),s=Ze(f,p,i.is2D?i:new DOMMatrix(i.toString()),r,a);E=s.minX,M=s.minY,k=s.maxX,A=s.maxY}}const L=function(t){const e=t.boxShadow||"";if(!e||"none"===e)return{top:0,right:0,bottom:0,left:0};const n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(t=>t.trim());let o=0,i=0,r=0,a=0;for(const t of n){const e=t.match(/-?\d+(\.\d+)?px/g)?.map(t=>parseFloat(t))||[];if(e.length<2)continue;const[n,s,c=0,l=0]=e,u=Math.abs(n)+c+l,d=Math.abs(s)+c+l;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),r=Math.max(r,d+Math.max(s,0)),o=Math.max(o,d+Math.max(-s,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(r),left:Math.ceil(a)}}(n),I=function(t){const e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}(n),R=function(t){if("none"===(t.outlineStyle||"none"))return{top:0,right:0,bottom:0,left:0};const e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}(n),P=function(t){const e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||"none"===e)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};const n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[];let o=0,i=0,r=0,a=0,s=!1;for(const t of n){s=!0;const e=t.match(/-?\d+(?:\.\d+)?px/gi)?.map(t=>parseFloat(t))||[],[n=0,c=0,l=0]=e,u=Math.abs(n)+l,d=Math.abs(c)+l;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),r=Math.max(r,d+Math.max(c,0)),o=Math.max(o,d+Math.max(-c,0))}return{bleed:{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(r),left:Math.ceil(a)},has:s}}(n),T=i?{top:0,right:0,bottom:0,left:0}:{top:L.top+I.top+R.top+P.bleed.top,right:L.right+I.right+R.right+P.bleed.right,bottom:L.bottom+I.bottom+R.bottom+P.bleed.bottom,left:L.left+I.left+R.left+P.bleed.left};E-=T.left,M-=T.top,k+=T.right,A+=T.bottom;const N=Math.max(1,Math.ceil(k-E)),F=Math.max(1,Math.ceil(A-M)),D=Math.max(1,Math.round(N*(x||S?b/f:1))),W=Math.max(1,Math.round(F*(S||x?v/p:1))),H="http://www.w3.org/2000/svg",$=(Bt()?1:0)+(o?1:0),U=document.createElementNS(H,"foreignObject"),B=Math.floor(E),V=Math.floor(M);U.setAttribute("x",String(-(B-$))),U.setAttribute("y",String(-(V-$))),U.setAttribute("width",String(Math.ceil(f+2*$))),U.setAttribute("height",String(Math.ceil(p+2*$))),U.style.overflow="visible";const O=document.createElement("style");O.textContent=d+u+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a,U.appendChild(O);const j=document.createElement("div");j.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),j.style.width=`${f}px`,j.style.height=`${p}px`,j.style.overflow="visible",r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),j.appendChild(r),U.appendChild(j);const z=(new XMLSerializer).serializeToString(U),X=N+2*$,Z=F+2*$,G=x||S;e.meta={w0:f,h0:p,vbW:X,vbH:Z,targetW:b,targetH:v};const Y=Bt()&&G?X:D+2*$,q=Bt()&&G?Z:W+2*$;l=`<svg xmlns="${H}" width="${Y}" height="${q}" viewBox="0 0 ${X} ${Z}">`+z+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,s()},{fast:n})});const g=document.getElementById("snapdom-sandbox");return g&&"absolute"===g.style.position&&g.remove(),c}function Ze(t,e,n,o,i){const r=n.a,a=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(t,e){let n=t-o,d=e-i,h=r*n+s*d,m=a*n+c*d;return h+=o+l,m+=i+u,[h,m]}const h=[d(0,0),d(t,0),d(0,e),d(t,e)];let m=1/0,f=1/0,p=-1/0,g=-1/0;for(const[t,e]of h)t<m&&(m=t),e<f&&(f=e),t>p&&(p=t),e>g&&(g=e);return{minX:m,minY:f,maxX:p,maxY:g,width:p-m,height:g-f}}function Ge(t){const e=getComputedStyle(t).transform;if(!e||"none"===e)return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Ye=null;function qe(t){const e=function(t){let e=[],n="",o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&o++,")"===r&&(o=Math.max(0,o-1)),";"===r&&0===o?(e.push(n),n=""):n+=r}return n.trim()&&e.push(n),e.map(t=>t.trim()).filter(Boolean)}(t);let n=null,o=null,i=null;const r=[];for(const t of e){const e=t.indexOf(":");if(e<0)continue;const a=t.slice(0,e).trim().toLowerCase(),s=t.slice(e+1).trim();"box-shadow"===a?i=s:"filter"===a?n=s:"-webkit-filter"===a?o=s:r.push([a,s])}if(i){const t=function(t){const e=[];let n="",o=0;for(let i=0;i<t.length;i++){const r=t[i];"("===r&&o++,")"===r&&(o=Math.max(0,o-1)),","===r&&0===o?(e.push(n.trim()),n=""):n+=r}n.trim()&&e.push(n.trim());const i=[];for(const t of e){if(/\binset\b/i.test(t))continue;const e=t.match(/-?\d+(?:\.\d+)?px/gi)||[],[n="0px",o="0px",r="0px"]=e;let a=t.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," ");const s=!!a&&","!==a;i.push(`drop-shadow(${n} ${o} ${r}${s?` ${a}`:""})`)}return i.join(" ")}(i);t&&(n=n?`${n} ${t}`:t,o=o?`${o} ${t}`:t)}const a=[...r];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([t,e])=>`${t}:${e}`).join(";")}function _e(t){return t=(t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,e)=>t.replace(e,function(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(t,e,n)=>`${e}{${qe(n)}}`)}(e)))).replace(/style=(['"])([\s\S]*?)\1/gi,(t,e,n)=>`style=${e}${qe(n)}${e}`)}function Je(t){if(!Bt()||("string"!=typeof(e=t)||!/^data:image\/svg\+xml/i.test(e)))return t;var e;try{const e=function(t){const e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}(t),n=_e(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}catch{return t}}async function Qe(t,e){let{width:n,height:o,scale:i=1,dpr:r=1,meta:a={}}=e;t=Je(t);const s=new Image;s.loading="eager",s.decoding="sync",s.crossOrigin="anonymous",s.src=t,await s.decode();const c=s.naturalWidth,l=s.naturalHeight,u=Number.isFinite(a.w0)?a.w0:c,d=Number.isFinite(a.h0)?a.h0:l;let h,m;const f=Number.isFinite(n),p=Number.isFinite(o);if(f&&p)h=Math.max(1,n),m=Math.max(1,o);else if(f){const t=n/Math.max(1,u);h=n,m=Math.round(d*t)}else if(p){const t=o/Math.max(1,d);m=o,h=Math.round(u*t)}else h=c,m=l;h=Math.round(h*i),m=Math.round(m*i);const g=document.createElement("canvas");g.width=Math.ceil(h*r),g.height=Math.ceil(m*r),g.style.width=`${h}px`,g.style.height=`${m}px`;const y=g.getContext("2d");return 1!==r&&y.scale(r,r),y.drawImage(s,0,0,h,m),g}async function Ke(t,e){const n=await Qe(t,e),o=e.backgroundColor?At(n,e.backgroundColor):n,i=new Image;return i.src=o.toDataURL(`image/${e.format}`,e.quality),await i.decode(),i.style.width=o.width/e.dpr+"px",i.style.height=o.height/e.dpr+"px",i}async function tn(t,e){const{scale:n=1,width:o,height:i,meta:r={}}=e,a=Number.isFinite(o),s=Number.isFinite(i),c=Number.isFinite(n)&&1!==n||a||s;if(Bt()&&c){return await Ke(t,{...e,format:"png",quality:1,meta:r})}const l=new Image;if(l.decoding="sync",l.loading="eager",l.src=t,await l.decode(),a&&s)l.style.width=`${o}px`,l.style.height=`${i}px`;else if(a){const t=Number.isFinite(r.w0)?r.w0:l.naturalWidth,e=Number.isFinite(r.h0)?r.h0:l.naturalHeight,n=o/Math.max(1,t);l.style.width=`${o}px`,l.style.height=`${Math.round(e*n)}px`}else if(s){const t=Number.isFinite(r.w0)?r.w0:l.naturalWidth,e=Number.isFinite(r.h0)?r.h0:l.naturalHeight,n=i/Math.max(1,e);l.style.height=`${i}px`,l.style.width=`${Math.round(t*n)}px`}else{const e=Math.round(l.naturalWidth*n),o=Math.round(l.naturalHeight*n);if(l.style.width=`${e}px`,l.style.height=`${o}px`,"string"==typeof t&&t.startsWith("data:image/svg+xml"))try{const n=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${e}"`).replace(/height="[^"]*"/,`height="${o}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,l.src=t}catch{}}return l}async function en(t,e){const n=e.type;if("svg"===n){const e=decodeURIComponent(t.split(",")[1]);return new Blob([e],{type:"image/svg+xml"})}const o=await Qe(t,e),i=e.backgroundColor?At(o,e.backgroundColor):o;return new Promise(t=>i.toBlob(e=>t(e),`image/${n}`,e.quality))}var nn=Symbol("snapdom.internal"),on=!1;async function rn(t,e){if(!t)throw new Error("Element cannot be null or undefined");const n=function(t={}){const e=t.format??"png",n=function(t){if("string"==typeof t){const e=t.toLowerCase().trim();if("disabled"===e||"full"===e||"auto"===e||"soft"===e)return e}return"soft"}(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:!1!==t.placeholders,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:"string"==typeof t.useProxy?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpg","jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",straighten:t.straighten??!1,noShadows:t.noShadows??!1}}(e);if(Bt()&&(!0===n.embedFonts||function(t){const e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){const t=e.currentNode,n=getComputedStyle(t),o=n.backgroundImage&&"none"!==n.backgroundImage,i=n.maskImage&&"none"!==n.maskImage||n.webkitMaskImage&&"none"!==n.webkitMaskImage;if(o||i)return!0}return!1}(t)))for(let n=0;n<3;n++)try{await an(t,e),on=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&function(t){const e=Array.isArray(t)?t:[t];for(const t of e)t instanceof RegExp?ee.push(t):"string"==typeof t&&ee.push(new RegExp(t,"i"))}(n.iconFonts),n.snap||(n.snap={toPng:(t,e)=>rn.toPng(t,e),toSvg:(t,e)=>rn.toSvg(t,e)}),rn.capture(t,n,nn)}async function an(t,e){if(on)return;const n={...e,fast:!0,embedFonts:!0,scale:.2};let o;try{o=await Xe(t,n)}catch{return}await new Promise(t=>{const e=new Image;e.decoding="sync",e.loading="eager",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.width="10px",e.style.height="10px",e.style.opacity="0.01",e.style.transform="translateZ(10px)",e.style.willChange="transform,opacity;",e.src=o;document.body.appendChild(e),(async()=>{await new Promise(t=>setTimeout(t,100)),e&&e.parentNode&&e.parentNode.removeChild(e),on=!0,t()})()})}rn.capture=async(t,e,n)=>{if(n!==nn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");const o=await Xe(t,e),i=t=>({...e,...t||{}}),r=t=>e=>{const n=i({...e||{},format:t}),r="jpeg"===t||"jpg"===t,a=null==n.backgroundColor||"transparent"===n.backgroundColor;return r&&a&&(n.backgroundColor="#ffffff"),Ke(o,n)};return{url:o,toRaw:()=>o,toImg:t=>tn(o,i(t)),toSvg:t=>tn(o,i(t)),toCanvas:t=>Qe(o,i(t)),toBlob:t=>en(o,i(t)),toPng:r("png"),toJpg:r("jpeg"),toWebp:r("webp"),download:t=>async function(t,e){if(e.dpr=1,"svg"===e.format){const n=await en(t,{...e,type:"svg"}),o=URL.createObjectURL(n),i=document.createElement("a");return i.href=o,i.download=e.filename,i.click(),void URL.revokeObjectURL(o)}const n=await Qe(t,e),o=e.backgroundColor?At(n,e.backgroundColor):n,i=document.createElement("a");i.href=o.toDataURL(`image/${e.format}`,e.quality),i.download=e.filename,i.click()}(o,i(t))}},rn.toRaw=(t,e)=>rn(t,e).then(t=>t.toRaw()),rn.toImg=(t,e)=>rn(t,e).then(t=>t.toImg()),rn.toSvg=(t,e)=>rn(t,e).then(t=>t.toSvg()),rn.toCanvas=(t,e)=>rn(t,e).then(t=>t.toCanvas()),rn.toBlob=(t,e)=>rn(t,e).then(t=>t.toBlob()),rn.toPng=(t,e)=>rn(t,{...e,format:"png"}).then(t=>t.toPng()),rn.toJpg=(t,e)=>rn(t,{...e,format:"jpeg"}).then(t=>t.toJpg()),rn.toWebp=(t,e)=>rn(t,{...e,format:"webp"}).then(t=>t.toWebp()),rn.download=(t,e)=>rn(t,e).then(t=>t.download());class sn{constructor(t,e={}){this.targetElement=null,this.isRunning=!1,this.screenshotCount=0,this.screenshotHistory=[],this.lastScreenshotTime=0,this.error=null,this.isEnabled=!1,this.isUploading=!1,this.uploadError=null,this.uploadProgress={success:0,failed:0},this.currentUploadConfig=null,this.worker=null,this.screenshotTimer=null,this.screenshotContext=null,this.messageHandler=null,this.dynamicInterval=null,this.expirationTimer=null,this.imageProxyCache=new Map,this.indexedDBCache=null,this.indexedDBReady=!1,this.intersectionObserver=null,this.visibleElementsCache=new Set,this.preconnected=!1,this.imageDownloadQueue=new Map,this.activeDownloads=new Set,this.maxConcurrentImageDownloads=5,this.globalErrorHandler=null,this.globalRejectionHandler=null,this.targetElement=t,this.options={interval:e.interval??5e3,quality:e.quality??.3,scale:e.scale??1,maxHistory:e.maxHistory??10,compress:e.compress??!1,maxWidth:e.maxWidth??1600,maxHeight:e.maxHeight??900,outputFormat:e.outputFormat??"webp",enableCORS:e.enableCORS??!0,proxyUrl:e.proxyUrl??"",useProxy:e.useProxy??!0,engine:e.engine??"modern-screenshot",corsMode:e.corsMode??"canvas-proxy",silentMode:e.silentMode??!1,maxRetries:e.maxRetries??2,preloadImages:e.preloadImages??!1,maxConcurrentDownloads:e.maxConcurrentDownloads??10,onlyVisibleImages:e.onlyVisibleImages??!0,imageCacheTTL:e.imageCacheTTL??6e5,useIndexedDB:e.useIndexedDB??!0,usePreconnect:e.usePreconnect??!0,imageLoadTimeout:e.imageLoadTimeout??5e3,useIntersectionObserver:e.useIntersectionObserver??!0,fetchPriority:e.fetchPriority??"high",maxCacheSize:e.maxCacheSize??50,maxCacheAge:e.maxCacheAge??864e5,maxImageSize:e.maxImageSize??5,skipLargeImages:e.skipLargeImages??!0},this.setupMessageListener(),this.setupVisibilityChangeListener(),this.startCacheCleanup(),this.options.usePreconnect&&this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()&&this.preconnectProxy(),this.options.useIntersectionObserver&&this.options.onlyVisibleImages&&this.initIntersectionObserver(),this.options.useIndexedDB&&this.initIndexedDB().catch(()=>{this.options.silentMode})}setTargetElement(t){if(this.targetElement!==t&&this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}this.targetElement=t}setupMessageListener(){this.messageHandler||(this.messageHandler=t=>{this.handleIframeMessage(t)},window.addEventListener("message",this.messageHandler))}setupVisibilityChangeListener(){document.addEventListener("visibilitychange",()=>{document.hidden,this.options.silentMode})}handleIframeMessage(t){try{if(!t.data||"checkScreenshot"!==t.data.type)return;this.options.silentMode;const e=this.parseUploadConfig(t.data.data);if(!e)return void(this.uploadError="解析上传配置失败");this.currentUploadConfig=e;const n=Date.now();if(!(e.ttl>0&&e.ttl>n))return this.options.silentMode||e.ttl,this.stopScreenshot(),this.isEnabled=!1,this.currentUploadConfig=null,void(this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null));{this.isEnabled||(this.options.silentMode,this.isEnabled=!0),this.dynamicInterval=e.duration||this.options.interval;const t=e.ttl-n;if(!this.options.silentMode){Math.ceil(t/6e4)}this.takeScreenshotAndUpload(e),this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null),this.expirationTimer=setTimeout(()=>{this.options.silentMode,this.stopScreenshot(),this.isEnabled=!1,this.currentUploadConfig=null,this.expirationTimer=null},t)}}catch(t){this.uploadError=t instanceof Error?t.message:String(t)}}async takeScreenshotAndUpload(t){this.isRunning&&(this.options.silentMode,this.stopScreenshot()),this.startScreenshot(this.dynamicInterval||t.duration||this.options.interval);try{if(await this.takeScreenshot()){await new Promise(t=>setTimeout(t,100));const e=this.getLatestScreenshot();e?(this.isUploading=!0,this.uploadError=null,this.uploadScreenshot(e,t).then(t=>{t&&this.options.silentMode}).catch(t=>{this.uploadError=t instanceof Error?t.message:String(t)}).finally(()=>{this.isUploading=!1})):this.options.silentMode}}catch(t){this.uploadError=t instanceof Error?t.message:String(t)}}parseUploadConfig(t){try{const e="string"==typeof t?t:JSON.stringify(t),n=JSON.parse(e);return n.uploadUrl&&n.contentType?(("number"!=typeof n.duration||n.duration<=0)&&(n.duration=this.options.interval),"number"!=typeof n.ttl&&("number"==typeof n.expirationMinutes&&n.expirationMinutes>0?n.ttl=Date.now()+60*n.expirationMinutes*1e3:n.ttl=0),n):null}catch(t){return null}}startScreenshot(t){if(!this.isEnabled)return;const e=t||this.dynamicInterval||this.options.interval;this.isRunning&&(this.options.silentMode,this.stopScreenshot()),this.options.silentMode,this.isRunning=!0,!this.worker&&this.options.compress&&(this.worker=this.createWorker()),this.screenshotTimer=setInterval(async()=>{if(this.isRunning&&this.isEnabled&&!document.hidden&&(await this.takeScreenshot(),this.currentUploadConfig)){const t=this.getLatestScreenshot();t&&!this.isUploading&&this.uploadScreenshot(t,this.currentUploadConfig).catch(t=>{})}},e)}stopScreenshot(){this.isRunning&&(this.options.silentMode,this.isRunning=!1,this.screenshotTimer&&(clearInterval(this.screenshotTimer),this.screenshotTimer=null))}async captureOnce(t=!1){return!(!this.isEnabled&&!t)&&await this.takeScreenshot()}async takeScreenshot(){if(!this.targetElement)return!1;this.setupGlobalErrorHandlers();try{this.options.silentMode,await Promise.all([this.waitForStylesAndFonts(),this.waitForFonts()]),await new Promise(t=>requestAnimationFrame(()=>{requestAnimationFrame(()=>t())}));const t=this.options.engine||"modern-screenshot";let e;this.options.silentMode,this.options.preloadImages&&this.options.enableCORS&&"modern-screenshot"===t?(this.cleanExpiredCache(),this.options.useIndexedDB&&await this.cleanIndexedDBCache(),await this.preprocessNetworkImages(this.targetElement),await this.waitForImagesToLoad(this.targetElement)):(this.cleanExpiredCache(),this.options.useIndexedDB&&await this.cleanIndexedDBCache()),"html2canvas"===t?(await Promise.all([this.waitForStylesAndFonts(),this.waitForFonts()]),await new Promise(t=>setTimeout(t,200)),e=await this.takeScreenshotWithHtml2Canvas(this.targetElement)):"snapdom"===t?(await new Promise(t=>setTimeout(t,50)),e=await this.takeScreenshotWithSnapdom(this.targetElement)):(await new Promise(t=>setTimeout(t,50)),e=await this.takeScreenshotWithModernScreenshot(this.targetElement));const n=Date.now();if(this.screenshotCount++,this.lastScreenshotTime=n,this.screenshotHistory.length>=this.options.maxHistory){const t=this.screenshotHistory.shift();t&&t.length>1e6&&this.options.silentMode}this.screenshotHistory.push(e);let o=this.screenshotHistory.reduce((t,e)=>t+e.length,0);const i=52428800;for(;this.screenshotHistory.length>0&&o>i;){const t=this.screenshotHistory.shift();if(!t)break;o-=t.length,this.options.silentMode}e.split(",")[1];this.options.silentMode;const r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),a=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4;return this.options.compress&&!r&&!a&&this.worker&&(this.options.silentMode,this.worker.postMessage({type:"COMPRESS_IMAGE",data:{dataUrl:e,maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,quality:this.options.quality,outputFormat:this.options.outputFormat,timestamp:n,count:this.screenshotCount}})),this.error=null,!0}catch(t){const e=t instanceof Error?t.message:String(t);return e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin")||e.includes("XMLHttpRequest")||e.includes("Status:0")?this.options.silentMode:this.error=e,!1}finally{this.removeGlobalErrorHandlers()}}async takeScreenshotWithSnapdom(t){this.options.silentMode;try{const e=t.getBoundingClientRect();if(0===e.width||0===e.height)throw new Error("元素尺寸为 0,无法截图");const n={};if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){let t=this.options.proxyUrl.trim();t.includes("?url=")||(t=t.endsWith("?")?t+"url=":t+"?url="),n.useProxy=t,this.options.silentMode}else this.options.silentMode||this.options.useProxy&&(!this.options.proxyUrl||this.options.proxyUrl.trim());let o;switch(this.options.outputFormat||"png"){case"jpeg":o=await rn.toJpg(t,n);break;case"webp":o=await rn.toWebp(t,n);break;default:o=await rn.toPng(t,n)}const i=o.src;if(!i||i.length<100)throw new Error("生成的 base64 数据无效或过短");return this.options.silentMode,i}catch(t){const e=t instanceof Error?t.message:String(t);throw("EncodingError"===(t instanceof Error?t.name:"Unknown")||e.includes("cannot be decoded")||e.includes("CORS")||e.includes("cross-origin"))&&this.options.silentMode,t}}async takeScreenshotWithHtml2Canvas(t){this.options.silentMode;try{await this.waitForAllStylesLoaded(),await this.waitForFonts(),await new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>t(),100)})})});const n=t.getBoundingClientRect();if(0===n.width||0===n.height)throw new Error("元素尺寸为 0,无法截图");const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4;let r=t.scrollWidth||t.clientWidth||t.offsetWidth,a=t.scrollHeight||t.clientHeight||t.offsetHeight;t!==document.body&&t!==document.documentElement||(r=Math.max(t.scrollWidth,t.offsetWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth,window.innerWidth),a=Math.max(t.scrollHeight,t.offsetHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight,window.innerHeight));const{width:s,height:c}=this.calculateCompressedSize(r,a,this.options.maxWidth,this.options.maxHeight),l=s<r?s:Math.min(r,this.options.maxWidth),u=c<a?c:Math.min(a,this.options.maxHeight),d=o||i?Math.max(.65*this.options.quality,.2):this.options.quality,h={backgroundColor:"#ffffff",scale:1!==this.options.scale?o?.7:this.options.scale:o?.7:1,useCORS:this.options.enableCORS,allowTaint:!this.options.enableCORS,logging:!this.options.silentMode,width:l,height:u,foreignObjectRendering:!1,onclone:(t,e)=>{Array.from(document.styleSheets).forEach(t=>{try{t.cssRules}catch(t){}})},removeContainer:!0,imageTimeout:this.options.imageLoadTimeout||5e3,ignoreElements:t=>{const e=window.getComputedStyle(t);return"none"===e.display||"hidden"===e.visibility||"0"===e.opacity}};this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()&&(h.onclone=t=>{t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src");if(!e)return;try{if(new URL(e,window.location.href).origin===window.location.origin)return}catch{}const n=this.getCachedImage(e);n&&(t.src=n)})}),this.options.silentMode;const m=await e(t,h);let f,p="image/png";if("webp"!==this.options.outputFormat||o)"jpeg"===this.options.outputFormat&&(p="image/jpeg",f=d);else try{const t=document.createElement("canvas");t.width=1,t.height=1;-1!==t.toDataURL("image/webp").indexOf("webp")&&(p="image/webp",f=d)}catch{p="image/jpeg",f=d}const g="image/png"===p?m.toDataURL(p):m.toDataURL(p,f);if(!g||g.length<100)throw new Error("生成的截图数据无效或过短");return this.options.silentMode,g}catch(t){const e=t instanceof Error?t.message:String(t);throw this.options.silentMode||e.includes("CORS")||e.includes("cross-origin"),t}}async takeScreenshotWithModernScreenshot(t){let e,n;this.options.silentMode,t===document.body||t===document.documentElement?(e=Math.max(t.scrollWidth,t.offsetWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth,window.innerWidth),n=Math.max(t.scrollHeight,t.offsetHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight,window.innerHeight)):(e=t.scrollWidth||t.clientWidth||t.offsetWidth,n=t.scrollHeight||t.clientHeight||t.offsetHeight),this.options.silentMode||t===document.body||document.documentElement;const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,r=o||i?Math.max(.65*this.options.quality,.2):this.options.quality,{width:a,height:s}=this.calculateCompressedSize(e,n,this.options.maxWidth,this.options.maxHeight),c=a<e?a:Math.min(e,this.options.maxWidth),l=s<n?s:Math.min(n,this.options.maxHeight),u=t.getBoundingClientRect();if(0===u.width||0===u.height)throw new Error("元素尺寸为 0,无法截图");if(this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}const d={workerNumber:o||i?1:2,quality:r,fetchFn:async t=>{if(t.startsWith("data:")||t.startsWith("blob:"))return t;try{if(new URL(t,window.location.href).origin===window.location.origin)return t}catch(t){}if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){const e=this.getCachedImage(t);if(e)return this.options.silentMode,e;if(this.options.useIndexedDB){const e=await this.getIndexedDBCache(t);if(e)return this.setCachedImage(t,e),this.options.silentMode,e}try{const e=new URLSearchParams({url:t,maxWidth:String(this.options.maxWidth||1600),maxHeight:String(this.options.maxHeight||900),quality:String(Math.round(100*(this.options.quality||.4))),format:this.options.outputFormat||"webp"});let n=this.options.proxyUrl;n=n.replace(/[?&]$/,"");const o=`${n}?${e.toString()}`,i=new AbortController,r=setTimeout(()=>i.abort(),this.options.imageLoadTimeout);try{const e={method:"GET",mode:"cors",credentials:"omit",headers:{Accept:"image/*"},cache:"no-cache",signal:i.signal};"priority"in e&&(e.priority=this.options.fetchPriority);const n=await fetch(o,e);if(clearTimeout(r),!n.ok)throw new Error(`代理请求失败: ${n.status}`);const a=await n.blob(),s=await this.blobToDataUrl(a);return this.setCachedImage(t,s),this.options.useIndexedDB&&await this.setIndexedDBCache(t,s),s}catch(t){throw clearTimeout(r),t}}catch(e){return this.options.silentMode,t}}if(this.options.enableCORS){const e=this.getCachedImage(t);if(e)return this.options.silentMode,e;if(this.options.useIndexedDB){const e=await this.getIndexedDBCache(t);if(e)return this.setCachedImage(t,e),this.options.silentMode,e}if(this.imageDownloadQueue.has(t))return this.options.silentMode,await this.imageDownloadQueue.get(t);if(this.activeDownloads.size>=this.maxConcurrentImageDownloads)return this.options.silentMode,t;const n=this.downloadImageWithoutProxy(t);this.imageDownloadQueue.set(t,n),this.activeDownloads.add(t);try{return await n}finally{this.imageDownloadQueue.delete(t),this.activeDownloads.delete(t)}}return t},fetch:{requestInit:{cache:"no-cache"},bypassingCache:!0},maximumCanvasSize:16777216};c&&l?(d.width=c,d.height=l,this.options.silentMode||t===document.body||document.documentElement):this.options.silentMode,1!==this.options.scale?d.scale=o?.7:this.options.scale:o&&(d.scale=.7),this.options.silentMode,this.screenshotContext=await U(t,d);try{const t=await yt(this.screenshotContext);if(!t||t.length<100)throw new Error("生成的截图数据无效或过短");if("png"!==this.options.outputFormat){const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("无法获取 canvas context");const i=new Image;let a;try{await new Promise((o,r)=>{i.onload=()=>{e.width=i.width,e.height=i.height,n.drawImage(i,0,0),o()},i.onerror=r,i.src=t});let s="image/jpeg",c=r;if("webp"===this.options.outputFormat&&!o)try{const t=document.createElement("canvas");t.width=1,t.height=1;-1!==t.toDataURL("image/webp").indexOf("webp")&&(s="image/webp")}catch{s="image/jpeg"}a="image/png"===s?e.toDataURL(s):e.toDataURL(s,c)}finally{i.src="",i.onload=null,i.onerror=null,e.width=0,e.height=0,n.clearRect(0,0,0,0)}return a}return t}catch(t){t instanceof Error?t.message:String(t);throw this.options.silentMode,t}finally{if(this.screenshotContext)try{et(this.screenshotContext),this.options.silentMode}catch(t){this.options.silentMode}finally{this.screenshotContext=null}if("undefined"!=typeof window&&window.gc&&"function"==typeof window.gc)try{window.gc()}catch{}}}preconnectProxy(){if(!this.preconnected&&this.options.proxyUrl)try{const t=new URL(this.options.proxyUrl).origin,e=document.createElement("link");e.rel="preconnect",e.href=t,e.crossOrigin="anonymous",document.head.appendChild(e),this.preconnected=!0,this.options.silentMode}catch(t){}}initIntersectionObserver(){"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting?this.visibleElementsCache.add(t.target):this.visibleElementsCache.delete(t.target)})},{root:null,rootMargin:"50px",threshold:.01}))}async initIndexedDB(){return new Promise((t,e)=>{const n=indexedDB.open("screenshot-cache",1);n.onerror=()=>e(n.error),n.onsuccess=()=>{this.indexedDBCache=n.result,this.indexedDBReady=!0,this.cleanIndexedDBCache().catch(()=>{}),t()},n.onupgradeneeded=t=>{const e=t.target.result;if(!e.objectStoreNames.contains("images")){e.createObjectStore("images",{keyPath:"url"}).createIndex("timestamp","timestamp",{unique:!1})}}})}async getIndexedDBCache(t){if(!this.indexedDBReady||!this.indexedDBCache)return null;try{const e=this.indexedDBCache.transaction(["images"],"readonly"),n=e.objectStore("images").get(t);return new Promise(e=>{n.onsuccess=()=>{const o=n.result;if(o){if(Date.now()-o.timestamp>this.options.maxCacheAge)return this.deleteIndexedDBCache(t),void e(null);e(o.dataUrl)}else e(null)},n.onerror=()=>e(null)})}catch{return null}}async setIndexedDBCache(t,e){if(this.indexedDBReady&&this.indexedDBCache)try{const n=await this.getIndexedDBCacheSize(),o=this.estimateDataUrlSize(e),i=1024*(this.options.maxCacheSize||50)*1024;n+o>i&&await this.cleanIndexedDBCacheBySize(i-o);const r=this.indexedDBCache.transaction(["images"],"readwrite");r.objectStore("images").put({url:t,dataUrl:e,timestamp:Date.now()})}catch{}}estimateDataUrlSize(t){const e=t.split(",")[1]||"";return Math.ceil(.75*e.length)+30}async getIndexedDBCacheSize(){if(!this.indexedDBReady||!this.indexedDBCache)return 0;try{const t=this.indexedDBCache.transaction(["images"],"readonly"),e=t.objectStore("images").getAll();return new Promise(t=>{e.onsuccess=()=>{const n=e.result||[];let o=0;n.forEach(t=>{o+=this.estimateDataUrlSize(t.dataUrl)}),t(o)},e.onerror=()=>t(0)})}catch{return 0}}async cleanIndexedDBCache(){if(this.indexedDBReady&&this.indexedDBCache)try{const t=this.indexedDBCache.transaction(["images"],"readwrite").objectStore("images"),e=t.index("timestamp").getAll();return new Promise(n=>{e.onsuccess=()=>{const o=e.result||[],i=Date.now(),r=[];let a=0;const s=1024*(this.options.maxCacheSize||50)*1024;o.sort((t,e)=>t.timestamp-e.timestamp),o.forEach(t=>{i-t.timestamp>this.options.maxCacheAge?r.push(t.url):a+=this.estimateDataUrlSize(t.dataUrl)});const c=[...r];if(a>s)for(const t of o)if(!r.includes(t.url)&&(a-=this.estimateDataUrlSize(t.dataUrl),c.push(t.url),a<=s))break;c.forEach(e=>{t.delete(e)}),c.length>0&&this.options.silentMode,n()},e.onerror=()=>n()})}catch{}}async cleanIndexedDBCacheBySize(t){if(this.indexedDBReady&&this.indexedDBCache)try{const e=this.indexedDBCache.transaction(["images"],"readwrite").objectStore("images"),n=e.index("timestamp").getAll();return new Promise(o=>{n.onsuccess=()=>{const i=n.result||[];i.sort((t,e)=>t.timestamp-e.timestamp);let r=0;const a=[];if(i.forEach(t=>{r+=this.estimateDataUrlSize(t.dataUrl)}),r>t)for(const e of i){if(r<=t)break;r-=this.estimateDataUrlSize(e.dataUrl),a.push(e.url)}a.forEach(t=>{e.delete(t)}),a.length>0&&this.options.silentMode,o()},n.onerror=()=>o()})}catch{}}async deleteIndexedDBCache(t){if(this.indexedDBReady&&this.indexedDBCache)try{const e=this.indexedDBCache.transaction(["images"],"readwrite");e.objectStore("images").delete(t)}catch{}}isElementVisible(t,e){if(!this.options.onlyVisibleImages)return!0;if(this.options.useIntersectionObserver&&this.intersectionObserver){if(this.visibleElementsCache.has(t))return!0;this.intersectionObserver.observe(t)}try{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect(),i=!(n.bottom<o.top||n.top>o.bottom||n.right<o.left||n.left>o.right)&&n.width>0&&n.height>0&&"none"!==window.getComputedStyle(t).display&&"hidden"!==window.getComputedStyle(t).visibility&&"0"!==window.getComputedStyle(t).opacity;return this.options.useIntersectionObserver&&this.intersectionObserver&&(i?this.visibleElementsCache.add(t):this.visibleElementsCache.delete(t)),i}catch{return!0}}async preprocessNetworkImages(t){const e=t.querySelectorAll("img"),n=Array.from(e).filter(e=>{const n=e.src.startsWith("blob:"),o=e.src.startsWith("data:"),i=e.src.startsWith(window.location.origin),r=this.isElementVisible(e,t);return!n&&!o&&!i&&r});if(0===n.length)return;if(!this.options.silentMode){e.length}if(this.options.useProxy&&this.options.proxyUrl&&""!==this.options.proxyUrl.trim()){this.options.silentMode;const t=this.options.maxConcurrentDownloads||10,e=[];for(let o=0;o<n.length;o+=t)e.push(n.slice(o,o+t));await Promise.all(e.map(async t=>{await Promise.all(t.map(async t=>{const e=t.src;if(!this.getCachedImage(e))try{const t=await this.proxyImage(e);t&&this.setCachedImage(e,t)}catch(t){this.options.silentMode}}))})),this.options.silentMode}}async proxyImage(t){if(!this.options.proxyUrl||""===this.options.proxyUrl.trim())throw new Error("proxyUrl 未配置");const e=new URLSearchParams({url:t,maxWidth:String(this.options.maxWidth||1600),maxHeight:String(this.options.maxHeight||900),quality:String(Math.round(100*(this.options.quality||.4))),format:this.options.outputFormat||"webp"});let n=this.options.proxyUrl;n=n.replace(/[?&]$/,"");const o=`${n}?${e.toString()}`;this.options.silentMode;const i=await fetch(o,{method:"GET",mode:"cors",credentials:"omit",headers:{Accept:"image/*"}});if(!i.ok){const t=await i.text().catch(()=>"");throw new Error(`代理请求失败: ${i.status} ${i.statusText}${t?` - ${t.substring(0,200)}`:""}`)}const r=await i.blob(),a=await this.blobToDataUrl(r);return this.options.silentMode,a}async downloadImageWithoutProxy(t){try{const e=new AbortController,n=setTimeout(()=>e.abort(),this.options.imageLoadTimeout||5e3),o=await fetch(t,{method:"GET",mode:"cors",credentials:"omit",cache:"no-cache",signal:e.signal}).catch(()=>null).finally(()=>{clearTimeout(n)});if(o&&o.ok){const e=o.headers.get("content-length");if(e){const t=parseInt(e,10)/1048576;if(t>(this.options.maxImageSize||5)){if(this.options.skipLargeImages)return this.options.silentMode,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";this.options.silentMode}}const n=await o.blob(),i=n.size/1048576;if(i>(this.options.maxImageSize||5)){if(this.options.skipLargeImages)return this.options.silentMode,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";this.options.silentMode}const r=await this.blobToDataUrl(n);return this.setCachedImage(t,r),this.options.useIndexedDB&&await this.setIndexedDBCache(t,r),r}return t}catch(e){return this.options.silentMode,t}}blobToDataUrl(t){return new Promise((e,n)=>{const o=new FileReader,i=setTimeout(()=>{n(new Error("图片转换超时"))},1e4);o.onload=()=>{clearTimeout(i),e(o.result)},o.onerror=t=>{clearTimeout(i),n(t)},o.readAsDataURL(t)})}async waitForImagesToLoad(t){const e=t.querySelectorAll("img"),n=[];Array.from(e).forEach(t=>{if(t.complete)return;const e=this.options.imageLoadTimeout||5e3;n.push(Promise.race([new Promise(e=>{t.onload=()=>e(),t.onerror=()=>e()}),new Promise(t=>{setTimeout(()=>t(),e)})]))}),n.length>0&&await Promise.all(n)}async waitForStylesAndFonts(){const t=Array.from(document.styleSheets).map(t=>new Promise(e=>{try{t.cssRules?e():setTimeout(()=>e(),100)}catch(t){e()}}));await Promise.all(t),await new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{t()},100)})})})}async waitForFonts(){if(!document.fonts)return Promise.resolve();try{await document.fonts.ready,await new Promise(t=>setTimeout(t,100))}catch{}}async waitForAllStylesLoaded(){const t=Array.from(document.styleSheets),e=[];t.forEach(t=>{e.push(new Promise(e=>{try{if(t.cssRules)e();else{const n=setInterval(()=>{try{t.cssRules&&(clearInterval(n),e())}catch{clearInterval(n),e()}},50);setTimeout(()=>{clearInterval(n),e()},5e3)}}catch(t){e()}}))}),await Promise.all(e),await new Promise(t=>setTimeout(t,150))}calculateCompressedSize(t,e,n,o){let i=t,r=e;if(i>n||r>o){const t=n/i,e=o/r,a=Math.min(t,e);i=Math.round(i*a),r=Math.round(r*a)}return{width:i,height:r}}createWorker(){if("undefined"==typeof Worker||"undefined"==typeof OffscreenCanvas)return null;try{const t=new Blob(["\n self.onmessage = function(e) {\n const { type, data } = e.data;\n if (type === 'COMPRESS_IMAGE') {\n // 压缩逻辑(简化版)\n self.postMessage({\n type: 'SCREENSHOT_RESULT',\n data: { compressed: { dataUrl: data.dataUrl } }\n });\n }\n };\n "],{type:"application/javascript"}),e=URL.createObjectURL(t),n=new Worker(e);return n.onmessage=t=>{const{type:e,data:n}=t.data;"SCREENSHOT_RESULT"===e&&n?.compressed&&this.screenshotHistory.length>0&&(this.screenshotHistory[this.screenshotHistory.length-1]=n.compressed.dataUrl)},n.onerror=t=>{},n}catch(t){return null}}setupGlobalErrorHandlers(){this.globalErrorHandler=t=>{const e=t.message||t.error?.message||"";return!(e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin"))||(t.preventDefault(),t.stopPropagation(),!1)},this.globalRejectionHandler=t=>{const e=t.reason?.message||String(t.reason)||"";return!(e.includes("CORS")||e.includes("Access-Control-Allow-Origin")||e.includes("cross-origin"))||(t.preventDefault(),!1)},window.addEventListener("error",this.globalErrorHandler,!0),window.addEventListener("unhandledrejection",this.globalRejectionHandler,!0)}removeGlobalErrorHandlers(){this.globalErrorHandler&&(window.removeEventListener("error",this.globalErrorHandler,!0),this.globalErrorHandler=null),this.globalRejectionHandler&&(window.removeEventListener("unhandledrejection",this.globalRejectionHandler,!0),this.globalRejectionHandler=null)}async uploadScreenshot(t,e){try{this.options.silentMode;const n=this.dataUrlToBlob(t,e.contentType),o=await fetch(e.uploadUrl,{method:"PUT",body:n,headers:{"Content-Type":e.contentType}});if(200===o.status||204===o.status)return this.options.silentMode,this.uploadProgress.success++,!0;{const t=await o.text().catch(()=>""),e=`上传失败: HTTP ${o.status} ${o.statusText}${t?` - ${t.substring(0,200)}`:""}`;return this.uploadError=e,this.uploadProgress.failed++,!1}}catch(t){const e=t instanceof Error?t.message:String(t);return this.uploadError=`上传异常: ${e}`,this.uploadProgress.failed++,!1}}dataUrlToBlob(t,e){const n=t.split(","),o=n[0].match(/:(.*?);/),i=o?o[1]:e,r=atob(n[1]);let a=r.length;const s=new Uint8Array(a);for(;a--;)s[a]=r.charCodeAt(a);return new Blob([s],{type:i})}getLatestScreenshot(){return this.screenshotHistory[this.screenshotHistory.length-1]||null}enable(t){this.isEnabled=t,!t&&this.isRunning&&this.stopScreenshot()}destroy(){if(this.stopScreenshot(),this.worker&&(this.worker.terminate(),this.worker=null),this.screenshotContext){try{et(this.screenshotContext)}catch(t){}this.screenshotContext=null}this.expirationTimer&&(clearTimeout(this.expirationTimer),this.expirationTimer=null),this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.removeGlobalErrorHandlers(),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,this.visibleElementsCache.clear()),this.indexedDBCache&&(this.indexedDBCache.close(),this.indexedDBCache=null,this.indexedDBReady=!1),this.imageProxyCache.clear(),this.screenshotHistory.length=0,this.imageDownloadQueue.clear(),this.activeDownloads.clear()}getCachedImage(t){const e=this.imageProxyCache.get(t);if(!e)return null;return Date.now()-e.timestamp>this.options.imageCacheTTL?(this.imageProxyCache.delete(t),null):e.dataUrl}setCachedImage(t,e){let n=0;this.imageProxyCache.forEach(t=>{n+=.75*t.dataUrl.length/1048576});const o=.75*e.length/1048576;if(n+o>100){const t=Array.from(this.imageProxyCache.entries()).sort((t,e)=>t[1].timestamp-e[1].timestamp);let e=n;for(const[n,i]of t){if(e+o<=100)break;const t=.75*i.dataUrl.length/1048576;this.imageProxyCache.delete(n),e-=t,this.options.silentMode}}this.imageProxyCache.set(t,{dataUrl:e,timestamp:Date.now()})}cleanExpiredCache(){const t=Date.now(),e=[];this.imageProxyCache.forEach((n,o)=>{t-n.timestamp>this.options.imageCacheTTL&&e.push(o)}),e.forEach(t=>{this.imageProxyCache.delete(t)}),e.length>0&&this.options.silentMode}startCacheCleanup(){setInterval(()=>{if(this.cleanExpiredCache(),this.options.useIndexedDB&&this.cleanIndexedDBCache().catch(()=>{}),!this.options.silentMode){this.imageProxyCache.size,Array.from(this.imageProxyCache.values()).reduce((t,e)=>t+.75*e.dataUrl.length/1048576,0),this.screenshotHistory.reduce((t,e)=>t+.75*e.length/1048576,0)}},12e4)}getState(){return{isRunning:this.isRunning,screenshotCount:this.screenshotCount,lastScreenshotTime:this.lastScreenshotTime,error:this.error,isEnabled:this.isEnabled,isUploading:this.isUploading,uploadError:this.uploadError,uploadProgress:{...this.uploadProgress},currentUploadConfig:this.currentUploadConfig}}}var cn=function(){return cn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},cn.apply(this,arguments)};function ln(t,e,n,o){return new(n||(n=Promise))(function(i,r){function a(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((o=o.apply(t,e||[])).next())})}function un(t,e){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function dn(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var hn="4.6.2";function mn(t,e){return new Promise(function(n){return setTimeout(n,t,e)})}function fn(t){return!!t&&"function"==typeof t.then}function pn(t,e){try{var n=t();fn(n)?n.then(function(t){return e(!0,t)},function(t){return e(!1,t)}):e(!0,n)}catch(t){e(!1,t)}}function gn(t,e,n){return void 0===n&&(n=16),ln(this,void 0,void 0,function(){var o,i,r,a;return un(this,function(s){switch(s.label){case 0:o=Array(t.length),i=Date.now(),r=0,s.label=1;case 1:return r<t.length?(o[r]=e(t[r],r),(a=Date.now())>=i+n?(i=a,[4,new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++r,[3,1];case 4:return[2,o]}})})}function yn(t){return t.then(void 0,function(){}),t}function wn(t){return parseInt(t)}function bn(t){return parseFloat(t)}function vn(t,e){return"number"==typeof t&&isNaN(t)?e:t}function xn(t){return t.reduce(function(t,e){return t+(e?1:0)},0)}function Sn(t,e){if(void 0===e&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var n=1/e;return Math.round(t*n)/n}function Cn(t,e){var n=t[0]>>>16,o=65535&t[0],i=t[1]>>>16,r=65535&t[1],a=e[0]>>>16,s=65535&e[0],c=e[1]>>>16,l=0,u=0,d=0,h=0;d+=(h+=r+(65535&e[1]))>>>16,h&=65535,u+=(d+=i+c)>>>16,d&=65535,l+=(u+=o+s)>>>16,u&=65535,l+=n+a,l&=65535,t[0]=l<<16|u,t[1]=d<<16|h}function En(t,e){var n=t[0]>>>16,o=65535&t[0],i=t[1]>>>16,r=65535&t[1],a=e[0]>>>16,s=65535&e[0],c=e[1]>>>16,l=65535&e[1],u=0,d=0,h=0,m=0;h+=(m+=r*l)>>>16,m&=65535,d+=(h+=i*l)>>>16,h&=65535,d+=(h+=r*c)>>>16,h&=65535,u+=(d+=o*l)>>>16,d&=65535,u+=(d+=i*c)>>>16,d&=65535,u+=(d+=r*s)>>>16,d&=65535,u+=n*l+o*c+i*s+r*a,u&=65535,t[0]=u<<16|d,t[1]=h<<16|m}function Mn(t,e){var n=t[0];32===(e%=64)?(t[0]=t[1],t[1]=n):e<32?(t[0]=n<<e|t[1]>>>32-e,t[1]=t[1]<<e|n>>>32-e):(e-=32,t[0]=t[1]<<e|n>>>32-e,t[1]=n<<e|t[1]>>>32-e)}function kn(t,e){0!==(e%=64)&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function An(t,e){t[0]^=e[0],t[1]^=e[1]}var Ln=[4283543511,3981806797],In=[3301882366,444984403];function Rn(t){var e=[0,t[0]>>>1];An(t,e),En(t,Ln),e[1]=t[0]>>>1,An(t,e),En(t,In),e[1]=t[0]>>>1,An(t,e)}var Pn=[2277735313,289559509],Tn=[1291169091,658871167],Nn=[0,5],Fn=[0,1390208809],Dn=[0,944331445];function Wn(t,e){var n=function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++){var o=t.charCodeAt(n);if(o>127)return(new TextEncoder).encode(t);e[n]=o}return e}(t);e=e||0;var o,i=[0,n.length],r=i[1]%16,a=i[1]-r,s=[0,e],c=[0,e],l=[0,0],u=[0,0];for(o=0;o<a;o+=16)l[0]=n[o+4]|n[o+5]<<8|n[o+6]<<16|n[o+7]<<24,l[1]=n[o]|n[o+1]<<8|n[o+2]<<16|n[o+3]<<24,u[0]=n[o+12]|n[o+13]<<8|n[o+14]<<16|n[o+15]<<24,u[1]=n[o+8]|n[o+9]<<8|n[o+10]<<16|n[o+11]<<24,En(l,Pn),Mn(l,31),En(l,Tn),An(s,l),Mn(s,27),Cn(s,c),En(s,Nn),Cn(s,Fn),En(u,Tn),Mn(u,33),En(u,Pn),An(c,u),Mn(c,31),Cn(c,s),En(c,Nn),Cn(c,Dn);l[0]=0,l[1]=0,u[0]=0,u[1]=0;var d=[0,0];switch(r){case 15:d[1]=n[o+14],kn(d,48),An(u,d);case 14:d[1]=n[o+13],kn(d,40),An(u,d);case 13:d[1]=n[o+12],kn(d,32),An(u,d);case 12:d[1]=n[o+11],kn(d,24),An(u,d);case 11:d[1]=n[o+10],kn(d,16),An(u,d);case 10:d[1]=n[o+9],kn(d,8),An(u,d);case 9:d[1]=n[o+8],An(u,d),En(u,Tn),Mn(u,33),En(u,Pn),An(c,u);case 8:d[1]=n[o+7],kn(d,56),An(l,d);case 7:d[1]=n[o+6],kn(d,48),An(l,d);case 6:d[1]=n[o+5],kn(d,40),An(l,d);case 5:d[1]=n[o+4],kn(d,32),An(l,d);case 4:d[1]=n[o+3],kn(d,24),An(l,d);case 3:d[1]=n[o+2],kn(d,16),An(l,d);case 2:d[1]=n[o+1],kn(d,8),An(l,d);case 1:d[1]=n[o],An(l,d),En(l,Pn),Mn(l,31),En(l,Tn),An(s,l)}return An(s,i),An(c,i),Cn(s,c),Cn(c,s),Rn(s),Rn(c),Cn(s,c),Cn(c,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function Hn(t,e,n,o){var i=Object.keys(t).filter(function(t){return!function(t,e){for(var n=0,o=t.length;n<o;++n)if(t[n]===e)return!0;return!1}(n,t)}),r=yn(gn(i,function(n){return function(t,e){var n=yn(new Promise(function(n){var o=Date.now();pn(t.bind(null,e),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=Date.now()-o;if(!t[0])return n(function(){return{error:t[1],duration:i}});var r=t[1];if(function(t){return"function"!=typeof t}(r))return n(function(){return{value:r,duration:i}});n(function(){return new Promise(function(t){var e=Date.now();pn(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=i+Date.now()-e;if(!n[0])return t({error:n[1],duration:r});t({value:n[1],duration:r})})})})})}));return function(){return n.then(function(t){return t()})}}(t[n],e)},o));return function(){return ln(this,void 0,void 0,function(){var t,e,n,a;return un(this,function(s){switch(s.label){case 0:return[4,r];case 1:return[4,gn(s.sent(),function(t){return yn(t())},o)];case 2:return t=s.sent(),[4,Promise.all(t)];case 3:for(e=s.sent(),n={},a=0;a<i.length;++a)n[i[a]]=e[a];return[2,n]}})})}}function $n(){var t=window,e=navigator;return xn(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function Un(){var t=window,e=navigator;return xn(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,0===(e.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function Bn(){var t=window;return xn(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,0===navigator.vendor.indexOf("Apple"),"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function Vn(){var t=window,e=t.HTMLElement,n=t.Document;return xn(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),n&&"pointerLockElement"in n.prototype])>=4}function On(){var t,e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser)}function jn(){var t,e,n=window;return xn(["buildID"in navigator,"MozAppearance"in(null!==(e=null===(t=document.documentElement)||void 0===t?void 0:t.style)&&void 0!==e?e:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function zn(){var t=window,e=navigator,n=t.CSS,o=t.HTMLButtonElement;return xn([!("getStorageUpdates"in e),o&&"popover"in o.prototype,"CSSCounterStyleRule"in t,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Xn(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function Zn(){var t=Un(),e=jn(),n=window,o=navigator,i="connection";return t?xn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!e&&xn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Gn(t){var e=new Error(t);return e.name=t,e}function Yn(t,e,n){var o,i,r;return void 0===n&&(n=50),ln(this,void 0,void 0,function(){var a,s;return un(this,function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,mn(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(t,n){var o=!1,i=function(){o=!0,t()};s.onload=i,s.onerror=function(t){o=!0,n(t)};var r=s.style;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",e&&"srcdoc"in s?s.srcdoc=e:s.src="about:blank",a.body.appendChild(s);var c=function(){var t,e;o||("complete"===(null===(e=null===(t=s.contentWindow)||void 0===t?void 0:t.document)||void 0===e?void 0:e.readyState)?i():setTimeout(c,10))};c()})];case 5:c.sent(),c.label=6;case 6:return(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body)?[3,8]:[4,mn(n)];case 7:return c.sent(),[3,6];case 8:return[4,t(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return null===(r=s.parentNode)||void 0===r||r.removeChild(s),[7];case 11:return[2]}})})}function qn(t){for(var e=function(t){for(var e,n,o="Unexpected syntax '".concat(t,"'"),i=/^\s*([a-z-]*)(.*)$/i.exec(t),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(t,e){a[t]=a[t]||[],a[t].push(e)};;){var l=s.exec(i[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(o);c(d[1],null!==(n=null!==(e=d[4])&&void 0!==e?e:d[5])&&void 0!==n?n:"");break;default:throw new Error(o)}}return[r,a]}(t),n=e[0],o=e[1],i=document.createElement(null!=n?n:"div"),r=0,a=Object.keys(o);r<a.length;r++){var s=a[r],c=o[s].join(" ");"style"===s?_n(i.style,c):i.setAttribute(s,c)}return i}function _n(t,e){for(var n=0,o=e.split(";");n<o.length;n++){var i=o[n],r=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(r){var a=r[1],s=r[2],c=r[4];t.setProperty(a,s,c||"")}}}var Jn=["monospace","sans-serif","serif"],Qn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Kn(t){return t.toDataURL()}var to,eo;function no(){var t=this;return function(){if(void 0===eo){var t=function(){var e=oo();io(e)?eo=setTimeout(t,2500):(to=e,eo=void 0)};t()}}(),function(){return ln(t,void 0,void 0,function(){var t;return un(this,function(e){switch(e.label){case 0:return io(t=oo())?to?[2,dn([],to,!0)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,Xn()]:[3,2]:[3,2];case 1:e.sent(),t=oo(),e.label=2;case 2:return io(t)||(to=t),[2,t]}var n})})}}function oo(){var t=screen;return[vn(bn(t.availTop),null),vn(bn(t.width)-bn(t.availWidth)-vn(bn(t.availLeft),0),null),vn(bn(t.height)-bn(t.availHeight)-vn(bn(t.availTop),0),null),vn(bn(t.availLeft),null)]}function io(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function ro(t){var e;return ln(this,void 0,void 0,function(){var n,o,i,r,a,s,c;return un(this,function(l){switch(l.label){case 0:for(n=document,o=n.createElement("div"),i=new Array(t.length),r={},ao(o),c=0;c<t.length;++c)"DIALOG"===(a=qn(t[c])).tagName&&a.show(),ao(s=n.createElement("div")),s.appendChild(a),o.appendChild(s),i[c]=a;l.label=1;case 1:return n.body?[3,3]:[4,mn(50)];case 2:return l.sent(),[3,1];case 3:n.body.appendChild(o);try{for(c=0;c<t.length;++c)i[c].offsetParent||(r[t[c]]=!0)}finally{null===(e=o.parentNode)||void 0===e||e.removeChild(o)}return[2,r]}})})}function ao(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function so(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function co(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}function lo(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function uo(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function ho(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function mo(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var fo=Math,po=function(){return 0};var go={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var yo=function(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}t=e}};var wo=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),bo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),vo=["FRAGMENT_SHADER","VERTEX_SHADER"],xo=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],So="WEBGL_debug_renderer_info";function Co(t){if(t.webgl)return t.webgl.context;var e,n=document.createElement("canvas");n.addEventListener("webglCreateContextError",function(){return e=void 0});for(var o=0,i=["webgl","experimental-webgl"];o<i.length;o++){var r=i[o];try{e=n.getContext(r)}catch(t){}if(e)break}return t.webgl={context:e},e}function Eo(t,e,n){var o=t.getShaderPrecisionFormat(t[e],t[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Mo(t){return Object.keys(t.__proto__).filter(ko)}function ko(t){return"string"==typeof t&&!t.match(/[^A-Z0-9_x]/)}function Ao(){return jn()}function Lo(){return Un()||Bn()}function Io(t){return"function"==typeof t.getParameter}var Ro={fonts:function(){var t=this;return Yn(function(e,n){var o=n.document;return ln(t,void 0,void 0,function(){var t,e,n,i,r,a,s,c,l,u,d;return un(this,function(h){for((t=o.body).style.fontSize="48px",(e=o.createElement("div")).style.setProperty("visibility","hidden","important"),n={},i={},r=function(t){var n=o.createElement("span"),i=n.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=t,n.textContent="mmMwWLliI0O&1",e.appendChild(n),n},a=function(t,e){return r("'".concat(t,"',").concat(e))},s=function(){for(var t={},e=function(e){t[e]=Jn.map(function(t){return a(e,t)})},n=0,o=Qn;n<o.length;n++){e(o[n])}return t},c=function(t){return Jn.some(function(e,o){return t[o].offsetWidth!==n[e]||t[o].offsetHeight!==i[e]})},l=function(){return Jn.map(r)}(),u=s(),t.appendChild(e),d=0;d<Jn.length;d++)n[Jn[d]]=l[d].offsetWidth,i[Jn[d]]=l[d].offsetHeight;return[2,Qn.filter(function(t){return c(u[t])})]})})})},domBlockers:function(t){var e=(void 0===t?{}:t).debug;return ln(this,void 0,void 0,function(){var t,n,o,i,r;return un(this,function(a){switch(a.label){case 0:return Bn()||Zn()?(s=atob,t={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},n=Object.keys(t),[4,ro((r=[]).concat.apply(r,n.map(function(e){return t[e]})))]):[2,void 0];case 1:return o=a.sent(),e&&function(t,e){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];"\n".concat(i,":");for(var r=0,a=t[i];r<a.length;r++){var s=a[r];"\n ".concat(e[s]?"🚫":"➡️"," ").concat(s)}}}(t,o),(i=n.filter(function(e){var n=t[e];return xn(n.map(function(t){return o[t]}))>.6*n.length})).sort(),[2,i]}var s})})},fontPreferences:function(){return function(t,e){void 0===e&&(e=4e3);return Yn(function(n,o){var i=o.document,r=i.body,a=r.style;a.width="".concat(e,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",Un()?r.style.zoom="".concat(1/o.devicePixelRatio):Bn()&&(r.style.zoom="reset");var s=i.createElement("div");return s.textContent=dn([],Array(e/20|0),!0).map(function(){return"word"}).join(" "),r.appendChild(s),t(i,r)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}(function(t,e){for(var n={},o={},i=0,r=Object.keys(go);i<r.length;i++){var a=r[i],s=go[a],c=s[0],l=void 0===c?{}:c,u=s[1],d=void 0===u?"mmMwWLliI0fiflO&1":u,h=t.createElement("span");h.textContent=d,h.style.whiteSpace="nowrap";for(var m=0,f=Object.keys(l);m<f.length;m++){var p=f[m],g=l[p];void 0!==g&&(h.style[p]=g)}n[a]=h,e.append(t.createElement("br"),h)}for(var y=0,w=Object.keys(go);y<w.length;y++){o[a=w[y]]=n[a].getBoundingClientRect().width}return o})},audio:function(){return Bn()&&zn()&&On()||Un()&&(t=navigator,e=window,n=Audio.prototype,o=e.visualViewport,xn(["srLatency"in n,"srChannelCount"in n,"devicePosture"in t,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3)&&function(){var t=window,e=t.URLPattern;return xn(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Bn()&&!Vn()&&!function(){var t=window;return xn(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}())return-1;var n=4500,o=new e(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;var r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);var a=function(t){var e=3,n=500,o=500,i=5e3,r=function(){},a=new Promise(function(a,s){var c=!1,l=0,u=0;t.oncomplete=function(t){return a(t.renderedBuffer)};var d=function(){setTimeout(function(){return s(Gn("timeout"))},Math.min(o,u+i-Date.now()))},h=function(){try{var o=t.startRendering();switch(fn(o)&&yn(o),t.state){case"running":u=Date.now(),c&&d();break;case"suspended":document.hidden||l++,c&&l>=e?s(Gn("suspended")):setTimeout(h,n)}}catch(t){s(t)}};h(),r=function(){c||(c=!0,u>0&&d())}});return[a,r]}(o),s=a[0],c=a[1],l=yn(s.then(function(t){return function(t){for(var e=0,n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}(t.getChannelData(0).subarray(n))},function(t){if("timeout"===t.name||"suspended"===t.name)return-3;throw t}));return function(){return c(),l}}();var t,e,n,o},screenFrame:function(){var t=this;if(Bn()&&zn()&&On())return function(){return Promise.resolve(void 0)};var e=no();return function(){return ln(t,void 0,void 0,function(){var t,n;return un(this,function(o){switch(o.label){case 0:return[4,e()];case 1:return t=o.sent(),[2,[(n=function(t){return null===t?null:Sn(t,10)})(t[0]),n(t[1]),n(t[2]),n(t[3])]]}})})}},canvas:function(){return function(t){var e,n,o,i=!1,r=function(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}(),a=r[0],s=r[1];!function(t,e){return!(!e||!t.toDataURL)}(a,s)?n=o="unsupported":(i=function(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}(s),t?n=o="skipped":(e=function(t,e){!function(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(n,4,45)}(t,e);var n=Kn(t),o=Kn(t);if(n!==o)return["unstable","unstable"];!function(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var n=0,o=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<o.length;n++){var i=o[n],r=i[0],a=i[1],s=i[2];e.fillStyle=r,e.beginPath(),e.arc(a,s,40,0,2*Math.PI,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,2*Math.PI,!0),e.arc(60,60,20,0,2*Math.PI,!0),e.fill("evenodd")}(t,e);var i=Kn(t);return[i,n]}(a,s),n=e[0],o=e[1]));return{winding:i,geometry:n,text:o}}(Bn()&&zn()&&On())},osCpu:function(){return navigator.oscpu},languages:function(){var t,e=navigator,n=[],o=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==o&&n.push([o]),Array.isArray(e.languages))Un()&&xn([!("MediaSettingsRange"in(t=window)),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3||n.push(e.languages);else if("string"==typeof e.languages){var i=e.languages;i&&n.push(i.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return vn(bn(navigator.deviceMemory),void 0)},screenResolution:function(){var t,e,n;if(!(Bn()&&zn()&&On()))return t=screen,(n=[(e=function(t){return vn(wn(t),null)})(t.width),e(t.height)]).sort().reverse(),n},hardwareConcurrency:function(){return vn(wn(navigator.hardwareConcurrency),void 0)},timezone:function(){var t,e=null===(t=window.Intl)||void 0===t?void 0:t.DateTimeFormat;if(e){var n=(new e).resolvedOptions().timeZone;if(n)return n}var o,i=(o=(new Date).getFullYear(),-Math.max(bn(new Date(o,0,1).getTimezoneOffset()),bn(new Date(o,6,1).getTimezoneOffset())));return"UTC".concat(i>=0?"+":"").concat(i)},sessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},localStorage:function(){try{return!!window.localStorage}catch(t){return!0}},indexedDB:function(){var t,e;if(!($n()||(t=window,e=navigator,xn(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!$n())))try{return!!window.indexedDB}catch(t){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var t=navigator.platform;return"MacIntel"===t&&Bn()&&!Vn()?function(){if("iPad"===navigator.platform)return!0;var t=screen,e=t.width/t.height;return xn(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}()?"iPad":"iPhone":t},plugins:function(){var t=navigator.plugins;if(t){for(var e=[],n=0;n<t.length;++n){var o=t[n];if(o){for(var i=[],r=0;r<o.length;++r){var a=o[r];i.push({type:a.type,suffixes:a.suffixes})}e.push({name:o.name,description:o.description,mimeTypes:i})}}return e}},touchSupport:function(){var t,e=navigator,n=0;void 0!==e.maxTouchPoints?n=wn(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var t=[],e=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<n.length;e++){var o=n[e],i=window[o];i&&"object"==typeof i&&t.push(o)}return t.sort()},cookiesEnabled:function(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=-1!==t.cookie.indexOf("cookietest=");return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch(t){return!1}},colorGamut:function(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var n=e[t];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}},invertedColors:function(){return!!so("inverted")||!so("none")&&void 0},forcedColors:function(){return!!co("active")||!co("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=100;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}},contrast:function(){return lo("no-preference")?0:lo("high")||lo("more")?1:lo("low")||lo("less")?-1:lo("forced")?10:void 0},reducedMotion:function(){return!!uo("reduce")||!uo("no-preference")&&void 0},reducedTransparency:function(){return!!ho("reduce")||!ho("no-preference")&&void 0},hdr:function(){return!!mo("high")||!mo("standard")&&void 0},math:function(){var t,e=fo.acos||po,n=fo.acosh||po,o=fo.asin||po,i=fo.asinh||po,r=fo.atanh||po,a=fo.atan||po,s=fo.sin||po,c=fo.sinh||po,l=fo.cos||po,u=fo.cosh||po,d=fo.tan||po,h=fo.tanh||po,m=fo.exp||po,f=fo.expm1||po,p=fo.log1p||po;return{acos:e(.12312423423423424),acosh:n(1e308),acoshPf:(t=1e154,fo.log(t+fo.sqrt(t*t-1))),asin:o(.12312423423423424),asinh:i(1),asinhPf:function(t){return fo.log(t+fo.sqrt(t*t+1))}(1),atanh:r(.5),atanhPf:function(t){return fo.log((1+t)/(1-t))/2}(.5),atan:a(.5),sin:s(-1e300),sinh:c(1),sinhPf:function(t){return fo.exp(t)-1/fo.exp(t)/2}(1),cos:l(10.000000000123),cosh:u(1),coshPf:function(t){return(fo.exp(t)+1/fo.exp(t))/2}(1),tan:d(-1e300),tanh:h(1),tanhPf:function(t){return(fo.exp(2*t)-1)/(fo.exp(2*t)+1)}(1),exp:m(1),expm1:f(1),expm1Pf:function(t){return fo.exp(t)-1}(1),log1p:p(10),log1pPf:function(t){return fo.log(1+t)}(10),powPI:function(t){return fo.pow(fo.PI,t)}(-100)}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]},applePay:function(){var t=window.ApplePaySession;if("function"!=typeof(null==t?void 0:t.canMakePayments))return-1;if(yo())return-3;try{return t.canMakePayments()?1:0}catch(t){return function(t){if(t instanceof Error&&"InvalidAccessError"===t.name&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}(t)}},privateClickMeasurement:function(){var t,e=document.createElement("a"),n=null!==(t=e.attributionSourceId)&&void 0!==t?t:e.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Zn()||Bn()))return-2;if(!window.AudioContext)return-1;var t=(new AudioContext).baseLatency;return null==t?-1:isFinite(t)?t:-3},dateTimeLocale:function(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return e||""===e?e:-3},webGlBasics:function(t){var e,n,o,i,r,a,s=Co(t.cache);if(!s)return-1;if(!Io(s))return-2;var c=Ao()?null:s.getExtension(So);return{version:(null===(e=s.getParameter(s.VERSION))||void 0===e?void 0:e.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function(t){var e=Co(t.cache);if(!e)return-1;if(!Io(e))return-2;var n=e.getSupportedExtensions(),o=e.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(var l=0,u=Object.keys(o);l<u.length;l++){var d=u[l];r.push("".concat(d,"=").concat(o[d]))}for(var h=0,m=Mo(e);h<m.length;h++){var f=e[x=m[h]];a.push("".concat(x,"=").concat(f).concat(wo.has(f)?"=".concat(e.getParameter(f)):""))}if(n)for(var p=0,g=n;p<g.length;p++){var y=g[p];if(!(y===So&&Ao()||"WEBGL_polygon_mode"===y&&Lo())){var w=e.getExtension(y);if(w)for(var b=0,v=Mo(w);b<v.length;b++){var x;f=w[x=v[b]];s.push("".concat(x,"=").concat(f).concat(bo.has(f)?"=".concat(e.getParameter(f)):""))}else i.push(y)}}for(var S=0,C=vo;S<C.length;S++)for(var E=C[S],M=0,k=xo;M<k.length;M++){var A=k[M],L=Eo(e,E,A);c.push("".concat(E,".").concat(A,"=").concat(L.join(",")))}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function Po(t){var e=function(t){if(Zn())return.4;if(Bn())return!Vn()||zn()&&On()?.3:.5;var e="value"in t.platform?t.platform.value:"";if(/^Win/.test(e))return.6;if(/^Mac/.test(e))return.5;return.7}(t),n=function(t){return Sn(.99+.01*t,1e-4)}(e);return{score:e,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(n))}}function To(t){return Wn(function(t){for(var e="",n=0,o=Object.keys(t).sort();n<o.length;n++){var i=o[n],r=t[i],a="error"in r?"error":JSON.stringify(r.value);e+="".concat(e?"|":"").concat(i.replace(/([:|\\])/g,"\\$1"),":").concat(a)}return e}(t))}function No(t){return void 0===t&&(t=50),function(t,e){void 0===e&&(e=1/0);var n=window.requestIdleCallback;return n?new Promise(function(t){return n.call(window,function(){return t()},{timeout:e})}):mn(Math.min(t,e))}(t,2*t)}function Fo(t,e){Date.now();return{get:function(n){return ln(this,void 0,void 0,function(){var o,i;return un(this,function(r){switch(r.label){case 0:return Date.now(),[4,t()];case 1:return o=r.sent(),i=function(t){var e,n=Po(t);return{get visitorId(){return void 0===e&&(e=To(this.components)),e},set visitorId(t){e=t},confidence:n,components:t,version:hn}}(o),e||null==n||n.debug,[2,i]}})})}}}var Do={load:function(t){var e;return void 0===t&&(t={}),ln(this,void 0,void 0,function(){var n,o,i;return un(this,function(r){switch(r.label){case 0:return(null===(e=t.monitoring)||void 0===e||e)&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(hn,"/npm-monitoring"),!0),t.send()}catch(t){}}(),n=t.delayFallback,o=t.debug,[4,No(n)];case 1:return r.sent(),i=function(t){return Hn(Ro,t,[])}({cache:{},debug:o}),[2,Fo(i,o)]}})})},hashComponents:To,componentsToDebugString:function(t){return JSON.stringify(t,function(t,e){return e instanceof Error?cn({name:(n=e).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):e;var n,o},2)}};class Wo{constructor(){this.iconManager=null,this.iframeManager=null,this.screenshotManager=null,this.config=null,this.isInitialized=!1}async init(t,e){if(!this.isInitialized){this.config=t;try{const i=await this.getDeviceId(),r=this.buildIframeUrl(t,i),a=e?.iconPosition||void 0;if(this.iconManager=new n(a),await this.iconManager.show(),this.iframeManager=new o({src:r,mode:"auto",width:400,height:600,allowClose:!0,onMessage:(t,e)=>{"new-message"===t&&this.showNotification(0,{pulse:!0})},onClose:()=>{this.iconManager?.forceCleanupDragEvents()},...e}),await this.iframeManager.init(),this.iconManager.onClick(()=>{this.clearNotification(),this.iframeManager?.show()}),t.screenshot){const e=document.body;this.screenshotManager=new sn(e,t.screenshot),this.screenshotManager.enable(!0)}this.isInitialized=!0}catch(t){throw t}}}showIcon(){this.iconManager?.show()}hideIcon(){this.iconManager?.hide()}setIconPosition(t){this.iconManager?.setPosition(t)}setIconCoordinates(t){this.iconManager?.setIconPosition(t)}setIconStyle(t){this.iconManager?.setStyle(t)}openChat(){this.clearNotification(),this.iframeManager?.open()}closeChat(){this.iconManager?.forceCleanupDragEvents(),this.iframeManager?.close()}isChatOpen(){return this.iframeManager?.isIframeOpen()||!1}sendToIframe(t){this.iframeManager?.sendToIframe(t)}getConnectionStatus(){return this.isInitialized}showNotification(t=1,e={}){this.iconManager&&(this.iconManager.showNotification({badgeCount:"string"==typeof t?0:t,badgeText:"string"==typeof t?t:"",pulse:e.pulse||!1}),e.autoHide&&e.autoHide>0&&setTimeout(()=>{this.iconManager?.clearNotification()},e.autoHide))}clearNotification(){this.iconManager?.clearNotification()}setScreenshotTarget(t){this.screenshotManager?.setTargetElement(t)}async captureScreenshot(t=!1){return!!this.screenshotManager&&await this.screenshotManager.captureOnce(t)}enableScreenshot(t){this.screenshotManager&&this.screenshotManager.enable(t)}getScreenshotState(){return this.screenshotManager?.getState()||null}destroy(){this.iconManager?.hide(),this.iframeManager?.close(),this.screenshotManager?.destroy(),this.iconManager=null,this.iframeManager=null,this.screenshotManager=null,this.config=null,this.isInitialized=!1}async getDeviceId(){try{const t=await Do.load();return(await t.get()).visitorId}catch(t){return"device_"+Date.now()+"_"+Math.random().toString(36).substr(2,9)}}buildIframeUrl(t,e){const n=t.iframeUrl;if(!n||""===n.trim())throw new Error("iframeUrl is required but not provided or is empty");const o=new URL(n);return t.agent&&""!==t.agent.trim()&&o.searchParams.set("Agent",t.agent),t.token&&""!==t.token.trim()&&o.searchParams.set("Authorization",t.token),o.searchParams.set("DeviceSign",e),o.searchParams.set("Referrer",document.referrer),o.toString()}}let Ho=null;const $o=async(t,e)=>{Ho||(Ho=new Wo),await Ho.init(t,e)},Uo=()=>{if(!Ho)throw new Error("SDK not initialized. Call init() first.");return Ho},Bo=()=>{Uo().showIcon()},Vo=()=>{Uo().hideIcon()},Oo=t=>{Uo().setIconPosition(t)},jo=t=>{Uo().setIconCoordinates(t)},zo=t=>{Uo().setIconStyle(t)},Xo=()=>{Uo().openChat()},Zo=()=>{Uo().closeChat()},Go=()=>Uo().isChatOpen(),Yo=t=>{Uo().sendToIframe(t)},qo=()=>Uo().getConnectionStatus(),_o=(t=1,e={})=>{Uo().showNotification(t,e)},Jo=()=>{Uo().clearNotification()},Qo=()=>{Uo().destroy(),Ho=null},Ko=t=>{Uo().setScreenshotTarget(t)},ti=async(t=!1)=>{const e=Uo();return await e.captureScreenshot(t)},ei=t=>{Uo().enableScreenshot(t)},ni=()=>Uo().getScreenshotState();var oi={init:$o,getInstance:Uo,showIcon:Bo,hideIcon:Vo,setIconPosition:Oo,setIconCoordinates:jo,setIconStyle:zo,openChat:Xo,closeChat:Zo,isChatOpen:Go,sendToIframe:Yo,getConnectionStatus:qo,showNotification:_o,clearNotification:Jo,setScreenshotTarget:Ko,captureScreenshot:ti,enableScreenshot:ei,getScreenshotState:ni,destroy:Qo};t.CustomerServiceSDK=Wo,t.captureScreenshot=ti,t.clearNotification=Jo,t.closeChat=Zo,t.default=oi,t.destroy=Qo,t.enableScreenshot=ei,t.getConnectionStatus=qo,t.getInstance=Uo,t.getScreenshotState=ni,t.hideIcon=Vo,t.init=$o,t.isChatOpen=Go,t.openChat=Xo,t.sendToIframe=Yo,t.setIconCoordinates=jo,t.setIconPosition=Oo,t.setIconStyle=zo,t.setScreenshotTarget=Ko,t.showIcon=Bo,t.showNotification=_o,Object.defineProperty(t,"__esModule",{value:!0})});
|