import{Y as d,Z as h,_ as g,E as u,$ as l,a0 as v,a1 as p,a2 as A}from"./DdPEVikY.js";const L=Symbol("is custom element"),y=Symbol("is html");function I(r){if(u){var s=!1,e=()=>{if(!s){if(s=!0,r.hasAttribute("value")){var o=r.value;c(r,"value",null),r.value=o}if(r.hasAttribute("checked")){var t=r.checked;c(r,"checked",null),r.checked=t}}};r.__on_r=e,p(e),A()}}function c(r,s,e,o){var t=M(r);if(u&&(t[s]=r.getAttribute(s),s==="src"||s==="srcset"||s==="href"&&r.nodeName==="LINK")){S(r,s,e??"");return}t[s]!==(t[s]=e)&&(s==="loading"&&(r[d]=e),e==null?r.removeAttribute(s):typeof e!="string"&&T(r).includes(s)?r[s]=e:r.setAttribute(s,e))}function M(r){return r.__attributes??={[L]:r.nodeName.includes("-"),[y]:r.namespaceURI===h}}var i=new Map;function T(r){var s=r.getAttribute("is")||r.nodeName,e=i.get(s);if(e)return e;i.set(s,e=[]);for(var o,t=r,a=Element.prototype;a!==t;){o=l(t);for(var n in o)o[n].set&&e.push(n);t=g(t)}return e}function S(r,s,e){s==="srcset"&&k(r,e)||_(r.getAttribute(s)??"",e)||v(s,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(e))}function _(r,s){return r===s?!0:new URL(r,document.baseURI).href===new URL(s,document.baseURI).href}function f(r){return r.split(",").map(s=>s.trim().split(" ").filter(Boolean))}function k(r,s){var e=f(r.srcset),o=f(s);return o.length===e.length&&o.every(([t,a],n)=>a===e[n][1]&&(_(e[n][0],t)||_(t,e[n][0])))}export{I as r,c as s};
