@chialab/dna
Advanced tools
Comparing version 3.21.2 to 3.21.3
var Ze={};var j;if(typeof window<"u")j=window;else if(typeof global<"u"){let e=new Ze.JSDOM;j=e.window,j._jsdom=e}else{let e=function(){throw new Error("Missing DOM implementation.")};j={Node:e,HTMLElement:e,Event:e,CustomEvent:e,document:{createDocumentFragment:e,createElement:e,createElementNS:e,createTextNode:e,createComment:e,addEventListener(){}}}}var{Node:_,HTMLElement:H,Event:tt,CustomEvent:nt,document:S}=j,{DOCUMENT_NODE:nn,TEXT_NODE:rn,COMMENT_NODE:Dn,ELEMENT_NODE:sn}=_,U=Array.isArray,J=Object.getOwnPropertyDescriptor,Pe=(e,t)=>{if(!!e)return J(e,t)||Pe(oe(e),t)},oe=Object.getPrototypeOf,me=Object.setPrototypeOf||((e,t)=>{e.__proto__=t});var Z=Object.prototype.hasOwnProperty,ee=Object.defineProperty,rt=_.prototype.appendChild,it=_.prototype.removeChild,st=_.prototype.insertBefore,ot=_.prototype.replaceChild,dt=H.prototype.insertAdjacentElement,et=J(_.prototype,"isConnected"),ut=H.prototype.getAttribute,ge=H.prototype.hasAttribute,$=H.prototype.setAttribute,be=H.prototype.removeAttribute,at=H.prototype.matches||H.prototype.webkitMatchesSelector||H.prototype.msMatchesSelector,lt=S.createDocumentFragment.bind(S),Te=S.createElement.bind(S),ft=S.createElementNS.bind(S),pt=S.createTextNode.bind(S),ct=S.createComment.bind(S),ye=(e,t={})=>{let n;try{n=new nt(e,t)}catch{n=S.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles||!1,t.cancelable||!1,t.detail)}return n},he=e=>e instanceof _,on=e=>e&&e.nodeType===nn,Se=e=>e&&e.nodeType===rn,D=e=>e&&e.nodeType===sn,mt=e=>e instanceof tt,K=et?et.get:function(){if(D(this)||Se(this)){let e=this.parentNode;return e?K.call(e):!1}return!!on(this)},G=j.customElements,te=e=>{let t=[];for(let n=e.length;n--;t.unshift(e.item(n)));return t};var ke=Symbol(),Oe=Symbol(),q=(e,t=!1)=>{let n=e[ke]||{};return t&&!Z.call(e,ke)?e[ke]={__proto__:n}:n},X=(e,t,n=!1)=>{let i=q(e)[t];if(n&&!i)throw new Error(`Missing property ${String(t)}`);return i},dn=e=>{let t=e.type;return t?U(t)?t:[t]:[]},xe=(e,t,n,i,s=!1)=>{let r=i,o=n.attribute||(n.attribute==null?!n.state:!1),u=q(e,!0),d=o?typeof n.attribute=="string"?n.attribute:t:void 0,a=n.event?n.event===!0?`${String(t)}change`:n.event:void 0,l=!!n.state,m=dn(n),f=typeof n.update=="boolean"?n.update:!0,x=m.indexOf(Boolean)!==-1,y=m.indexOf(Number)!==-1,E=m.indexOf(String)!==-1,L=u[t]={fromAttribute(p){if(x&&(!p||p===d))return p!=="false"&&(p===""||p===d);if(p){if(y&&!isNaN(p))return parseFloat(p);if(!E)try{return JSON.parse(p)}catch{}}return p},toAttribute(p){if(p==null||p===!1)return null;let C=typeof p;if(!(C==="object"||C==="symbol"||C==="function"))return p===!0?"":`${p}`},...n,name:t,symbol:r,state:l,type:m,attribute:d,event:a,update:f,static:s},{get:V,set:v,getter:R,setter:b}=L,g=typeof L.validate=="function"&&L.validate,M={configurable:!0,enumerable:!0,get(){let p=this[r];return V&&(p=V.call(this)),R&&(p=R.call(this,p)),p},set(p){if(!w(this)||this.watchedProperties.indexOf(t)===-1){this[r]=p;return}let C=this[r];if(b&&(p=b.call(this,p)),v&&(v.call(this,p),p=this[r]),C===p)return;if(p!=null&&p!==!1){let c=!0;if(m.length&&(c=m.some(h=>p instanceof h||p.constructor===h)),c&&g&&(c=g.call(this,p)),!c)throw new TypeError(`Invalid \`${String(p)}\` value for \`${String(t)}\` property`)}this[r]=p;let A=we(this,t);for(let c=0,h=A.length;c<h;c++)A[c].call(this,C,p,t);a&&this.dispatchEvent(a,{newValue:p,oldValue:C}),l?this.stateChangedCallback(t,C,p):this.propertyChangedCallback(t,C,p),f&&this.forceUpdate()}};ee(e,t,M);let B=[...n.observers||[]];return n.observe&&B.unshift(n.observe),B.forEach(p=>{de(e,t,p)}),M},Ve=e=>{let t={},n=e.constructor,i=n;for(;i&&i!==H;){let s=J(i,"properties");if(s){let r=s.get?s.get.call(n)||{}:s.value;for(let o in r){if(o in t)continue;let u=r[o],d=typeof u=="function"||U(u)?{type:u}:u,a=d.symbol||Symbol(o);xe(e,o,d,a,!0),t[o]=!0}}i=oe(i)}},un=(e,t)=>{let n=q(e);for(let i in n){let s=n[i];if(s.attribute===t)return s}return null},Ne=(e,t,n)=>{let i=X(e,t,!0),{attribute:s,toAttribute:r}=i;if(s&&r){let o=r.call(e,n);o===null?e.removeAttribute(s):o!==void 0&&o!==e.getAttribute(s)&&e.setAttribute(s,o)}},bt=(e,t,n)=>{let i=un(e,t);if(!i)return;let{name:s,attribute:r,fromAttribute:o}=i;r&&o&&(e[s]=o.call(e,n))},gt=(e,t,n)=>{e.initializer=n,e.get=t.get,e.set=t.set,t.get||(e.defaultValue=t.value)},Tt=(e,t,n,i)=>{let s=t.symbol||Symbol(n);if(n!==void 0)return i=i||J(e,n),i&>(t,i,i.initializer),xe(e,n,t,s);let r=e,o=String(r.key);return r.kind!=="field"||r.placement!=="own"?r:(r.descriptor&>(t,r.descriptor,r.initializer),{kind:r.kind,key:s,placement:r.placement,descriptor:{configurable:!1,writable:!0,enumerable:!1},initializer(){return this[s]},finisher(u){xe(u.prototype,o,t,s)}})},an=(e,t,n)=>{if(n!==void 0){de(e,t,e[n]);return}let i=e;if(!i.descriptor)return i;let s=i.descriptor.value;return i.finisher=r=>{de(r.prototype,t,s)},i},ln=e=>{let t=e[Oe]||{};return Z.call(e,Oe)?t:e[Oe]=Object.keys(t).reduce((n,i)=>(n[i]=[...t[i]],n),{})},we=(e,t)=>{if(!X(e,t))throw new Error(`Missing property ${String(t)}`);let n=ln(e);return n[t]=n[t]||[]},de=(e,t,n)=>{we(e,t).push(n)},yt=(e,t,n)=>{let i=we(e,t),s=i.indexOf(n);s!==-1&&i.splice(s,1)};function fn(e={}){return(t,n,i)=>Tt(t,e,n,i)}function pn(e={}){return(t,n,i)=>Tt(t,{...e,state:!0},n,i)}function cn(e){return(t,n)=>an(t,e,n)}var Ie=Symbol(),Fe=Symbol(),ht=e=>({children:[],properties:new WeakMap,host:e.is}),ne=e=>e[Ie],k=e=>e[Ie]=e[Ie]||ht(e),O=e=>e[Fe],xt=e=>e[Fe]=e[Fe]||ht(e);var Ee=(e,t)=>{let n=k(t),i=n.hosts;if(!i)return n.hosts=[];let s=O(e);if(!s)return i;let r=s.parents||[];for(let o=0,u=i.length;o<u;o++){let d=ne(i[o]);if(!d||r.indexOf(d)===-1){T.removeChild(i[o],t);break}}return n.hosts=n.hosts||[]},T={createDocumentFragment:lt,createElement(e,t){let i=t&&t.is||e.toLowerCase(),s=Te(e),r=I.get(i);return r&&ie(r)&&!(s instanceof r)&&r.upgrade(s),s},createElementNS(e,t){return e==="http://www.w3.org/1999/xhtml"?this.createElement(t):ft(e,t)},createTextNode:pt,createComment(e){return ct(e||"")},createEvent(e,t={}){return ye(e,t)},appendChild(e,t,n=w(e),i=!0){let s=t.parentNode,r=n?O(e):k(e);if(n){let o=r.children,u=o.indexOf(t);return u!==-1?o.splice(u,1):Ee(e,t).push(e),o.push(t),i&&e.forceUpdate(),t}return s&&T.removeChild(s,t,!1),r.children.push(t),rt.call(e,t),re()&&K.call(t)&&W(t),t},removeChild(e,t,n=w(e),i=!0){let s=n?O(e):k(e);if(n){let d=k(t),a=s.children,l=a.indexOf(t);if(l!==-1){let m=d.hosts;m&&(d.hosts=m.slice(0,m.indexOf(e))),a.splice(l,1),i&&e.forceUpdate()}return t}let r=K.call(t),o=s.children,u=o.indexOf(t);return u!==-1&&o.splice(u,1),it.call(e,t),re()&&r&&ae(t),t},insertBefore(e,t,n,i=w(e),s=!0){let r=i?O(e):k(e);if(i){let l=r.children,m=l.indexOf(t);if(m!==-1?l.splice(m,1):Ee(e,t).push(e),n){let f=l.indexOf(n);f!==-1&&l.splice(f,0,t)}else l.push(t);return s&&e.forceUpdate(),t}let o=t.parentNode;o&&T.removeChild(o,t,!1);let u=r.children,d=u.indexOf(t);d!==-1&&u.splice(d,1);let a=n?u.indexOf(n):-1;return a!==-1?u.splice(a,0,t):u.push(t),st.call(e,t,n),re()&&K.call(t)&&W(t),t},replaceChild(e,t,n,i=w(e),s=!0){let r=i?O(e):k(e),o=t.parentNode;if(i){let a=r.children,l=a.indexOf(t);l!==-1?a.splice(l,1):Ee(e,t).push(e);let m=a.indexOf(n);return a.splice(m,1,t),Ee(e,n),s&&e.forceUpdate(),n}o&&t!==n&&T.removeChild(o,t,!1),re()&&K.call(n)&&ae(n);let u=r.children,d=u.indexOf(n);return d!==-1&&u.splice(d,1),ot.call(e,t,n),re()&&K.call(t)&&W(t),n},insertAdjacentElement(e,t,n,i=w(e),s=!0){if(t==="afterbegin"){let r=w(e)?e.slotChildNodes[0]:e.firstChild;return T.insertBefore(e,n,r,i,s)}return t==="beforeend"?T.insertBefore(e,n,null,i,s):dt.call(e,t,n)},getAttribute(e,t){return ut.call(e,t)},hasAttribute(e,t){return ge.call(e,t)},setAttribute(e,t,n){if(ue(e)){let s=e.constructor.observedAttributes;if(!(s&&s.indexOf(t)!==-1)){$.call(e,t,n);return}let o=T.getAttribute(e,t);$.call(e,t,n),e.attributeChangedCallback(t,o,n);return}$.call(e,t,n)},removeAttribute(e,t){if(ue(e)){let i=e.constructor.observedAttributes;if(!(i&&i.indexOf(t)!==-1)){be.call(e,t);return}let r=T.getAttribute(e,t);be.call(e,t),e.attributeChangedCallback(t,r,null)}be.call(e,t)}};var Ge=Symbol(),Ke=e=>{if(!D(e))throw new TypeError("The provided element must be a Node")},mn=e=>{if(!mt(e))throw new TypeError("The provided object must be an Event")},Ct=e=>{if(typeof e!="string")throw new TypeError("The provided event name must be a string")},Mt=e=>{if(e!==null&&typeof e!="string")throw new TypeError("The provided selector must be a string or null")},Lt=e=>{if(typeof e!="function")throw new TypeError("The provided callback must be a function")},gn=e=>{if(typeof e!="boolean")throw new TypeError("The provided bubbles option must be a boolean")},bn=e=>{if(typeof e!="boolean")throw new TypeError("The provided cancelable option must be a boolean")},Tn=e=>{if(typeof e<"u"&&typeof e!="boolean")throw new TypeError("The provided composed option must be a boolean")},Re=(e,t,n,i,s)=>{let r=e;Ke(e),Ct(t),Mt(n),Lt(i);let o=r[Ge]=r[Ge]||{},u=o[t]=o[t]||{descriptors:[]},d=u.descriptors;u.listener||(u.listener=a=>{if(!a.target)return;let l=a.target,m=a.stopPropagation,f=a.stopImmediatePropagation,x=!1,y=!1;a.stopPropagation=()=>(x=!0,m.call(a)),a.stopImmediatePropagation=()=>(x=!0,y=!0,f.call(a));let E=[];for(let V=0;V<d.length;V++){let{selector:v,callback:R}=d[V],b;if(v){let g=l;for(;g&&g!==e;){if(D(g)&&at.call(g,v)){b=g;break}g=g.parentNode}}else b=e;b&&E.push({target:b,callback:R})}let L;E.slice(0).sort((V,v)=>V.target===v.target?E.indexOf(V)-E.indexOf(v):V.target.contains(v.target)?E.length:-E.length).some(({callback:V,target:v})=>y||x&&v!==L?!0:(L=v,V.call(e,a,v)===!1))},e.addEventListener(t,u.listener,s)),d.push({event:t,callback:i,selector:n,target:null})},Be=(e,t,n,i)=>{Ke(e),Ct(t),Mt(n),Lt(i);let r=e[Ge];if(!r||!(t in r))return;let{descriptors:o,listener:u}=r[t];for(let d=0;d<o.length;d++){let a=o[d];a.selector===n&&a.callback===i&&(o.splice(d,1),o.length===0&&e.removeEventListener(t,u))}};function vt(e,t,n,i,s){return typeof e!="string"?(mn(e),e):(gn(n),bn(i),Tn(s),ye(e,{detail:t,bubbles:n,cancelable:i,composed:s}))}var Me=(e,t,n,i=!0,s=!0,r=!1)=>(Ke(e),t=vt(t,n,i,s,r),H.prototype.dispatchEvent.call(e,t)),je=async(e,t,n,i=!0,s=!0,r=!1)=>{let o=vt(t,n,i,s,r),u=[];if(o.respondWith=function(d){u.push(d())},!Me(e,o)&&u.length===0)throw new Error("Event has been canceled");return await Promise.all(u)},Ce=Symbol(),le=e=>{let t=e[Ce];return t?Z.call(e,Ce)?t:t.slice(0):[]},_e=(e,t)=>{e[Ce]=t};function De(e,t,n,i,s,r={}){let o=le(e);_e(e,o),o.push({event:t,selector:i,callback:s,target:n,options:r})}var Ue=e=>{let t=e.constructor,n=t;for(;n&&n.prototype&&n!==H&&!Z.call(n.prototype,Ce);){let i=J(n,"listeners"),s=i&&i.get;if(s){let r=s.call(t)||{};for(let o in r){let u=o.trim().split(" "),d=u.shift(),a=u.length?u.join(" "):null,l=r[o],{callback:m,target:f=null,...x}=typeof l=="object"?l:{callback:l};De(e,d,f,a,m,x)}}n=oe(n)}},yn=(e,t,n,i,s,r)=>{if(r!==void 0){let u=e[r];De(e,t,n,i,u,s);return}let o=e;return{...o,finisher(u){let d=u.prototype,a=d[o.key];De(d,t,n,i,a,s)}}},Et=e=>typeof e=="object"&&"addEventListener"in e;function hn(e,t,n){return(i,s)=>yn(i,e,Et(t)?t:null,typeof t=="string"?t:null,(!Et(t)&&typeof t!="string"?t:n)||{},s)}var Ht=function(e,t,n,i){var s;t[0]=0;for(var r=1;r<t.length;r++){var o=t[r++],u=t[r]?(t[0]|=o?1:2,n[t[r++]]):t[++r];o===3?i[0]=u:o===4?i[1]=Object.assign(i[1]||{},u):o===5?(i[1]=i[1]||{})[t[++r]]=u:o===6?i[1][t[++r]]+=u+"":o?(s=e.apply(u,Ht(e,u,n,["",null])),i.push(s),u[0]?t[0]|=2:(t[r-2]=0,t[r]=s)):i.push(u)}return i},At=new Map;function Pt(e){var t=At.get(this);return t||(t=new Map,At.set(this,t)),(t=Ht(this,t.get(e)||(t.set(e,t=function(n){for(var i,s,r=1,o="",u="",d=[0],a=function(f){r===1&&(f||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?d.push(0,f,o):r===3&&(f||o)?(d.push(3,f,o),r=2):r===2&&o==="..."&&f?d.push(4,f,0):r===2&&o&&!f?d.push(5,0,!0,o):r>=5&&((o||!f&&r===5)&&(d.push(r,0,o,s),r=6),f&&(d.push(r,f,0,s),r=6)),o=""},l=0;l<n.length;l++){l&&(r===1&&a(),a(l));for(var m=0;m<n[l].length;m++)i=n[l][m],r===1?i==="<"?(a(),d=[d],r=3):o+=i:r===4?o==="--"&&i===">"?(r=1,o=""):o=i+o[0]:u?i===u?u="":o+=i:i==='"'||i==="'"?u=i:i===">"?(a(),r=1):r&&(i==="="?(r=5,s=o,o=""):i==="/"&&(r<5||n[l][m+1]===">")?(a(),r===3&&(d=d[0]),r=d,(d=d[0]).push(2,0,r),r=0):i===" "||i===" "||i===` | ||
`||i==="\r"?(a(),r=2):o+=i),r===3&&o==="!--"&&(r=4,d=d[0])}return a(),d}(e)),t),arguments,[])).length>1?t:t[0]}var St=Symbol(),kt=Symbol(),qe=e=>!!e[St],Xe=e=>e.type===kt,Ot=e=>typeof e.type=="function"&&!We(e.type),Le=e=>typeof e.type=="function"&&We(e.type),Vt=e=>he(e.type),Nt=e=>e.type==="slot",wt=e=>typeof e.type=="string";function Y(e,t=null,...n){let{children:i}=t||{};n=i||n;let s={},r,o,u,d;for(let l in t)l==="is"?o=t.is:l==="xmlns"?u=t.xmlns:l==="ref"?d=t.ref:l==="key"?r=t.key:l==="children"?n=U(t.children)?t.children:[t.children]:s[l]=t[l];return o?e=I.get(o)||e:typeof e=="string"&&(e=I.get(e)||e),{type:d||e,key:r,children:n,properties:s,namespace:e==="svg"?"http://www.w3.org/2000/svg":u,[St]:!0}}function It(e,t=null,n){return t=t||{},n&&(t.key=n),Y(e,t)}var xn=It;var Ft=Symbol(),Gt=e=>typeof e.then=="function",fe=e=>{let t=e[Ft];if(t)return t;let n=e[Ft]={pending:!0};return e.then(i=>{n.result=i,n.pending=!1}).catch(i=>{n.result=i,n.pending=!1}),n};var Dt=Symbol(),Kt=e=>typeof e.subscribe=="function",Rt=e=>{let t=e[Dt];if(t)return t;let n=e[Dt]={complete:!1,errored:!1};return e.subscribe(i=>{n.current=i,n.errored=!1},i=>{n.current=i,n.errored=!0},()=>{n.complete=!0}),n};var Bt={},En=/:host(\(([^({)]+(\([^)]*\))?)+\))?/g,Cn=/\s*\/\*[^*]*\*+([^/*][^*]*\*+)*\/\s*/g,Mn=/(#|\*|\.|@|\[|[a-zA-Z])([^{;}]*){/g,Ye=(e,t,n)=>{if(typeof e!="string")throw new TypeError("The provided name must be a string");if(typeof t!="string")throw new TypeError("The provided CSS text must be a string");let i=Bt[e]=Bt[e]||{},s=n&&n!==e?`${n}[is="${e}"]`:e;return t in i?i[t]:i[t]=t.replace(Cn,` | ||
`).replace(En,(r,o)=>`${s}${o?o.slice(1,-1).replace(":defined","[:defined]"):""}`).replace(Mn,r=>(r=r.trim(),r[0]==="@"?r:r.split(",").map(o=>(o=o.trim(),o.indexOf(s)===0?o:`${s} ${o}`)).join(",")))};var Yt=Pt.bind(Y),zt=e=>{let t=[e];return t.raw=[e],Yt(t)};function Ln(e,...t){return typeof e=="string"?zt(e):Yt(e,...t)}var jt=e=>{let t=[];if(!e)return t;if(typeof e=="object"){for(let n in e)e[n]&&t.push(n);return t}return e.toString().trim().split(" ")},_t=e=>{let t={};if(!e)return t;if(typeof e=="object"){for(let n in e){let i=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),s=e[n];s!=null&&(t[i]=s)}return t}return e.toString().split(";").reduce((n,i)=>{let s=i.split(":");return s.length>1&&(n[s.shift().trim()]=s.join(":").trim()),n},t)},Ut=(e,t)=>(t==="checked"||t==="value")&&e.tagName==="INPUT",pe=(e,t,n)=>{e[t]=n},vn=e=>e[0]==="o"&&e[1]==="n",se=e=>e.children[e.currentIndex]||null,ve=e=>{let t=se(e);return t&&(O(t)||ne(t))||null},qt=(e,t)=>(e=e.fragment||e,e.oldKeys&&e.oldKeys.get(t)||null),Xt=(e,t)=>(e=e.fragment||e,e.oldKeyed?e.oldKeyed.has(t):null),Wt=(e,t,n)=>{e=e.fragment||e,e.keys=e.keys||new Map,e.keys.set(n,t)},z=(e,t,n,i,s,r,o)=>{if(r==null||r===!1)return 0;let u=typeof r=="object";if(u&&U(r)){let f=0;for(let x=0,y=r.length;x<y;x++)f+=z(e,t,n,i,s,r[x],o);return f}let d,a,l,m=n.namespace;if(u&&qe(r)){if(Xe(r))return z(e,t,n,i,s,r.children,o);if(Ot(r)){let{type:g,key:M,properties:B,children:p}=r,C=n.fragment,A,c;C?(A=C.start,c=O(A)||ne(A)):M&&(A=qt(n,M))?c=k(A):M==null&&(c=ve(n))&&(A=se(n))&&c.Function===g&&!Xt(n,A)||(A=T.createComment(g.name),c=k(A),M!=null&&Wt(n,A,M));let h=()=>n.children.indexOf(A)!==-1,P=!0,F=c.requestUpdate=()=>{if(c.requestUpdate!==F)return c.requestUpdate();if(P)throw new Error("An update request is already running");return h()?(ce(e,r,t,n,i,s,n.namespace,c),!0):!1};c.Function=g,c.start=A,c.store=c.store||new Map,n.fragment=void 0;let Q=z(e,t,n,i,s,[A,g({children:p,...B},c,F,h,c)],o);return n.fragment=C,c.end=n.children[n.currentIndex-1],P=!1,Q}if(Nt(r)){let g=O(i);if(!g)return 0;let M=g.children,{properties:B,children:p}=r,C=B.name,c=z(e,t,n,i,s,M,h=>{let P=ne(h);return(!P||!P.hosts||P.hosts[0]===i)&&D(h)?C?h.getAttribute("slot")===C:!h.getAttribute("slot"):!C});return c||z(e,t,n,i,s,p)}let{key:f,children:x,namespace:y}=r;m=y||n.namespace;let E,L,V=!1;f!=null?d=qt(n,f):(E=se(n))&&(L=ve(n))&&D(E)&&!Xt(n,E)&&(!L.parents||L.parents[0]===s)&&(Le(r)&&E.constructor===r.type||wt(r)&&E.tagName.toLowerCase()===r.type.toLowerCase())&&(d=E,a=L),d||(Vt(r)?d=r.type:Le(r)?(d=new r.type,V=!0):(d=T.createElementNS(m,r.type),V=!0)),f!=null&&Wt(n,d,f),a=a||O(d)||k(d),V&&(a.parents=[s]);let v=a.properties.get(s),R=r.properties;if(v)for(let g in v)g in R||(R[g]=void 0);a.properties.set(s,R);let b;for(b in R){let g=R[b],M=v&&v[b];if(M===g){Ut(d,b)&&pe(d,b,g);continue}if(b==="style"){let c=d.style,h=_t(M),P=_t(g);for(let F in h)F in P||c.removeProperty(F);for(let F in P)c.setProperty(F,P[F]);continue}else if(b==="class"){let c=d.classList,h=jt(g);if(M){let P=jt(M);for(let F=0,Q=P.length;F<Q;F++){let Qe=P[F];h.indexOf(Qe)===-1&&c.remove(Qe)}}for(let P=0,F=h.length;P<F;P++){let Q=h[P];c.contains(Q)||c.add(Q)}continue}else if(vn(b)&&!(b in d.constructor.prototype)){let c=b.substr(2);M&&d.removeEventListener(c,M),g&&d.addEventListener(c,g);continue}let B=typeof g,p=typeof M,C=g&&B==="object"||B==="function";if(C||(M&&p==="object"||p==="function")||Ut(d,b))pe(d,b,g);else if(Le(r))if(B==="string"){let c=r.type.observedAttributes;if(!c||c.indexOf(b)===-1){let h=b in d&&Pe(d,b);(!h||!h.get||h.set)&&pe(d,b,g)}else{let h=X(d,b);h&&h.fromAttribute&&pe(d,b,h.fromAttribute.call(d,g))}}else pe(d,b,g);if(g==null||g===!1)d.hasAttribute(b)&&d.removeAttribute(b);else if(!C){let c=g===!0?"":g.toString();d.getAttribute(b)!==c&&d.setAttribute(b,c)}}l=x}else{if(u&&Gt(r))return z(e,t,n,i,s,Y((f,x)=>{let y=fe(r);return y.pending&&r.catch(()=>1).then(()=>{x.requestUpdate()}),y.result},null),o);if(u&&Kt(r)){let f=r;return z(e,t,n,i,s,Y((x,y)=>{let E=Rt(f);if(!E.complete){let L=f.subscribe(()=>{y.requestUpdate()||L.unsubscribe()},()=>{y.requestUpdate()||L.unsubscribe()},()=>{L.unsubscribe()})}return E.current},null),o)}else if(u&&he(r))d=r,a=a||O(d)||k(d);else{let f=O(i);typeof r=="string"&&f&&f.host&&e.tagName==="STYLE"&&(r=Ye(f.host,r,I.tagNames[f.host]),e.setAttribute("name",f.host));let x,y;(x=se(n))&&(y=ve(n))&&Se(x)&&(!y.parents||y.parents[0]===s)?(d=x,a=y,d.textContent!=r&&(d.textContent=r)):(d=T.createTextNode(r),a=k(d),a.parents=[s])}}if(!d||!a||o&&!o(d))return 0;if(n.children.indexOf(d)!==-1){let f;for(;(f=ve(n))&&a!==f;)T.removeChild(e,se(n),t,!1);n.currentIndex++}else T.insertBefore(e,d,se(n),t,!1),n.currentIndex++;return d&&a&&D(d)&&(l&&l.length||(!a.parents||a.parents[0]===s)&&a.children.length)&&(a.parents||(a.parents=[s]),ce(d,l,w(d),a,i,s,m)),1},ce=(e,t,n=w(e),i,s,r=i,o=e.namespaceURI||"http://www.w3.org/1999/xhtml",u)=>{let d=i.children,a=i.fragment,l=i.namespace,m=i.currentIndex;i.parents||(i.parents=[i]),i.namespace=o,i.fragment=u;let f;u?(i.currentIndex=i.children.indexOf(u.start),f=u.end,u.keys&&(u.oldKeys=u.keys,u.oldKeyed=new Set(u.keys.values())),delete u.keys):(i.currentIndex=0,i.keys&&(i.oldKeys=i.keys,i.oldKeyed=new Set(i.keys.values())),delete i.keys),z(e,n,i,s,r,t);let x=i.currentIndex,y;for(f?y=d.indexOf(f)+1:y=d.length;x<y;)T.removeChild(e,d[--y],n,!1);return u?(delete u.oldKeys,delete u.oldKeyed,i.fragment=a,i.namespace=l):(delete i.oldKeys,delete i.oldKeyed,i.fragment=a,i.namespace=l,i.currentIndex=m),n&&e.forceUpdate(),d},Ae=(e,t=T.createDocumentFragment(),n=!0)=>{let i=w(t),s=ce(t,e,n&&i,n&&i?O(t):k(t),t);return!U(e)&&!(e!=null&&qe(e)&&Xe(e))&&s.length<2?s[0]:s.slice(0)};var An=(e,t)=>{let n=e.source,i=t.store;if(i.get("source")===n)return i.get("dom");let s=T.createElement("div");s.innerHTML=n,I.upgrade(s);let r=te(s.childNodes);return i.set("source",n),i.set("dom",r),r},ze=e=>Y(An,{source:e}),Hn=(e,t)=>{let n=fe(e),i=e.then(()=>!1).catch(()=>!1),s=fe(i);return s.result=n.pending&&t,i};var Je=Symbol(),$t=Symbol(),w=e=>!!e[Je],ie=e=>!!e.prototype[Je],Qt=typeof G>"u",Pn=e=>{Qt=!0,e[$t]=!0},re=()=>Qt,ue=e=>!!e[$t],W=e=>{if(!D(e))return;ue(e)&&e.connectedCallback();let t=te(e.childNodes);for(let n=0,i=t.length;n<i;n++)W(t[n])},ae=e=>{if(!D(e))return;ue(e)&&e.disconnectedCallback();let t=te(e.childNodes);for(let n=0,i=t.length;n<i;n++)ae(t[n])};function Jt(e){if(!e.childNodes.length&&e.ownerDocument.readyState==="loading")return;let t=O(e),n=te(e.childNodes);for(let i=0,s=n.length;i<s;i++){let r=n[i],o=k(r);T.removeChild(e,r,!1),o.hosts=[e],o.parents=[t]}return t.children=n,n}var Sn=e=>{let t=class extends e{constructor(...s){super();this.watchedProperties=[];let r=D(s[0])&&s[0],o=r?(me(r,this),r):this,u=xt(o);o.parentNode&&(u.parents=[u]);let d=le(o).map(l=>({...l,callback:l.callback.bind(o)}));_e(o,d);for(let l=0,m=d.length;l<m;l++){let{event:f,target:x,selector:y,callback:E,options:L}=d[l];x||o.delegateEventListener(f,y,E,L)}let a=q(o);for(let l in a){delete o[l];let m=a[l];typeof m.initializer=="function"?o[l]=m.initializer.call(o):typeof m.defaultValue<"u"&&(o[l]=m.defaultValue),m.static&&o.watchedProperties.push(l)}return Jt(o),o.initialize(),o}static get observedAttributes(){let s=q(this.prototype),r=[];for(let o in s){let u=s[o];u&&u.attribute&&!u.state&&r.push(u.attribute)}return r}static upgrade(s){return new this(s)}get is(){}get isConnected(){return K.call(this)}get slotChildNodes(){return O(this).children}get textContent(){return super.textContent}set textContent(s){Ae(s,this)}get innerHTML(){return super.innerHTML}set innerHTML(s){Ae(ze(s),this),I.upgrade(this)}initialize(){}connectedCallback(){ge.call(this,":defined")||(this.is!==this.localName&&$.call(this,"is",this.is),$.call(this,":defined",""));let s=le(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.addEventListener(u,a,l)}this.forceUpdate()}disconnectedCallback(){let s=le(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.removeEventListener(u,a,l)}}attributeChangedCallback(s,r,o){bt(this,s,o)}stateChangedCallback(s,r,o){Ne(this,s,o)}propertyChangedCallback(s,r,o){Ne(this,s,o)}getInnerPropertyValue(s){let r=X(this,s,!0);return this[r.symbol]}setInnerPropertyValue(s,r){let o=X(this,s,!0);this[o.symbol]=r}observe(s,r){de(this,s,r)}unobserve(s,r){yt(this,s,r)}dispatchEvent(s,r,o,u,d){return Me(this,s,r,o,u,d)}dispatchAsyncEvent(s,r,o,u,d){return je(this,s,r,o,u,d)}delegateEventListener(s,r,o,u){Re(this,s,r,o,u)}undelegateEventListener(s,r,o){Be(this,s,r,o)}render(){return this.slotChildNodes}forceUpdate(){(this.slotChildNodes||Jt(this))&&ce(this,this.render(),!1,k(this),this)}appendChild(s){return T.appendChild(this,s)}removeChild(s){return T.removeChild(this,s)}insertBefore(s,r){return T.insertBefore(this,s,r)}replaceChild(s,r){return T.replaceChild(this,s,r)}insertAdjacentElement(s,r){return T.insertAdjacentElement(this,s,r)}setAttribute(s,r){T.setAttribute(this,s,r)}removeAttribute(s){T.removeAttribute(this,s)}};return ee(t.prototype,Je,{get(){return!0}}),t},kn=e=>{let t=function(...i){let s=this.constructor,r=this.is;if(!r)throw new TypeError("Illegal constructor");let o=I.tagNames[r],u;return I.native&&!s.shim&&(u=Reflect.construct(e,i,s),o===u.localName)||(u=Te(o),me(u,s.prototype),Pn(u)),u};return me(t,e),t.apply=Function.apply,t.call=Function.call,t.prototype=e.prototype,t},Zt=e=>Sn(kn(e)),On=Zt(H),He=e=>class en extends e{constructor(...n){super(...n);let i=q(en.prototype);for(let s in i)this.watchedProperties.push(s)}},Vn=e=>{if(typeof e=="function")return He(e);let{kind:t,elements:n}=e;return{kind:t,elements:n,finisher(i){return He(i)}}},Nn=(e,t)=>n=>{if(typeof n=="function"){let r=He(n);return I.define(e,r,t),r}let{kind:i,elements:s}=n;return{kind:i,elements:s,finisher(r){let o=He(r);return I.define(e,o,t),o}}};var tn=e=>!!e&&e.indexOf("-")>=1&&/[a-z\-\d]/.test(e)&&/^[^\d]/i.test(e),We=e=>e.prototype instanceof H,$e=class{constructor(){this.native=!!G;this.registry={};this.tagNames={};this.queue={};S.addEventListener("DOMContentLoaded",()=>{this.upgrade(S.body)})}get(t){let n=this.registry[t];return!n&&G&&tn(t)&&(n=G.get(t)),n}define(t,n,i={}){if(!tn(t))throw new SyntaxError("The provided name must be a valid Custom Element name");if(typeof n!="function")throw new TypeError("The referenced constructor must be a constructor");if(this.registry[t])throw new Error("The registry already contains an entry with the same name");ie(n)&&(Ve(n.prototype),Ue(n.prototype));try{ee(n.prototype,"is",{writable:!1,configurable:!1,value:t})}catch{throw new Error("The registry already contains an entry with the constructor (or is otherwise already defined)")}let s=(i.extends||t).toLowerCase();if(this.registry[t]=n,this.tagNames[t]=s,G){let r=n.shim;s!==t&&(n.shim=!0,i={get extends(){return n.shim=r,s}}),G.define(t,n,i)}else{let r=this.queue;S.body&&this.upgrade(S.body);let o=r[t];if(o)for(let u=0,d=o.length;u<d;u++)o[u](n)}}whenDefined(t){if(G)return G.whenDefined(t).then(()=>G.get(t));if(this.registry[t])return Promise.resolve(this.registry[t]);let n=this.queue;return new Promise(s=>{n[t]=n[t]||[],n[t].push(s)})}upgrade(t){let n=(t.getAttribute("is")||t.tagName).toLowerCase(),i=this.get(n),s=t.children;for(let r=0,o=s.length;r<o;r++){let u=s[r];u&&this.upgrade(u)}if(!!i){if(G&&"upgrade"in G&&G.upgrade(t),w(t)){t.forceUpdate();return}if(ie(i)){let r=[],o=i.observedAttributes||[];for(let d=0,a=t.attributes.length;d<a;d++){let l=t.attributes[d];o.indexOf(l.name)!==-1&&r.push({name:l.name,value:l.value})}let u=i.upgrade(t);for(let d=0,a=r.length;d<a;d++){let{name:l,value:m}=r[d];u.getAttribute(l)===m?u.attributeChangedCallback(l,null,m):u.setAttribute(l,m)}K.call(u)&&W(u),u.forceUpdate()}}}},I=new $e;export{On as Component,nt as CustomEvent,T as DOM,tt as Event,kt as Fragment,H as HTMLElement,_ as Node,zt as compile,W as connect,Ye as css,Nn as customElement,Vn as customElementPrototype,I as customElements,Ue as defineListeners,Ve as defineProperties,xe as defineProperty,Re as delegateEventListener,ae as disconnect,je as dispatchAsyncEvent,Me as dispatchEvent,S as document,Zt as extend,q as getProperties,X as getProperty,Y as h,Ln as html,w as isComponent,ie as isComponentConstructor,It as jsx,xn as jsxs,hn as listen,cn as observe,ze as parseDOM,fn as property,Ae as render,pn as state,Be as undelegateEventListener,Hn as until,j as window}; | ||
`).replace(En,(r,o)=>`${s}${o?o.slice(1,-1).replace(":defined","[:defined]"):""}`).replace(Mn,r=>(r=r.trim(),r[0]==="@"?r:r.split(",").map(o=>(o=o.trim(),o.indexOf(s)===0?o:`${s} ${o}`)).join(",")))};var Yt=Pt.bind(Y),zt=e=>{let t=[e];return t.raw=[e],Yt(t)};function Ln(e,...t){return typeof e=="string"?zt(e):Yt(e,...t)}var jt=e=>{let t=[];if(!e)return t;if(typeof e=="object"){for(let n in e)e[n]&&t.push(n);return t}return e.toString().trim().split(" ")},_t=e=>{let t={};if(!e)return t;if(typeof e=="object"){for(let n in e){let i=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),s=e[n];s!=null&&(t[i]=s)}return t}return e.toString().split(";").reduce((n,i)=>{let s=i.split(":");return s.length>1&&(n[s.shift().trim()]=s.join(":").trim()),n},t)},Ut=(e,t)=>(t==="checked"||t==="value")&&e.tagName==="INPUT",pe=(e,t,n)=>{e[t]=n},vn=e=>e[0]==="o"&&e[1]==="n",se=e=>e.children[e.currentIndex]||null,ve=e=>{let t=se(e);return t&&(O(t)||ne(t))||null},qt=(e,t)=>(e=e.fragment||e,e.oldKeys&&e.oldKeys.get(t)||null),Xt=(e,t)=>(e=e.fragment||e,e.oldKeyed?e.oldKeyed.has(t):null),Wt=(e,t,n)=>{e=e.fragment||e,e.keys=e.keys||new Map,e.keys.set(n,t)},z=(e,t,n,i,s,r,o)=>{if(r==null||r===!1)return 0;let u=typeof r=="object";if(u&&U(r)){let f=0;for(let x=0,y=r.length;x<y;x++)f+=z(e,t,n,i,s,r[x],o);return f}let d,a,l,m=n.namespace;if(u&&qe(r)){if(Xe(r))return z(e,t,n,i,s,r.children,o);if(Ot(r)){let{type:g,key:M,properties:B,children:p}=r,C=n.fragment,A,c;C?(A=C.start,c=O(A)||ne(A)):M&&(A=qt(n,M))?c=k(A):M==null&&(c=ve(n))&&(A=se(n))&&c.Function===g&&!Xt(n,A)||(A=T.createComment(g.name),c=k(A)),M!=null&&Wt(n,A,M);let h=()=>n.children.indexOf(A)!==-1,P=!0,F=c.requestUpdate=()=>{if(c.requestUpdate!==F)return c.requestUpdate();if(P)throw new Error("An update request is already running");return h()?(ce(e,r,t,n,i,s,n.namespace,c),!0):!1};c.Function=g,c.start=A,c.store=c.store||new Map,n.fragment=void 0;let Q=z(e,t,n,i,s,[A,g({children:p,...B},c,F,h,c)],o);return n.fragment=C,c.end=n.children[n.currentIndex-1],P=!1,Q}if(Nt(r)){let g=O(i);if(!g)return 0;let M=g.children,{properties:B,children:p}=r,C=B.name,c=z(e,t,n,i,s,M,h=>{let P=ne(h);return(!P||!P.hosts||P.hosts[0]===i)&&D(h)?C?h.getAttribute("slot")===C:!h.getAttribute("slot"):!C});return c||z(e,t,n,i,s,p)}let{key:f,children:x,namespace:y}=r;m=y||n.namespace;let E,L,V=!1;f!=null?d=qt(n,f):(E=se(n))&&(L=ve(n))&&D(E)&&!Xt(n,E)&&(!L.parents||L.parents[0]===s)&&(Le(r)&&E.constructor===r.type||wt(r)&&E.tagName.toLowerCase()===r.type.toLowerCase())&&(d=E,a=L),d||(Vt(r)?d=r.type:Le(r)?(d=new r.type,V=!0):(d=T.createElementNS(m,r.type),V=!0)),f!=null&&Wt(n,d,f),a=a||O(d)||k(d),V&&(a.parents=[s]);let v=a.properties.get(s),R=r.properties;if(v)for(let g in v)g in R||(R[g]=void 0);a.properties.set(s,R);let b;for(b in R){let g=R[b],M=v&&v[b];if(M===g){Ut(d,b)&&pe(d,b,g);continue}if(b==="style"){let c=d.style,h=_t(M),P=_t(g);for(let F in h)F in P||c.removeProperty(F);for(let F in P)c.setProperty(F,P[F]);continue}else if(b==="class"){let c=d.classList,h=jt(g);if(M){let P=jt(M);for(let F=0,Q=P.length;F<Q;F++){let Qe=P[F];h.indexOf(Qe)===-1&&c.remove(Qe)}}for(let P=0,F=h.length;P<F;P++){let Q=h[P];c.contains(Q)||c.add(Q)}continue}else if(vn(b)&&!(b in d.constructor.prototype)){let c=b.substr(2);M&&d.removeEventListener(c,M),g&&d.addEventListener(c,g);continue}let B=typeof g,p=typeof M,C=g&&B==="object"||B==="function";if(C||(M&&p==="object"||p==="function")||Ut(d,b))pe(d,b,g);else if(Le(r))if(B==="string"){let c=r.type.observedAttributes;if(!c||c.indexOf(b)===-1){let h=b in d&&Pe(d,b);(!h||!h.get||h.set)&&pe(d,b,g)}else{let h=X(d,b);h&&h.fromAttribute&&pe(d,b,h.fromAttribute.call(d,g))}}else pe(d,b,g);if(g==null||g===!1)d.hasAttribute(b)&&d.removeAttribute(b);else if(!C){let c=g===!0?"":g.toString();d.getAttribute(b)!==c&&d.setAttribute(b,c)}}l=x}else{if(u&&Gt(r))return z(e,t,n,i,s,Y((f,x)=>{let y=fe(r);return y.pending&&r.catch(()=>1).then(()=>{x.requestUpdate()}),y.result},null),o);if(u&&Kt(r)){let f=r;return z(e,t,n,i,s,Y((x,y)=>{let E=Rt(f);if(!E.complete){let L=f.subscribe(()=>{y.requestUpdate()||L.unsubscribe()},()=>{y.requestUpdate()||L.unsubscribe()},()=>{L.unsubscribe()})}return E.current},null),o)}else if(u&&he(r))d=r,a=a||O(d)||k(d);else{let f=O(i);typeof r=="string"&&f&&f.host&&e.tagName==="STYLE"&&(r=Ye(f.host,r,I.tagNames[f.host]),e.setAttribute("name",f.host));let x,y;(x=se(n))&&(y=ve(n))&&Se(x)&&(!y.parents||y.parents[0]===s)?(d=x,a=y,d.textContent!=r&&(d.textContent=r)):(d=T.createTextNode(r),a=k(d),a.parents=[s])}}if(!d||!a||o&&!o(d))return 0;if(n.children.indexOf(d)!==-1){let f;for(;(f=ve(n))&&a!==f;)T.removeChild(e,se(n),t,!1);n.currentIndex++}else T.insertBefore(e,d,se(n),t,!1),n.currentIndex++;return d&&a&&D(d)&&(l&&l.length||(!a.parents||a.parents[0]===s)&&a.children.length)&&(a.parents||(a.parents=[s]),ce(d,l,w(d),a,i,s,m)),1},ce=(e,t,n=w(e),i,s,r=i,o=e.namespaceURI||"http://www.w3.org/1999/xhtml",u)=>{let d=i.children,a=i.fragment,l=i.namespace,m=i.currentIndex;i.parents||(i.parents=[i]),i.namespace=o,i.fragment=u;let f;u?(i.currentIndex=i.children.indexOf(u.start),f=u.end,u.keys&&(u.oldKeys=u.keys,u.oldKeyed=new Set(u.keys.values())),delete u.keys):(i.currentIndex=0,i.keys&&(i.oldKeys=i.keys,i.oldKeyed=new Set(i.keys.values())),delete i.keys),z(e,n,i,s,r,t);let x=i.currentIndex,y;for(f?y=d.indexOf(f)+1:y=d.length;x<y;)T.removeChild(e,d[--y],n,!1);return u?(delete u.oldKeys,delete u.oldKeyed,i.fragment=a,i.namespace=l):(delete i.oldKeys,delete i.oldKeyed,i.fragment=a,i.namespace=l,i.currentIndex=m),n&&e.forceUpdate(),d},Ae=(e,t=T.createDocumentFragment(),n=!0)=>{let i=w(t),s=ce(t,e,n&&i,n&&i?O(t):k(t),t);return!U(e)&&!(e!=null&&qe(e)&&Xe(e))&&s.length<2?s[0]:s.slice(0)};var An=(e,t)=>{let n=e.source,i=t.store;if(i.get("source")===n)return i.get("dom");let s=T.createElement("div");s.innerHTML=n,I.upgrade(s);let r=te(s.childNodes);return i.set("source",n),i.set("dom",r),r},ze=e=>Y(An,{source:e}),Hn=(e,t)=>{let n=fe(e),i=e.then(()=>!1).catch(()=>!1),s=fe(i);return s.result=n.pending&&t,i};var Je=Symbol(),$t=Symbol(),w=e=>!!e[Je],ie=e=>!!e.prototype[Je],Qt=typeof G>"u",Pn=e=>{Qt=!0,e[$t]=!0},re=()=>Qt,ue=e=>!!e[$t],W=e=>{if(!D(e))return;ue(e)&&e.connectedCallback();let t=te(e.childNodes);for(let n=0,i=t.length;n<i;n++)W(t[n])},ae=e=>{if(!D(e))return;ue(e)&&e.disconnectedCallback();let t=te(e.childNodes);for(let n=0,i=t.length;n<i;n++)ae(t[n])};function Jt(e){if(!e.childNodes.length&&e.ownerDocument.readyState==="loading")return;let t=O(e),n=te(e.childNodes);for(let i=0,s=n.length;i<s;i++){let r=n[i],o=k(r);T.removeChild(e,r,!1),o.hosts=[e],o.parents=[t]}return t.children=n,n}var Sn=e=>{let t=class extends e{constructor(...s){super();this.watchedProperties=[];let r=D(s[0])&&s[0],o=r?(me(r,this),r):this,u=xt(o);o.parentNode&&(u.parents=[u]);let d=le(o).map(l=>({...l,callback:l.callback.bind(o)}));_e(o,d);for(let l=0,m=d.length;l<m;l++){let{event:f,target:x,selector:y,callback:E,options:L}=d[l];x||o.delegateEventListener(f,y,E,L)}let a=q(o);for(let l in a){delete o[l];let m=a[l];typeof m.initializer=="function"?o[l]=m.initializer.call(o):typeof m.defaultValue<"u"&&(o[l]=m.defaultValue),m.static&&o.watchedProperties.push(l)}return Jt(o),o.initialize(),o}static get observedAttributes(){let s=q(this.prototype),r=[];for(let o in s){let u=s[o];u&&u.attribute&&!u.state&&r.push(u.attribute)}return r}static upgrade(s){return new this(s)}get is(){}get isConnected(){return K.call(this)}get slotChildNodes(){return O(this).children}get textContent(){return super.textContent}set textContent(s){Ae(s,this)}get innerHTML(){return super.innerHTML}set innerHTML(s){Ae(ze(s),this),I.upgrade(this)}initialize(){}connectedCallback(){ge.call(this,":defined")||(this.is!==this.localName&&$.call(this,"is",this.is),$.call(this,":defined",""));let s=le(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.addEventListener(u,a,l)}this.forceUpdate()}disconnectedCallback(){let s=le(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.removeEventListener(u,a,l)}}attributeChangedCallback(s,r,o){bt(this,s,o)}stateChangedCallback(s,r,o){Ne(this,s,o)}propertyChangedCallback(s,r,o){Ne(this,s,o)}getInnerPropertyValue(s){let r=X(this,s,!0);return this[r.symbol]}setInnerPropertyValue(s,r){let o=X(this,s,!0);this[o.symbol]=r}observe(s,r){de(this,s,r)}unobserve(s,r){yt(this,s,r)}dispatchEvent(s,r,o,u,d){return Me(this,s,r,o,u,d)}dispatchAsyncEvent(s,r,o,u,d){return je(this,s,r,o,u,d)}delegateEventListener(s,r,o,u){Re(this,s,r,o,u)}undelegateEventListener(s,r,o){Be(this,s,r,o)}render(){return this.slotChildNodes}forceUpdate(){(this.slotChildNodes||Jt(this))&&ce(this,this.render(),!1,k(this),this)}appendChild(s){return T.appendChild(this,s)}removeChild(s){return T.removeChild(this,s)}insertBefore(s,r){return T.insertBefore(this,s,r)}replaceChild(s,r){return T.replaceChild(this,s,r)}insertAdjacentElement(s,r){return T.insertAdjacentElement(this,s,r)}setAttribute(s,r){T.setAttribute(this,s,r)}removeAttribute(s){T.removeAttribute(this,s)}};return ee(t.prototype,Je,{get(){return!0}}),t},kn=e=>{let t=function(...i){let s=this.constructor,r=this.is;if(!r)throw new TypeError("Illegal constructor");let o=I.tagNames[r],u;return I.native&&!s.shim&&(u=Reflect.construct(e,i,s),o===u.localName)||(u=Te(o),me(u,s.prototype),Pn(u)),u};return me(t,e),t.apply=Function.apply,t.call=Function.call,t.prototype=e.prototype,t},Zt=e=>Sn(kn(e)),On=Zt(H),He=e=>class en extends e{constructor(...n){super(...n);let i=q(en.prototype);for(let s in i)this.watchedProperties.push(s)}},Vn=e=>{if(typeof e=="function")return He(e);let{kind:t,elements:n}=e;return{kind:t,elements:n,finisher(i){return He(i)}}},Nn=(e,t)=>n=>{if(typeof n=="function"){let r=He(n);return I.define(e,r,t),r}let{kind:i,elements:s}=n;return{kind:i,elements:s,finisher(r){let o=He(r);return I.define(e,o,t),o}}};var tn=e=>!!e&&e.indexOf("-")>=1&&/[a-z\-\d]/.test(e)&&/^[^\d]/i.test(e),We=e=>e.prototype instanceof H,$e=class{constructor(){this.native=!!G;this.registry={};this.tagNames={};this.queue={};S.addEventListener("DOMContentLoaded",()=>{this.upgrade(S.body)})}get(t){let n=this.registry[t];return!n&&G&&tn(t)&&(n=G.get(t)),n}define(t,n,i={}){if(!tn(t))throw new SyntaxError("The provided name must be a valid Custom Element name");if(typeof n!="function")throw new TypeError("The referenced constructor must be a constructor");if(this.registry[t])throw new Error("The registry already contains an entry with the same name");ie(n)&&(Ve(n.prototype),Ue(n.prototype));try{ee(n.prototype,"is",{writable:!1,configurable:!1,value:t})}catch{throw new Error("The registry already contains an entry with the constructor (or is otherwise already defined)")}let s=(i.extends||t).toLowerCase();if(this.registry[t]=n,this.tagNames[t]=s,G){let r=n.shim;s!==t&&(n.shim=!0,i={get extends(){return n.shim=r,s}}),G.define(t,n,i)}else{let r=this.queue;S.body&&this.upgrade(S.body);let o=r[t];if(o)for(let u=0,d=o.length;u<d;u++)o[u](n)}}whenDefined(t){if(G)return G.whenDefined(t).then(()=>G.get(t));if(this.registry[t])return Promise.resolve(this.registry[t]);let n=this.queue;return new Promise(s=>{n[t]=n[t]||[],n[t].push(s)})}upgrade(t){let n=(t.getAttribute("is")||t.tagName).toLowerCase(),i=this.get(n),s=t.children;for(let r=0,o=s.length;r<o;r++){let u=s[r];u&&this.upgrade(u)}if(!!i){if(G&&"upgrade"in G&&G.upgrade(t),w(t)){t.forceUpdate();return}if(ie(i)){let r=[],o=i.observedAttributes||[];for(let d=0,a=t.attributes.length;d<a;d++){let l=t.attributes[d];o.indexOf(l.name)!==-1&&r.push({name:l.name,value:l.value})}let u=i.upgrade(t);for(let d=0,a=r.length;d<a;d++){let{name:l,value:m}=r[d];u.getAttribute(l)===m?u.attributeChangedCallback(l,null,m):u.setAttribute(l,m)}K.call(u)&&W(u),u.forceUpdate()}}}},I=new $e;export{On as Component,nt as CustomEvent,T as DOM,tt as Event,kt as Fragment,H as HTMLElement,_ as Node,zt as compile,W as connect,Ye as css,Nn as customElement,Vn as customElementPrototype,I as customElements,Ue as defineListeners,Ve as defineProperties,xe as defineProperty,Re as delegateEventListener,ae as disconnect,je as dispatchAsyncEvent,Me as dispatchEvent,S as document,Zt as extend,q as getProperties,X as getProperty,Y as h,Ln as html,w as isComponent,ie as isComponentConstructor,It as jsx,xn as jsxs,hn as listen,cn as observe,ze as parseDOM,fn as property,Ae as render,pn as state,Be as undelegateEventListener,Hn as until,j as window}; | ||
//# sourceMappingURL=dna.js.map |
import en from"jsdom";var B;if(typeof window<"u")B=window;else if(typeof global<"u"){let e=new en.JSDOM;B=e.window,B._jsdom=e}else{let e=function(){throw new Error("Missing DOM implementation.")};B={Node:e,HTMLElement:e,Event:e,CustomEvent:e,document:{createDocumentFragment:e,createElement:e,createElementNS:e,createTextNode:e,createComment:e,addEventListener(){}}}}var{Node:j,HTMLElement:H,Event:Ze,CustomEvent:et,document:S}=B,{DOCUMENT_NODE:tn,TEXT_NODE:nn,COMMENT_NODE:Fn,ELEMENT_NODE:rn}=j,_=Array.isArray,z=Object.getOwnPropertyDescriptor,He=(e,t)=>{if(!!e)return z(e,t)||He(se(e),t)},se=Object.getPrototypeOf,ce=Object.setPrototypeOf||((e,t)=>{e.__proto__=t});var Q=Object.prototype.hasOwnProperty,Z=Object.defineProperty,tt=j.prototype.appendChild,nt=j.prototype.removeChild,rt=j.prototype.insertBefore,it=j.prototype.replaceChild,st=H.prototype.insertAdjacentElement,Qe=z(j.prototype,"isConnected"),ot=H.prototype.getAttribute,me=H.prototype.hasAttribute,J=H.prototype.setAttribute,ge=H.prototype.removeAttribute,dt=H.prototype.matches||H.prototype.webkitMatchesSelector||H.prototype.msMatchesSelector,ut=S.createDocumentFragment.bind(S),be=S.createElement.bind(S),at=S.createElementNS.bind(S),lt=S.createTextNode.bind(S),ft=S.createComment.bind(S),Te=(e,t={})=>{let n;try{n=new et(e,t)}catch{n=S.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles||!1,t.cancelable||!1,t.detail)}return n},ye=e=>e instanceof j,sn=e=>e&&e.nodeType===tn,Pe=e=>e&&e.nodeType===nn,G=e=>e&&e.nodeType===rn,pt=e=>e instanceof Ze,D=Qe?Qe.get:function(){if(G(this)||Pe(this)){let e=this.parentNode;return e?D.call(e):!1}return!!sn(this)},F=B.customElements,ee=e=>{let t=[];for(let n=e.length;n--;t.unshift(e.item(n)));return t};var Se=Symbol(),ke=Symbol(),U=(e,t=!1)=>{let n=e[Se]||{};return t&&!Q.call(e,Se)?e[Se]={__proto__:n}:n},q=(e,t,n=!1)=>{let i=U(e)[t];if(n&&!i)throw new Error(`Missing property ${String(t)}`);return i},on=e=>{let t=e.type;return t?_(t)?t:[t]:[]},he=(e,t,n,i,s=!1)=>{let r=i,o=n.attribute||(n.attribute==null?!n.state:!1),u=U(e,!0),d=o?typeof n.attribute=="string"?n.attribute:t:void 0,a=n.event?n.event===!0?`${String(t)}change`:n.event:void 0,l=!!n.state,m=on(n),f=typeof n.update=="boolean"?n.update:!0,x=m.indexOf(Boolean)!==-1,y=m.indexOf(Number)!==-1,E=m.indexOf(String)!==-1,L=u[t]={fromAttribute(p){if(x&&(!p||p===d))return p!=="false"&&(p===""||p===d);if(p){if(y&&!isNaN(p))return parseFloat(p);if(!E)try{return JSON.parse(p)}catch{}}return p},toAttribute(p){if(p==null||p===!1)return null;let C=typeof p;if(!(C==="object"||C==="symbol"||C==="function"))return p===!0?"":`${p}`},...n,name:t,symbol:r,state:l,type:m,attribute:d,event:a,update:f,static:s},{get:V,set:v,getter:K,setter:b}=L,g=typeof L.validate=="function"&&L.validate,M={configurable:!0,enumerable:!0,get(){let p=this[r];return V&&(p=V.call(this)),K&&(p=K.call(this,p)),p},set(p){if(!N(this)||this.watchedProperties.indexOf(t)===-1){this[r]=p;return}let C=this[r];if(b&&(p=b.call(this,p)),v&&(v.call(this,p),p=this[r]),C===p)return;if(p!=null&&p!==!1){let c=!0;if(m.length&&(c=m.some(h=>p instanceof h||p.constructor===h)),c&&g&&(c=g.call(this,p)),!c)throw new TypeError(`Invalid \`${String(p)}\` value for \`${String(t)}\` property`)}this[r]=p;let A=Ne(this,t);for(let c=0,h=A.length;c<h;c++)A[c].call(this,C,p,t);a&&this.dispatchEvent(a,{newValue:p,oldValue:C}),l?this.stateChangedCallback(t,C,p):this.propertyChangedCallback(t,C,p),f&&this.forceUpdate()}};Z(e,t,M);let R=[...n.observers||[]];return n.observe&&R.unshift(n.observe),R.forEach(p=>{oe(e,t,p)}),M},Oe=e=>{let t={},n=e.constructor,i=n;for(;i&&i!==H;){let s=z(i,"properties");if(s){let r=s.get?s.get.call(n)||{}:s.value;for(let o in r){if(o in t)continue;let u=r[o],d=typeof u=="function"||_(u)?{type:u}:u,a=d.symbol||Symbol(o);he(e,o,d,a,!0),t[o]=!0}}i=se(i)}},dn=(e,t)=>{let n=U(e);for(let i in n){let s=n[i];if(s.attribute===t)return s}return null},Ve=(e,t,n)=>{let i=q(e,t,!0),{attribute:s,toAttribute:r}=i;if(s&&r){let o=r.call(e,n);o===null?e.removeAttribute(s):o!==void 0&&o!==e.getAttribute(s)&&e.setAttribute(s,o)}},mt=(e,t,n)=>{let i=dn(e,t);if(!i)return;let{name:s,attribute:r,fromAttribute:o}=i;r&&o&&(e[s]=o.call(e,n))},ct=(e,t,n)=>{e.initializer=n,e.get=t.get,e.set=t.set,t.get||(e.defaultValue=t.value)},gt=(e,t,n,i)=>{let s=t.symbol||Symbol(n);if(n!==void 0)return i=i||z(e,n),i&&ct(t,i,i.initializer),he(e,n,t,s);let r=e,o=String(r.key);return r.kind!=="field"||r.placement!=="own"?r:(r.descriptor&&ct(t,r.descriptor,r.initializer),{kind:r.kind,key:s,placement:r.placement,descriptor:{configurable:!1,writable:!0,enumerable:!1},initializer(){return this[s]},finisher(u){he(u.prototype,o,t,s)}})},un=(e,t,n)=>{if(n!==void 0){oe(e,t,e[n]);return}let i=e;if(!i.descriptor)return i;let s=i.descriptor.value;return i.finisher=r=>{oe(r.prototype,t,s)},i},an=e=>{let t=e[ke]||{};return Q.call(e,ke)?t:e[ke]=Object.keys(t).reduce((n,i)=>(n[i]=[...t[i]],n),{})},Ne=(e,t)=>{if(!q(e,t))throw new Error(`Missing property ${String(t)}`);let n=an(e);return n[t]=n[t]||[]},oe=(e,t,n)=>{Ne(e,t).push(n)},bt=(e,t,n)=>{let i=Ne(e,t),s=i.indexOf(n);s!==-1&&i.splice(s,1)};function ln(e={}){return(t,n,i)=>gt(t,e,n,i)}function fn(e={}){return(t,n,i)=>gt(t,{...e,state:!0},n,i)}function pn(e){return(t,n)=>un(t,e,n)}var we=Symbol(),Ie=Symbol(),Tt=e=>({children:[],properties:new WeakMap,host:e.is}),te=e=>e[we],k=e=>e[we]=e[we]||Tt(e),O=e=>e[Ie],yt=e=>e[Ie]=e[Ie]||Tt(e);var xe=(e,t)=>{let n=k(t),i=n.hosts;if(!i)return n.hosts=[];let s=O(e);if(!s)return i;let r=s.parents||[];for(let o=0,u=i.length;o<u;o++){let d=te(i[o]);if(!d||r.indexOf(d)===-1){T.removeChild(i[o],t);break}}return n.hosts=n.hosts||[]},T={createDocumentFragment:ut,createElement(e,t){let i=t&&t.is||e.toLowerCase(),s=be(e),r=w.get(i);return r&&re(r)&&!(s instanceof r)&&r.upgrade(s),s},createElementNS(e,t){return e==="http://www.w3.org/1999/xhtml"?this.createElement(t):at(e,t)},createTextNode:lt,createComment(e){return ft(e||"")},createEvent(e,t={}){return Te(e,t)},appendChild(e,t,n=N(e),i=!0){let s=t.parentNode,r=n?O(e):k(e);if(n){let o=r.children,u=o.indexOf(t);return u!==-1?o.splice(u,1):xe(e,t).push(e),o.push(t),i&&e.forceUpdate(),t}return s&&T.removeChild(s,t,!1),r.children.push(t),tt.call(e,t),ne()&&D.call(t)&&X(t),t},removeChild(e,t,n=N(e),i=!0){let s=n?O(e):k(e);if(n){let d=k(t),a=s.children,l=a.indexOf(t);if(l!==-1){let m=d.hosts;m&&(d.hosts=m.slice(0,m.indexOf(e))),a.splice(l,1),i&&e.forceUpdate()}return t}let r=D.call(t),o=s.children,u=o.indexOf(t);return u!==-1&&o.splice(u,1),nt.call(e,t),ne()&&r&&ue(t),t},insertBefore(e,t,n,i=N(e),s=!0){let r=i?O(e):k(e);if(i){let l=r.children,m=l.indexOf(t);if(m!==-1?l.splice(m,1):xe(e,t).push(e),n){let f=l.indexOf(n);f!==-1&&l.splice(f,0,t)}else l.push(t);return s&&e.forceUpdate(),t}let o=t.parentNode;o&&T.removeChild(o,t,!1);let u=r.children,d=u.indexOf(t);d!==-1&&u.splice(d,1);let a=n?u.indexOf(n):-1;return a!==-1?u.splice(a,0,t):u.push(t),rt.call(e,t,n),ne()&&D.call(t)&&X(t),t},replaceChild(e,t,n,i=N(e),s=!0){let r=i?O(e):k(e),o=t.parentNode;if(i){let a=r.children,l=a.indexOf(t);l!==-1?a.splice(l,1):xe(e,t).push(e);let m=a.indexOf(n);return a.splice(m,1,t),xe(e,n),s&&e.forceUpdate(),n}o&&t!==n&&T.removeChild(o,t,!1),ne()&&D.call(n)&&ue(n);let u=r.children,d=u.indexOf(n);return d!==-1&&u.splice(d,1),it.call(e,t,n),ne()&&D.call(t)&&X(t),n},insertAdjacentElement(e,t,n,i=N(e),s=!0){if(t==="afterbegin"){let r=N(e)?e.slotChildNodes[0]:e.firstChild;return T.insertBefore(e,n,r,i,s)}return t==="beforeend"?T.insertBefore(e,n,null,i,s):st.call(e,t,n)},getAttribute(e,t){return ot.call(e,t)},hasAttribute(e,t){return me.call(e,t)},setAttribute(e,t,n){if(de(e)){let s=e.constructor.observedAttributes;if(!(s&&s.indexOf(t)!==-1)){J.call(e,t,n);return}let o=T.getAttribute(e,t);J.call(e,t,n),e.attributeChangedCallback(t,o,n);return}J.call(e,t,n)},removeAttribute(e,t){if(de(e)){let i=e.constructor.observedAttributes;if(!(i&&i.indexOf(t)!==-1)){ge.call(e,t);return}let r=T.getAttribute(e,t);ge.call(e,t),e.attributeChangedCallback(t,r,null)}ge.call(e,t)}};var Fe=Symbol(),De=e=>{if(!G(e))throw new TypeError("The provided element must be a Node")},cn=e=>{if(!pt(e))throw new TypeError("The provided object must be an Event")},xt=e=>{if(typeof e!="string")throw new TypeError("The provided event name must be a string")},Et=e=>{if(e!==null&&typeof e!="string")throw new TypeError("The provided selector must be a string or null")},Ct=e=>{if(typeof e!="function")throw new TypeError("The provided callback must be a function")},mn=e=>{if(typeof e!="boolean")throw new TypeError("The provided bubbles option must be a boolean")},gn=e=>{if(typeof e!="boolean")throw new TypeError("The provided cancelable option must be a boolean")},bn=e=>{if(typeof e<"u"&&typeof e!="boolean")throw new TypeError("The provided composed option must be a boolean")},Ke=(e,t,n,i,s)=>{let r=e;De(e),xt(t),Et(n),Ct(i);let o=r[Fe]=r[Fe]||{},u=o[t]=o[t]||{descriptors:[]},d=u.descriptors;u.listener||(u.listener=a=>{if(!a.target)return;let l=a.target,m=a.stopPropagation,f=a.stopImmediatePropagation,x=!1,y=!1;a.stopPropagation=()=>(x=!0,m.call(a)),a.stopImmediatePropagation=()=>(x=!0,y=!0,f.call(a));let E=[];for(let V=0;V<d.length;V++){let{selector:v,callback:K}=d[V],b;if(v){let g=l;for(;g&&g!==e;){if(G(g)&&dt.call(g,v)){b=g;break}g=g.parentNode}}else b=e;b&&E.push({target:b,callback:K})}let L;E.slice(0).sort((V,v)=>V.target===v.target?E.indexOf(V)-E.indexOf(v):V.target.contains(v.target)?E.length:-E.length).some(({callback:V,target:v})=>y||x&&v!==L?!0:(L=v,V.call(e,a,v)===!1))},e.addEventListener(t,u.listener,s)),d.push({event:t,callback:i,selector:n,target:null})},Re=(e,t,n,i)=>{De(e),xt(t),Et(n),Ct(i);let r=e[Fe];if(!r||!(t in r))return;let{descriptors:o,listener:u}=r[t];for(let d=0;d<o.length;d++){let a=o[d];a.selector===n&&a.callback===i&&(o.splice(d,1),o.length===0&&e.removeEventListener(t,u))}};function Mt(e,t,n,i,s){return typeof e!="string"?(cn(e),e):(mn(n),gn(i),bn(s),Te(e,{detail:t,bubbles:n,cancelable:i,composed:s}))}var Ce=(e,t,n,i=!0,s=!0,r=!1)=>(De(e),t=Mt(t,n,i,s,r),H.prototype.dispatchEvent.call(e,t)),Be=async(e,t,n,i=!0,s=!0,r=!1)=>{let o=Mt(t,n,i,s,r),u=[];if(o.respondWith=function(d){u.push(d())},!Ce(e,o)&&u.length===0)throw new Error("Event has been canceled");return await Promise.all(u)},Ee=Symbol(),ae=e=>{let t=e[Ee];return t?Q.call(e,Ee)?t:t.slice(0):[]},je=(e,t)=>{e[Ee]=t};function Ge(e,t,n,i,s,r={}){let o=ae(e);je(e,o),o.push({event:t,selector:i,callback:s,target:n,options:r})}var _e=e=>{let t=e.constructor,n=t;for(;n&&n.prototype&&n!==H&&!Q.call(n.prototype,Ee);){let i=z(n,"listeners"),s=i&&i.get;if(s){let r=s.call(t)||{};for(let o in r){let u=o.trim().split(" "),d=u.shift(),a=u.length?u.join(" "):null,l=r[o],{callback:m,target:f=null,...x}=typeof l=="object"?l:{callback:l};Ge(e,d,f,a,m,x)}}n=se(n)}},Tn=(e,t,n,i,s,r)=>{if(r!==void 0){let u=e[r];Ge(e,t,n,i,u,s);return}let o=e;return{...o,finisher(u){let d=u.prototype,a=d[o.key];Ge(d,t,n,i,a,s)}}},ht=e=>typeof e=="object"&&"addEventListener"in e;function yn(e,t,n){return(i,s)=>Tn(i,e,ht(t)?t:null,typeof t=="string"?t:null,(!ht(t)&&typeof t!="string"?t:n)||{},s)}var vt=function(e,t,n,i){var s;t[0]=0;for(var r=1;r<t.length;r++){var o=t[r++],u=t[r]?(t[0]|=o?1:2,n[t[r++]]):t[++r];o===3?i[0]=u:o===4?i[1]=Object.assign(i[1]||{},u):o===5?(i[1]=i[1]||{})[t[++r]]=u:o===6?i[1][t[++r]]+=u+"":o?(s=e.apply(u,vt(e,u,n,["",null])),i.push(s),u[0]?t[0]|=2:(t[r-2]=0,t[r]=s)):i.push(u)}return i},Lt=new Map;function At(e){var t=Lt.get(this);return t||(t=new Map,Lt.set(this,t)),(t=vt(this,t.get(e)||(t.set(e,t=function(n){for(var i,s,r=1,o="",u="",d=[0],a=function(f){r===1&&(f||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?d.push(0,f,o):r===3&&(f||o)?(d.push(3,f,o),r=2):r===2&&o==="..."&&f?d.push(4,f,0):r===2&&o&&!f?d.push(5,0,!0,o):r>=5&&((o||!f&&r===5)&&(d.push(r,0,o,s),r=6),f&&(d.push(r,f,0,s),r=6)),o=""},l=0;l<n.length;l++){l&&(r===1&&a(),a(l));for(var m=0;m<n[l].length;m++)i=n[l][m],r===1?i==="<"?(a(),d=[d],r=3):o+=i:r===4?o==="--"&&i===">"?(r=1,o=""):o=i+o[0]:u?i===u?u="":o+=i:i==='"'||i==="'"?u=i:i===">"?(a(),r=1):r&&(i==="="?(r=5,s=o,o=""):i==="/"&&(r<5||n[l][m+1]===">")?(a(),r===3&&(d=d[0]),r=d,(d=d[0]).push(2,0,r),r=0):i===" "||i===" "||i===` | ||
`||i==="\r"?(a(),r=2):o+=i),r===3&&o==="!--"&&(r=4,d=d[0])}return a(),d}(e)),t),arguments,[])).length>1?t:t[0]}var Ht=Symbol(),Pt=Symbol(),Ue=e=>!!e[Ht],qe=e=>e.type===Pt,St=e=>typeof e.type=="function"&&!Xe(e.type),Me=e=>typeof e.type=="function"&&Xe(e.type),kt=e=>ye(e.type),Ot=e=>e.type==="slot",Vt=e=>typeof e.type=="string";function W(e,t=null,...n){let{children:i}=t||{};n=i||n;let s={},r,o,u,d;for(let l in t)l==="is"?o=t.is:l==="xmlns"?u=t.xmlns:l==="ref"?d=t.ref:l==="key"?r=t.key:l==="children"?n=_(t.children)?t.children:[t.children]:s[l]=t[l];return o?e=w.get(o)||e:typeof e=="string"&&(e=w.get(e)||e),{type:d||e,key:r,children:n,properties:s,namespace:e==="svg"?"http://www.w3.org/2000/svg":u,[Ht]:!0}}function Nt(e,t=null,n){return t=t||{},n&&(t.key=n),W(e,t)}var hn=Nt;var wt=Symbol(),It=e=>typeof e.then=="function",le=e=>{let t=e[wt];if(t)return t;let n=e[wt]={pending:!0};return e.then(i=>{n.result=i,n.pending=!1}).catch(i=>{n.result=i,n.pending=!1}),n};var Ft=Symbol(),Gt=e=>typeof e.subscribe=="function",Dt=e=>{let t=e[Ft];if(t)return t;let n=e[Ft]={complete:!1,errored:!1};return e.subscribe(i=>{n.current=i,n.errored=!1},i=>{n.current=i,n.errored=!0},()=>{n.complete=!0}),n};var Kt={},xn=/:host(\(([^({)]+(\([^)]*\))?)+\))?/g,En=/\s*\/\*[^*]*\*+([^/*][^*]*\*+)*\/\s*/g,Cn=/(#|\*|\.|@|\[|[a-zA-Z])([^{;}]*){/g,We=(e,t,n)=>{if(typeof e!="string")throw new TypeError("The provided name must be a string");if(typeof t!="string")throw new TypeError("The provided CSS text must be a string");let i=Kt[e]=Kt[e]||{},s=n&&n!==e?`${n}[is="${e}"]`:e;return t in i?i[t]:i[t]=t.replace(En,` | ||
`).replace(xn,(r,o)=>`${s}${o?o.slice(1,-1).replace(":defined","[:defined]"):""}`).replace(Cn,r=>(r=r.trim(),r[0]==="@"?r:r.split(",").map(o=>(o=o.trim(),o.indexOf(s)===0?o:`${s} ${o}`)).join(",")))};var Xt=At.bind(W),Wt=e=>{let t=[e];return t.raw=[e],Xt(t)};function Mn(e,...t){return typeof e=="string"?Wt(e):Xt(e,...t)}var Rt=e=>{let t=[];if(!e)return t;if(typeof e=="object"){for(let n in e)e[n]&&t.push(n);return t}return e.toString().trim().split(" ")},Bt=e=>{let t={};if(!e)return t;if(typeof e=="object"){for(let n in e){let i=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),s=e[n];s!=null&&(t[i]=s)}return t}return e.toString().split(";").reduce((n,i)=>{let s=i.split(":");return s.length>1&&(n[s.shift().trim()]=s.join(":").trim()),n},t)},jt=(e,t)=>(t==="checked"||t==="value")&&e.tagName==="INPUT",fe=(e,t,n)=>{e[t]=n},Ln=e=>e[0]==="o"&&e[1]==="n",ie=e=>e.children[e.currentIndex]||null,Le=e=>{let t=ie(e);return t&&(O(t)||te(t))||null},_t=(e,t)=>(e=e.fragment||e,e.oldKeys&&e.oldKeys.get(t)||null),Ut=(e,t)=>(e=e.fragment||e,e.oldKeyed?e.oldKeyed.has(t):null),qt=(e,t,n)=>{e=e.fragment||e,e.keys=e.keys||new Map,e.keys.set(n,t)},Y=(e,t,n,i,s,r,o)=>{if(r==null||r===!1)return 0;let u=typeof r=="object";if(u&&_(r)){let f=0;for(let x=0,y=r.length;x<y;x++)f+=Y(e,t,n,i,s,r[x],o);return f}let d,a,l,m=n.namespace;if(u&&Ue(r)){if(qe(r))return Y(e,t,n,i,s,r.children,o);if(St(r)){let{type:g,key:M,properties:R,children:p}=r,C=n.fragment,A,c;C?(A=C.start,c=O(A)||te(A)):M&&(A=_t(n,M))?c=k(A):M==null&&(c=Le(n))&&(A=ie(n))&&c.Function===g&&!Ut(n,A)||(A=T.createComment(g.name),c=k(A),M!=null&&qt(n,A,M));let h=()=>n.children.indexOf(A)!==-1,P=!0,I=c.requestUpdate=()=>{if(c.requestUpdate!==I)return c.requestUpdate();if(P)throw new Error("An update request is already running");return h()?(pe(e,r,t,n,i,s,n.namespace,c),!0):!1};c.Function=g,c.start=A,c.store=c.store||new Map,n.fragment=void 0;let $=Y(e,t,n,i,s,[A,g({children:p,...R},c,I,h,c)],o);return n.fragment=C,c.end=n.children[n.currentIndex-1],P=!1,$}if(Ot(r)){let g=O(i);if(!g)return 0;let M=g.children,{properties:R,children:p}=r,C=R.name,c=Y(e,t,n,i,s,M,h=>{let P=te(h);return(!P||!P.hosts||P.hosts[0]===i)&&G(h)?C?h.getAttribute("slot")===C:!h.getAttribute("slot"):!C});return c||Y(e,t,n,i,s,p)}let{key:f,children:x,namespace:y}=r;m=y||n.namespace;let E,L,V=!1;f!=null?d=_t(n,f):(E=ie(n))&&(L=Le(n))&&G(E)&&!Ut(n,E)&&(!L.parents||L.parents[0]===s)&&(Me(r)&&E.constructor===r.type||Vt(r)&&E.tagName.toLowerCase()===r.type.toLowerCase())&&(d=E,a=L),d||(kt(r)?d=r.type:Me(r)?(d=new r.type,V=!0):(d=T.createElementNS(m,r.type),V=!0)),f!=null&&qt(n,d,f),a=a||O(d)||k(d),V&&(a.parents=[s]);let v=a.properties.get(s),K=r.properties;if(v)for(let g in v)g in K||(K[g]=void 0);a.properties.set(s,K);let b;for(b in K){let g=K[b],M=v&&v[b];if(M===g){jt(d,b)&&fe(d,b,g);continue}if(b==="style"){let c=d.style,h=Bt(M),P=Bt(g);for(let I in h)I in P||c.removeProperty(I);for(let I in P)c.setProperty(I,P[I]);continue}else if(b==="class"){let c=d.classList,h=Rt(g);if(M){let P=Rt(M);for(let I=0,$=P.length;I<$;I++){let $e=P[I];h.indexOf($e)===-1&&c.remove($e)}}for(let P=0,I=h.length;P<I;P++){let $=h[P];c.contains($)||c.add($)}continue}else if(Ln(b)&&!(b in d.constructor.prototype)){let c=b.substr(2);M&&d.removeEventListener(c,M),g&&d.addEventListener(c,g);continue}let R=typeof g,p=typeof M,C=g&&R==="object"||R==="function";if(C||(M&&p==="object"||p==="function")||jt(d,b))fe(d,b,g);else if(Me(r))if(R==="string"){let c=r.type.observedAttributes;if(!c||c.indexOf(b)===-1){let h=b in d&&He(d,b);(!h||!h.get||h.set)&&fe(d,b,g)}else{let h=q(d,b);h&&h.fromAttribute&&fe(d,b,h.fromAttribute.call(d,g))}}else fe(d,b,g);if(g==null||g===!1)d.hasAttribute(b)&&d.removeAttribute(b);else if(!C){let c=g===!0?"":g.toString();d.getAttribute(b)!==c&&d.setAttribute(b,c)}}l=x}else{if(u&&It(r))return Y(e,t,n,i,s,W((f,x)=>{let y=le(r);return y.pending&&r.catch(()=>1).then(()=>{x.requestUpdate()}),y.result},null),o);if(u&&Gt(r)){let f=r;return Y(e,t,n,i,s,W((x,y)=>{let E=Dt(f);if(!E.complete){let L=f.subscribe(()=>{y.requestUpdate()||L.unsubscribe()},()=>{y.requestUpdate()||L.unsubscribe()},()=>{L.unsubscribe()})}return E.current},null),o)}else if(u&&ye(r))d=r,a=a||O(d)||k(d);else{let f=O(i);typeof r=="string"&&f&&f.host&&e.tagName==="STYLE"&&(r=We(f.host,r,w.tagNames[f.host]),e.setAttribute("name",f.host));let x,y;(x=ie(n))&&(y=Le(n))&&Pe(x)&&(!y.parents||y.parents[0]===s)?(d=x,a=y,d.textContent!=r&&(d.textContent=r)):(d=T.createTextNode(r),a=k(d),a.parents=[s])}}if(!d||!a||o&&!o(d))return 0;if(n.children.indexOf(d)!==-1){let f;for(;(f=Le(n))&&a!==f;)T.removeChild(e,ie(n),t,!1);n.currentIndex++}else T.insertBefore(e,d,ie(n),t,!1),n.currentIndex++;return d&&a&&G(d)&&(l&&l.length||(!a.parents||a.parents[0]===s)&&a.children.length)&&(a.parents||(a.parents=[s]),pe(d,l,N(d),a,i,s,m)),1},pe=(e,t,n=N(e),i,s,r=i,o=e.namespaceURI||"http://www.w3.org/1999/xhtml",u)=>{let d=i.children,a=i.fragment,l=i.namespace,m=i.currentIndex;i.parents||(i.parents=[i]),i.namespace=o,i.fragment=u;let f;u?(i.currentIndex=i.children.indexOf(u.start),f=u.end,u.keys&&(u.oldKeys=u.keys,u.oldKeyed=new Set(u.keys.values())),delete u.keys):(i.currentIndex=0,i.keys&&(i.oldKeys=i.keys,i.oldKeyed=new Set(i.keys.values())),delete i.keys),Y(e,n,i,s,r,t);let x=i.currentIndex,y;for(f?y=d.indexOf(f)+1:y=d.length;x<y;)T.removeChild(e,d[--y],n,!1);return u?(delete u.oldKeys,delete u.oldKeyed,i.fragment=a,i.namespace=l):(delete i.oldKeys,delete i.oldKeyed,i.fragment=a,i.namespace=l,i.currentIndex=m),n&&e.forceUpdate(),d},ve=(e,t=T.createDocumentFragment(),n=!0)=>{let i=N(t),s=pe(t,e,n&&i,n&&i?O(t):k(t),t);return!_(e)&&!(e!=null&&Ue(e)&&qe(e))&&s.length<2?s[0]:s.slice(0)};var vn=(e,t)=>{let n=e.source,i=t.store;if(i.get("source")===n)return i.get("dom");let s=T.createElement("div");s.innerHTML=n,w.upgrade(s);let r=ee(s.childNodes);return i.set("source",n),i.set("dom",r),r},Ye=e=>W(vn,{source:e}),An=(e,t)=>{let n=le(e),i=e.then(()=>!1).catch(()=>!1),s=le(i);return s.result=n.pending&&t,i};var ze=Symbol(),zt=Symbol(),N=e=>!!e[ze],re=e=>!!e.prototype[ze],Jt=typeof F>"u",Hn=e=>{Jt=!0,e[zt]=!0},ne=()=>Jt,de=e=>!!e[zt],X=e=>{if(!G(e))return;de(e)&&e.connectedCallback();let t=ee(e.childNodes);for(let n=0,i=t.length;n<i;n++)X(t[n])},ue=e=>{if(!G(e))return;de(e)&&e.disconnectedCallback();let t=ee(e.childNodes);for(let n=0,i=t.length;n<i;n++)ue(t[n])};function Yt(e){if(!e.childNodes.length&&e.ownerDocument.readyState==="loading")return;let t=O(e),n=ee(e.childNodes);for(let i=0,s=n.length;i<s;i++){let r=n[i],o=k(r);T.removeChild(e,r,!1),o.hosts=[e],o.parents=[t]}return t.children=n,n}var Pn=e=>{let t=class extends e{constructor(...s){super();this.watchedProperties=[];let r=G(s[0])&&s[0],o=r?(ce(r,this),r):this,u=yt(o);o.parentNode&&(u.parents=[u]);let d=ae(o).map(l=>({...l,callback:l.callback.bind(o)}));je(o,d);for(let l=0,m=d.length;l<m;l++){let{event:f,target:x,selector:y,callback:E,options:L}=d[l];x||o.delegateEventListener(f,y,E,L)}let a=U(o);for(let l in a){delete o[l];let m=a[l];typeof m.initializer=="function"?o[l]=m.initializer.call(o):typeof m.defaultValue<"u"&&(o[l]=m.defaultValue),m.static&&o.watchedProperties.push(l)}return Yt(o),o.initialize(),o}static get observedAttributes(){let s=U(this.prototype),r=[];for(let o in s){let u=s[o];u&&u.attribute&&!u.state&&r.push(u.attribute)}return r}static upgrade(s){return new this(s)}get is(){}get isConnected(){return D.call(this)}get slotChildNodes(){return O(this).children}get textContent(){return super.textContent}set textContent(s){ve(s,this)}get innerHTML(){return super.innerHTML}set innerHTML(s){ve(Ye(s),this),w.upgrade(this)}initialize(){}connectedCallback(){me.call(this,":defined")||(this.is!==this.localName&&J.call(this,"is",this.is),J.call(this,":defined",""));let s=ae(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.addEventListener(u,a,l)}this.forceUpdate()}disconnectedCallback(){let s=ae(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.removeEventListener(u,a,l)}}attributeChangedCallback(s,r,o){mt(this,s,o)}stateChangedCallback(s,r,o){Ve(this,s,o)}propertyChangedCallback(s,r,o){Ve(this,s,o)}getInnerPropertyValue(s){let r=q(this,s,!0);return this[r.symbol]}setInnerPropertyValue(s,r){let o=q(this,s,!0);this[o.symbol]=r}observe(s,r){oe(this,s,r)}unobserve(s,r){bt(this,s,r)}dispatchEvent(s,r,o,u,d){return Ce(this,s,r,o,u,d)}dispatchAsyncEvent(s,r,o,u,d){return Be(this,s,r,o,u,d)}delegateEventListener(s,r,o,u){Ke(this,s,r,o,u)}undelegateEventListener(s,r,o){Re(this,s,r,o)}render(){return this.slotChildNodes}forceUpdate(){(this.slotChildNodes||Yt(this))&&pe(this,this.render(),!1,k(this),this)}appendChild(s){return T.appendChild(this,s)}removeChild(s){return T.removeChild(this,s)}insertBefore(s,r){return T.insertBefore(this,s,r)}replaceChild(s,r){return T.replaceChild(this,s,r)}insertAdjacentElement(s,r){return T.insertAdjacentElement(this,s,r)}setAttribute(s,r){T.setAttribute(this,s,r)}removeAttribute(s){T.removeAttribute(this,s)}};return Z(t.prototype,ze,{get(){return!0}}),t},Sn=e=>{let t=function(...i){let s=this.constructor,r=this.is;if(!r)throw new TypeError("Illegal constructor");let o=w.tagNames[r],u;return w.native&&!s.shim&&(u=Reflect.construct(e,i,s),o===u.localName)||(u=be(o),ce(u,s.prototype),Hn(u)),u};return ce(t,e),t.apply=Function.apply,t.call=Function.call,t.prototype=e.prototype,t},$t=e=>Pn(Sn(e)),kn=$t(H),Ae=e=>class Qt extends e{constructor(...n){super(...n);let i=U(Qt.prototype);for(let s in i)this.watchedProperties.push(s)}},On=e=>{if(typeof e=="function")return Ae(e);let{kind:t,elements:n}=e;return{kind:t,elements:n,finisher(i){return Ae(i)}}},Vn=(e,t)=>n=>{if(typeof n=="function"){let r=Ae(n);return w.define(e,r,t),r}let{kind:i,elements:s}=n;return{kind:i,elements:s,finisher(r){let o=Ae(r);return w.define(e,o,t),o}}};var Zt=e=>!!e&&e.indexOf("-")>=1&&/[a-z\-\d]/.test(e)&&/^[^\d]/i.test(e),Xe=e=>e.prototype instanceof H,Je=class{constructor(){this.native=!!F;this.registry={};this.tagNames={};this.queue={};S.addEventListener("DOMContentLoaded",()=>{this.upgrade(S.body)})}get(t){let n=this.registry[t];return!n&&F&&Zt(t)&&(n=F.get(t)),n}define(t,n,i={}){if(!Zt(t))throw new SyntaxError("The provided name must be a valid Custom Element name");if(typeof n!="function")throw new TypeError("The referenced constructor must be a constructor");if(this.registry[t])throw new Error("The registry already contains an entry with the same name");re(n)&&(Oe(n.prototype),_e(n.prototype));try{Z(n.prototype,"is",{writable:!1,configurable:!1,value:t})}catch{throw new Error("The registry already contains an entry with the constructor (or is otherwise already defined)")}let s=(i.extends||t).toLowerCase();if(this.registry[t]=n,this.tagNames[t]=s,F){let r=n.shim;s!==t&&(n.shim=!0,i={get extends(){return n.shim=r,s}}),F.define(t,n,i)}else{let r=this.queue;S.body&&this.upgrade(S.body);let o=r[t];if(o)for(let u=0,d=o.length;u<d;u++)o[u](n)}}whenDefined(t){if(F)return F.whenDefined(t).then(()=>F.get(t));if(this.registry[t])return Promise.resolve(this.registry[t]);let n=this.queue;return new Promise(s=>{n[t]=n[t]||[],n[t].push(s)})}upgrade(t){let n=(t.getAttribute("is")||t.tagName).toLowerCase(),i=this.get(n),s=t.children;for(let r=0,o=s.length;r<o;r++){let u=s[r];u&&this.upgrade(u)}if(!!i){if(F&&"upgrade"in F&&F.upgrade(t),N(t)){t.forceUpdate();return}if(re(i)){let r=[],o=i.observedAttributes||[];for(let d=0,a=t.attributes.length;d<a;d++){let l=t.attributes[d];o.indexOf(l.name)!==-1&&r.push({name:l.name,value:l.value})}let u=i.upgrade(t);for(let d=0,a=r.length;d<a;d++){let{name:l,value:m}=r[d];u.getAttribute(l)===m?u.attributeChangedCallback(l,null,m):u.setAttribute(l,m)}D.call(u)&&X(u),u.forceUpdate()}}}},w=new Je;export{kn as Component,et as CustomEvent,T as DOM,Ze as Event,Pt as Fragment,H as HTMLElement,j as Node,Wt as compile,X as connect,We as css,Vn as customElement,On as customElementPrototype,w as customElements,_e as defineListeners,Oe as defineProperties,he as defineProperty,Ke as delegateEventListener,ue as disconnect,Be as dispatchAsyncEvent,Ce as dispatchEvent,S as document,$t as extend,U as getProperties,q as getProperty,W as h,Mn as html,N as isComponent,re as isComponentConstructor,Nt as jsx,hn as jsxs,yn as listen,pn as observe,Ye as parseDOM,ln as property,ve as render,fn as state,Re as undelegateEventListener,An as until,B as window}; | ||
`).replace(xn,(r,o)=>`${s}${o?o.slice(1,-1).replace(":defined","[:defined]"):""}`).replace(Cn,r=>(r=r.trim(),r[0]==="@"?r:r.split(",").map(o=>(o=o.trim(),o.indexOf(s)===0?o:`${s} ${o}`)).join(",")))};var Xt=At.bind(W),Wt=e=>{let t=[e];return t.raw=[e],Xt(t)};function Mn(e,...t){return typeof e=="string"?Wt(e):Xt(e,...t)}var Rt=e=>{let t=[];if(!e)return t;if(typeof e=="object"){for(let n in e)e[n]&&t.push(n);return t}return e.toString().trim().split(" ")},Bt=e=>{let t={};if(!e)return t;if(typeof e=="object"){for(let n in e){let i=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),s=e[n];s!=null&&(t[i]=s)}return t}return e.toString().split(";").reduce((n,i)=>{let s=i.split(":");return s.length>1&&(n[s.shift().trim()]=s.join(":").trim()),n},t)},jt=(e,t)=>(t==="checked"||t==="value")&&e.tagName==="INPUT",fe=(e,t,n)=>{e[t]=n},Ln=e=>e[0]==="o"&&e[1]==="n",ie=e=>e.children[e.currentIndex]||null,Le=e=>{let t=ie(e);return t&&(O(t)||te(t))||null},_t=(e,t)=>(e=e.fragment||e,e.oldKeys&&e.oldKeys.get(t)||null),Ut=(e,t)=>(e=e.fragment||e,e.oldKeyed?e.oldKeyed.has(t):null),qt=(e,t,n)=>{e=e.fragment||e,e.keys=e.keys||new Map,e.keys.set(n,t)},Y=(e,t,n,i,s,r,o)=>{if(r==null||r===!1)return 0;let u=typeof r=="object";if(u&&_(r)){let f=0;for(let x=0,y=r.length;x<y;x++)f+=Y(e,t,n,i,s,r[x],o);return f}let d,a,l,m=n.namespace;if(u&&Ue(r)){if(qe(r))return Y(e,t,n,i,s,r.children,o);if(St(r)){let{type:g,key:M,properties:R,children:p}=r,C=n.fragment,A,c;C?(A=C.start,c=O(A)||te(A)):M&&(A=_t(n,M))?c=k(A):M==null&&(c=Le(n))&&(A=ie(n))&&c.Function===g&&!Ut(n,A)||(A=T.createComment(g.name),c=k(A)),M!=null&&qt(n,A,M);let h=()=>n.children.indexOf(A)!==-1,P=!0,I=c.requestUpdate=()=>{if(c.requestUpdate!==I)return c.requestUpdate();if(P)throw new Error("An update request is already running");return h()?(pe(e,r,t,n,i,s,n.namespace,c),!0):!1};c.Function=g,c.start=A,c.store=c.store||new Map,n.fragment=void 0;let $=Y(e,t,n,i,s,[A,g({children:p,...R},c,I,h,c)],o);return n.fragment=C,c.end=n.children[n.currentIndex-1],P=!1,$}if(Ot(r)){let g=O(i);if(!g)return 0;let M=g.children,{properties:R,children:p}=r,C=R.name,c=Y(e,t,n,i,s,M,h=>{let P=te(h);return(!P||!P.hosts||P.hosts[0]===i)&&G(h)?C?h.getAttribute("slot")===C:!h.getAttribute("slot"):!C});return c||Y(e,t,n,i,s,p)}let{key:f,children:x,namespace:y}=r;m=y||n.namespace;let E,L,V=!1;f!=null?d=_t(n,f):(E=ie(n))&&(L=Le(n))&&G(E)&&!Ut(n,E)&&(!L.parents||L.parents[0]===s)&&(Me(r)&&E.constructor===r.type||Vt(r)&&E.tagName.toLowerCase()===r.type.toLowerCase())&&(d=E,a=L),d||(kt(r)?d=r.type:Me(r)?(d=new r.type,V=!0):(d=T.createElementNS(m,r.type),V=!0)),f!=null&&qt(n,d,f),a=a||O(d)||k(d),V&&(a.parents=[s]);let v=a.properties.get(s),K=r.properties;if(v)for(let g in v)g in K||(K[g]=void 0);a.properties.set(s,K);let b;for(b in K){let g=K[b],M=v&&v[b];if(M===g){jt(d,b)&&fe(d,b,g);continue}if(b==="style"){let c=d.style,h=Bt(M),P=Bt(g);for(let I in h)I in P||c.removeProperty(I);for(let I in P)c.setProperty(I,P[I]);continue}else if(b==="class"){let c=d.classList,h=Rt(g);if(M){let P=Rt(M);for(let I=0,$=P.length;I<$;I++){let $e=P[I];h.indexOf($e)===-1&&c.remove($e)}}for(let P=0,I=h.length;P<I;P++){let $=h[P];c.contains($)||c.add($)}continue}else if(Ln(b)&&!(b in d.constructor.prototype)){let c=b.substr(2);M&&d.removeEventListener(c,M),g&&d.addEventListener(c,g);continue}let R=typeof g,p=typeof M,C=g&&R==="object"||R==="function";if(C||(M&&p==="object"||p==="function")||jt(d,b))fe(d,b,g);else if(Me(r))if(R==="string"){let c=r.type.observedAttributes;if(!c||c.indexOf(b)===-1){let h=b in d&&He(d,b);(!h||!h.get||h.set)&&fe(d,b,g)}else{let h=q(d,b);h&&h.fromAttribute&&fe(d,b,h.fromAttribute.call(d,g))}}else fe(d,b,g);if(g==null||g===!1)d.hasAttribute(b)&&d.removeAttribute(b);else if(!C){let c=g===!0?"":g.toString();d.getAttribute(b)!==c&&d.setAttribute(b,c)}}l=x}else{if(u&&It(r))return Y(e,t,n,i,s,W((f,x)=>{let y=le(r);return y.pending&&r.catch(()=>1).then(()=>{x.requestUpdate()}),y.result},null),o);if(u&&Gt(r)){let f=r;return Y(e,t,n,i,s,W((x,y)=>{let E=Dt(f);if(!E.complete){let L=f.subscribe(()=>{y.requestUpdate()||L.unsubscribe()},()=>{y.requestUpdate()||L.unsubscribe()},()=>{L.unsubscribe()})}return E.current},null),o)}else if(u&&ye(r))d=r,a=a||O(d)||k(d);else{let f=O(i);typeof r=="string"&&f&&f.host&&e.tagName==="STYLE"&&(r=We(f.host,r,w.tagNames[f.host]),e.setAttribute("name",f.host));let x,y;(x=ie(n))&&(y=Le(n))&&Pe(x)&&(!y.parents||y.parents[0]===s)?(d=x,a=y,d.textContent!=r&&(d.textContent=r)):(d=T.createTextNode(r),a=k(d),a.parents=[s])}}if(!d||!a||o&&!o(d))return 0;if(n.children.indexOf(d)!==-1){let f;for(;(f=Le(n))&&a!==f;)T.removeChild(e,ie(n),t,!1);n.currentIndex++}else T.insertBefore(e,d,ie(n),t,!1),n.currentIndex++;return d&&a&&G(d)&&(l&&l.length||(!a.parents||a.parents[0]===s)&&a.children.length)&&(a.parents||(a.parents=[s]),pe(d,l,N(d),a,i,s,m)),1},pe=(e,t,n=N(e),i,s,r=i,o=e.namespaceURI||"http://www.w3.org/1999/xhtml",u)=>{let d=i.children,a=i.fragment,l=i.namespace,m=i.currentIndex;i.parents||(i.parents=[i]),i.namespace=o,i.fragment=u;let f;u?(i.currentIndex=i.children.indexOf(u.start),f=u.end,u.keys&&(u.oldKeys=u.keys,u.oldKeyed=new Set(u.keys.values())),delete u.keys):(i.currentIndex=0,i.keys&&(i.oldKeys=i.keys,i.oldKeyed=new Set(i.keys.values())),delete i.keys),Y(e,n,i,s,r,t);let x=i.currentIndex,y;for(f?y=d.indexOf(f)+1:y=d.length;x<y;)T.removeChild(e,d[--y],n,!1);return u?(delete u.oldKeys,delete u.oldKeyed,i.fragment=a,i.namespace=l):(delete i.oldKeys,delete i.oldKeyed,i.fragment=a,i.namespace=l,i.currentIndex=m),n&&e.forceUpdate(),d},ve=(e,t=T.createDocumentFragment(),n=!0)=>{let i=N(t),s=pe(t,e,n&&i,n&&i?O(t):k(t),t);return!_(e)&&!(e!=null&&Ue(e)&&qe(e))&&s.length<2?s[0]:s.slice(0)};var vn=(e,t)=>{let n=e.source,i=t.store;if(i.get("source")===n)return i.get("dom");let s=T.createElement("div");s.innerHTML=n,w.upgrade(s);let r=ee(s.childNodes);return i.set("source",n),i.set("dom",r),r},Ye=e=>W(vn,{source:e}),An=(e,t)=>{let n=le(e),i=e.then(()=>!1).catch(()=>!1),s=le(i);return s.result=n.pending&&t,i};var ze=Symbol(),zt=Symbol(),N=e=>!!e[ze],re=e=>!!e.prototype[ze],Jt=typeof F>"u",Hn=e=>{Jt=!0,e[zt]=!0},ne=()=>Jt,de=e=>!!e[zt],X=e=>{if(!G(e))return;de(e)&&e.connectedCallback();let t=ee(e.childNodes);for(let n=0,i=t.length;n<i;n++)X(t[n])},ue=e=>{if(!G(e))return;de(e)&&e.disconnectedCallback();let t=ee(e.childNodes);for(let n=0,i=t.length;n<i;n++)ue(t[n])};function Yt(e){if(!e.childNodes.length&&e.ownerDocument.readyState==="loading")return;let t=O(e),n=ee(e.childNodes);for(let i=0,s=n.length;i<s;i++){let r=n[i],o=k(r);T.removeChild(e,r,!1),o.hosts=[e],o.parents=[t]}return t.children=n,n}var Pn=e=>{let t=class extends e{constructor(...s){super();this.watchedProperties=[];let r=G(s[0])&&s[0],o=r?(ce(r,this),r):this,u=yt(o);o.parentNode&&(u.parents=[u]);let d=ae(o).map(l=>({...l,callback:l.callback.bind(o)}));je(o,d);for(let l=0,m=d.length;l<m;l++){let{event:f,target:x,selector:y,callback:E,options:L}=d[l];x||o.delegateEventListener(f,y,E,L)}let a=U(o);for(let l in a){delete o[l];let m=a[l];typeof m.initializer=="function"?o[l]=m.initializer.call(o):typeof m.defaultValue<"u"&&(o[l]=m.defaultValue),m.static&&o.watchedProperties.push(l)}return Yt(o),o.initialize(),o}static get observedAttributes(){let s=U(this.prototype),r=[];for(let o in s){let u=s[o];u&&u.attribute&&!u.state&&r.push(u.attribute)}return r}static upgrade(s){return new this(s)}get is(){}get isConnected(){return D.call(this)}get slotChildNodes(){return O(this).children}get textContent(){return super.textContent}set textContent(s){ve(s,this)}get innerHTML(){return super.innerHTML}set innerHTML(s){ve(Ye(s),this),w.upgrade(this)}initialize(){}connectedCallback(){me.call(this,":defined")||(this.is!==this.localName&&J.call(this,"is",this.is),J.call(this,":defined",""));let s=ae(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.addEventListener(u,a,l)}this.forceUpdate()}disconnectedCallback(){let s=ae(this);for(let r=0,o=s.length;r<o;r++){let{event:u,target:d,callback:a,options:l}=s[r];d&&d.removeEventListener(u,a,l)}}attributeChangedCallback(s,r,o){mt(this,s,o)}stateChangedCallback(s,r,o){Ve(this,s,o)}propertyChangedCallback(s,r,o){Ve(this,s,o)}getInnerPropertyValue(s){let r=q(this,s,!0);return this[r.symbol]}setInnerPropertyValue(s,r){let o=q(this,s,!0);this[o.symbol]=r}observe(s,r){oe(this,s,r)}unobserve(s,r){bt(this,s,r)}dispatchEvent(s,r,o,u,d){return Ce(this,s,r,o,u,d)}dispatchAsyncEvent(s,r,o,u,d){return Be(this,s,r,o,u,d)}delegateEventListener(s,r,o,u){Ke(this,s,r,o,u)}undelegateEventListener(s,r,o){Re(this,s,r,o)}render(){return this.slotChildNodes}forceUpdate(){(this.slotChildNodes||Yt(this))&&pe(this,this.render(),!1,k(this),this)}appendChild(s){return T.appendChild(this,s)}removeChild(s){return T.removeChild(this,s)}insertBefore(s,r){return T.insertBefore(this,s,r)}replaceChild(s,r){return T.replaceChild(this,s,r)}insertAdjacentElement(s,r){return T.insertAdjacentElement(this,s,r)}setAttribute(s,r){T.setAttribute(this,s,r)}removeAttribute(s){T.removeAttribute(this,s)}};return Z(t.prototype,ze,{get(){return!0}}),t},Sn=e=>{let t=function(...i){let s=this.constructor,r=this.is;if(!r)throw new TypeError("Illegal constructor");let o=w.tagNames[r],u;return w.native&&!s.shim&&(u=Reflect.construct(e,i,s),o===u.localName)||(u=be(o),ce(u,s.prototype),Hn(u)),u};return ce(t,e),t.apply=Function.apply,t.call=Function.call,t.prototype=e.prototype,t},$t=e=>Pn(Sn(e)),kn=$t(H),Ae=e=>class Qt extends e{constructor(...n){super(...n);let i=U(Qt.prototype);for(let s in i)this.watchedProperties.push(s)}},On=e=>{if(typeof e=="function")return Ae(e);let{kind:t,elements:n}=e;return{kind:t,elements:n,finisher(i){return Ae(i)}}},Vn=(e,t)=>n=>{if(typeof n=="function"){let r=Ae(n);return w.define(e,r,t),r}let{kind:i,elements:s}=n;return{kind:i,elements:s,finisher(r){let o=Ae(r);return w.define(e,o,t),o}}};var Zt=e=>!!e&&e.indexOf("-")>=1&&/[a-z\-\d]/.test(e)&&/^[^\d]/i.test(e),Xe=e=>e.prototype instanceof H,Je=class{constructor(){this.native=!!F;this.registry={};this.tagNames={};this.queue={};S.addEventListener("DOMContentLoaded",()=>{this.upgrade(S.body)})}get(t){let n=this.registry[t];return!n&&F&&Zt(t)&&(n=F.get(t)),n}define(t,n,i={}){if(!Zt(t))throw new SyntaxError("The provided name must be a valid Custom Element name");if(typeof n!="function")throw new TypeError("The referenced constructor must be a constructor");if(this.registry[t])throw new Error("The registry already contains an entry with the same name");re(n)&&(Oe(n.prototype),_e(n.prototype));try{Z(n.prototype,"is",{writable:!1,configurable:!1,value:t})}catch{throw new Error("The registry already contains an entry with the constructor (or is otherwise already defined)")}let s=(i.extends||t).toLowerCase();if(this.registry[t]=n,this.tagNames[t]=s,F){let r=n.shim;s!==t&&(n.shim=!0,i={get extends(){return n.shim=r,s}}),F.define(t,n,i)}else{let r=this.queue;S.body&&this.upgrade(S.body);let o=r[t];if(o)for(let u=0,d=o.length;u<d;u++)o[u](n)}}whenDefined(t){if(F)return F.whenDefined(t).then(()=>F.get(t));if(this.registry[t])return Promise.resolve(this.registry[t]);let n=this.queue;return new Promise(s=>{n[t]=n[t]||[],n[t].push(s)})}upgrade(t){let n=(t.getAttribute("is")||t.tagName).toLowerCase(),i=this.get(n),s=t.children;for(let r=0,o=s.length;r<o;r++){let u=s[r];u&&this.upgrade(u)}if(!!i){if(F&&"upgrade"in F&&F.upgrade(t),N(t)){t.forceUpdate();return}if(re(i)){let r=[],o=i.observedAttributes||[];for(let d=0,a=t.attributes.length;d<a;d++){let l=t.attributes[d];o.indexOf(l.name)!==-1&&r.push({name:l.name,value:l.value})}let u=i.upgrade(t);for(let d=0,a=r.length;d<a;d++){let{name:l,value:m}=r[d];u.getAttribute(l)===m?u.attributeChangedCallback(l,null,m):u.setAttribute(l,m)}D.call(u)&&X(u),u.forceUpdate()}}}},w=new Je;export{kn as Component,et as CustomEvent,T as DOM,Ze as Event,Pt as Fragment,H as HTMLElement,j as Node,Wt as compile,X as connect,We as css,Vn as customElement,On as customElementPrototype,w as customElements,_e as defineListeners,Oe as defineProperties,he as defineProperty,Ke as delegateEventListener,ue as disconnect,Be as dispatchAsyncEvent,Ce as dispatchEvent,S as document,$t as extend,U as getProperties,q as getProperty,W as h,Mn as html,N as isComponent,re as isComponentConstructor,Nt as jsx,hn as jsxs,yn as listen,pn as observe,Ye as parseDOM,ln as property,ve as render,fn as state,Re as undelegateEventListener,An as until,B as window}; | ||
//# sourceMappingURL=dna.js.map |
{ | ||
"name": "@chialab/dna", | ||
"version": "3.21.2", | ||
"version": "3.21.3", | ||
"description": "Progressive Web Components", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1030659