UNPKG

stencil-quantum

Version:

Experience the quantum realm of stencil.

1 lines 8.59 kB
let t,e,l=!1,n=!1,o=!1,s=!1;const r="undefined"!=typeof window?window:{},c=r.document||{head:{}},i={t:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,l,n)=>t.addEventListener(e,l,n),rel:(t,e,l,n)=>t.removeEventListener(e,l,n),ce:(t,e)=>new CustomEvent(t,e)},a=t=>Promise.resolve(t),u={},f=t=>"object"==(t=typeof t)||"function"===t,$=(t,e,...l)=>{let n=null,o=null,s=!1,r=!1,c=[];const i=e=>{for(let l=0;l<e.length;l++)n=e[l],Array.isArray(n)?i(n):null!=n&&"boolean"!=typeof n&&((s="function"!=typeof t&&!f(n))&&(n+=""),s&&r?c[c.length-1].o+=n:c.push(s?d(null,n):n),r=s)};i(l),e&&e.name&&(o=e.name);const a=d(t,null);return a.i=e,c.length>0&&(a.u=c),a.$=o,a},d=(t,e)=>({t:0,m:t,o:e,h:null,u:null,i:null,$:null}),m={},b=(t,e,l,n,o,s)=>{if(l!==n){let r=S(t,e);e.toLowerCase();{const c=f(n);if((r||c&&null!==n)&&!o)try{if(t.tagName.includes("-"))t[e]=n;else{let o=null==n?"":n;"list"===e?r=!1:null!=l&&t[e]==o||(t[e]=o)}}catch(t){}null==n||!1===n?!1===n&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||o)&&!c&&t.setAttribute(e,n=!0===n?"":n)}}},h=(t,e,l,n)=>{const o=11===e.h.nodeType&&e.h.host?e.h.host:e.h,s=t&&t.i||u,r=e.i||u;for(n in s)n in r||b(o,n,s[n],void 0,l,e.t);for(n in r)b(o,n,s[n],r[n],l,e.t)},p=(n,s,r)=>{let i,a,u,f=s.u[r],$=0;if(l||(o=!0,"slot"===f.m&&(f.t|=f.u?2:1)),1&f.t)i=f.h=c.createTextNode("");else if(i=f.h=c.createElement(2&f.t?"slot-fb":f.m),h(null,f,!1),f.u)for($=0;$<f.u.length;++$)a=p(n,f,$),a&&i.appendChild(a);return i["s-hn"]=e,3&f.t&&(i["s-sr"]=!0,i["s-cr"]=t,i["s-sn"]=f.$||"",u=n&&n.u&&n.u[r],u&&u.m===f.m&&n.h&&y(n.h,!1)),i},y=(t,l)=>{i.t|=1;const n=t.childNodes;for(let t=n.length-1;t>=0;t--){const s=n[t];s["s-hn"]!==e&&s["s-ol"]&&(k(s).insertBefore(s,j(s)),s["s-ol"].remove(),s["s-ol"]=void 0,o=!0),l&&y(s,l)}i.t&=-2},w=(t,e,l,n,o,s)=>{let r,c=t["s-cr"]&&t["s-cr"].parentNode||t;for(;o<=s;++o)n[o]&&(r=p(null,l,o),r&&(n[o].h=r,c.insertBefore(r,j(e))))},g=(t,e,l,o,s)=>{for(;e<=l;++e)(o=t[e])&&(n=!0,(s=o.h)["s-ol"]?s["s-ol"].remove():y(s,!0),s.remove())},v=(t,e)=>t.m===e.m&&("slot"!==t.m||t.$===e.$),j=t=>t&&t["s-ol"]||t,k=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,M=(t,e)=>{const l=e.h=t.h,n=t.u,o=e.u;"slot"===e.m||h(t,e,!1),null!==n&&null!==o?((t,e,l,n)=>{let o,s=0,r=0,c=e.length-1,i=e[0],a=e[c],u=n.length-1,f=n[0],$=n[u];for(;s<=c&&r<=u;)null==i?i=e[++s]:null==a?a=e[--c]:null==f?f=n[++r]:null==$?$=n[--u]:v(i,f)?(M(i,f),i=e[++s],f=n[++r]):v(a,$)?(M(a,$),a=e[--c],$=n[--u]):v(i,$)?("slot"!==i.m&&"slot"!==$.m||y(i.h.parentNode,!1),M(i,$),t.insertBefore(i.h,a.h.nextSibling),i=e[++s],$=n[--u]):v(a,f)?("slot"!==i.m&&"slot"!==$.m||y(a.h.parentNode,!1),M(a,f),t.insertBefore(a.h,i.h),a=e[--c],f=n[++r]):(o=p(e&&e[r],l,r),f=n[++r],o&&k(i.h).insertBefore(o,j(i.h)));s>c?w(t,null==n[u+1]?null:n[u+1].h,l,n,r,u):r>u&&g(e,s,c)})(l,n,e,o):null!==o?w(l,null,e,o,0,o.length-1):null!==n&&g(n,0,n.length-1)},O=t=>{let e,l,n,o,s,r,c=t.childNodes;for(l=0,n=c.length;l<n;l++)if(e=c[l],1===e.nodeType){if(e["s-sr"])for(s=e["s-sn"],e.hidden=!1,o=0;o<n;o++)if(c[o]["s-hn"]!==e["s-hn"])if(r=c[o].nodeType,""!==s){if(1===r&&s===c[o].getAttribute("slot")){e.hidden=!0;break}}else if(1===r||3===r&&""!==c[o].textContent.trim()){e.hidden=!0;break}O(e)}},R=[],T=t=>{let e,l,o,s,r,c,i=0,a=t.childNodes,u=a.length;for(;i<u;i++){if(e=a[i],e["s-sr"]&&(l=e["s-cr"]))for(o=l.parentNode.childNodes,s=e["s-sn"],c=o.length-1;c>=0;c--)l=o[c],l["s-cn"]||l["s-nr"]||l["s-hn"]===e["s-hn"]||(P(l,s)?(r=R.find((t=>t.p===l)),n=!0,l["s-sn"]=l["s-sn"]||s,r?r.g=e:R.push({g:e,p:l}),l["s-sr"]&&R.map((t=>{P(t.p,l["s-sn"])&&(r=R.find((t=>t.p===l)),r&&!t.g&&(t.g=r.g))}))):R.some((t=>t.p===l))||R.push({p:l}));1===e.nodeType&&T(e)}},P=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,x=t=>J(t).v,C=(t,e,l)=>{const n=x(t);return{emit:t=>E(n,e,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:t})}},E=(t,e,l)=>{const n=i.ce(e,l);return t.dispatchEvent(n),n},L=(t,e)=>{e&&!t.j&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.j=e)))},q=(t,e)=>{if(t.t|=16,!(4&t.t))return L(t,t.k),rt((()=>A(t,e)));t.t|=512},A=(t,e)=>{const l=t.M;let n;return e&&(n=V(l,"componentWillLoad")),_(n,(()=>H(t,l)))},H=async(s,r)=>{const a=s.v,u=a["s-rc"];((s,r)=>{const a=s.v,u=s.O,f=s.R||d(null,null),b=(t=>t&&t.m===m)(r)?r:$(null,null,r);if(e=a.tagName,u.T&&(b.i=b.i||{},u.T.map((([t,e])=>b.i[e]=a[t]))),b.m=null,b.t|=4,s.R=b,b.h=f.h=a,t=a["s-cr"],l=0!=(1&u.t),n=!1,M(f,b),i.t|=1,o){let t,e,l,n,o,s;T(b.h);let r=0;for(;r<R.length;r++)t=R[r],e=t.p,e["s-ol"]||(l=c.createTextNode(""),l["s-nr"]=e,e.parentNode.insertBefore(e["s-ol"]=l,e));for(r=0;r<R.length;r++)if(t=R[r],e=t.p,t.g){for(n=t.g.parentNode,o=t.g.nextSibling,l=e["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===e["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==e.parentNode||e.nextSibling!==o)&&e!==o&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),n.insertBefore(e,o))}else 1===e.nodeType&&(e.hidden=!0)}n&&O(b.h),i.t&=-2,R.length=0})(s,N(s,r)),u&&(u.map((t=>t())),a["s-rc"]=void 0);{const t=a["s-p"],e=()=>U(s);0===t.length?e():(Promise.all(t).then(e),s.t|=4,t.length=0)}},N=(t,e)=>{try{e=e.render(),t.t&=-17,t.t|=2}catch(e){X(e,t.v)}return e},U=t=>{const e=t.v,l=t.k;64&t.t||(t.t|=64,z(e),t.P(e),l||F()),t.j&&(t.j(),t.j=void 0),512&t.t&&st((()=>q(t,!1))),t.t&=-517},W=t=>{{const e=J(t),l=e.v.isConnected;return l&&2==(18&e.t)&&q(e,!1),l}},F=()=>{z(c.documentElement),st((()=>E(r,"appload",{detail:{namespace:"stencil-quantum"}})))},V=(t,e,l)=>{if(t&&t[e])try{return t[e](l)}catch(t){X(t)}},_=(t,e)=>t&&t.then?t.then(e):e(),z=t=>t.classList.add("hydrated"),B=(t,e,l)=>{if(e.C){t.watchers&&(e.L=t.watchers);const n=Object.entries(e.C),o=t.prototype;if(n.map((([t,[n]])=>{(31&n||2&l&&32&n)&&Object.defineProperty(o,t,{get(){return((t,e)=>J(this).q.get(e))(0,t)},set(l){((t,e,l,n)=>{const o=J(t),s=o.v,r=o.q.get(e),c=o.t,i=o.M;if(l=((t,e)=>null==t||f(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t)(l,n.C[e][0]),!(8&c&&void 0!==r||l===r)&&(o.q.set(e,l),i)){if(n.L&&128&c){const t=n.L[e];t&&t.map((t=>{try{i[t](l,r,e)}catch(t){X(t,s)}}))}2==(18&c)&&q(o,!1)}})(this,t,l,e)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;o.attributeChangedCallback=function(t,e,n){i.jmp((()=>{const e=l.get(t);this[e]=(null!==n||"boolean"!=typeof this[e])&&n}))},t.observedAttributes=n.filter((([t,e])=>15&e[0])).map((([t,n])=>{const o=n[1]||t;return l.set(o,t),512&n[0]&&e.T.push([t,o]),o}))}}return t},D=t=>{const e=t["s-cr"]=c.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},G=(t,e={})=>{const l=[],n=e.exclude||[],o=r.customElements,s=c.head,a=s.querySelector("meta[charset]"),u=c.createElement("style"),f=[];let $,d=!0;Object.assign(i,e),i.l=new URL(e.resourcesUrl||"./",c.baseURI).href,t.map((t=>t[1].map((e=>{const s={t:e[0],A:e[1],C:e[2],H:e[3]};s.C=e[2],s.T=[],s.L={};const r=s.A,c=class extends HTMLElement{constructor(t){super(t),Q(t=this,s)}connectedCallback(){$&&(clearTimeout($),$=null),d?f.push(this):i.jmp((()=>(t=>{if(0==(1&i.t)){const e=J(t),l=e.O,n=()=>{};if(!(1&e.t)){e.t|=1,12&l.t&&D(t);{let l=t;for(;l=l.parentNode||l.host;)if(l["s-p"]){L(e,e.k=l);break}}l.C&&Object.entries(l.C).map((([e,[l]])=>{if(31&l&&t.hasOwnProperty(e)){const l=t[e];delete t[e],t[e]=l}})),(async(t,e,l,n,o)=>{if(0==(32&e.t)){if(e.t|=32,(o=Z(l)).then){const t=()=>{};o=await o,t()}o.isProxied||(l.L=o.watchers,B(o,l,2),o.isProxied=!0);const t=()=>{};e.t|=8;try{new o(e)}catch(t){X(t)}e.t&=-9,e.t|=128,t()}const s=e.k,r=()=>q(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,e,l)}n()}})(this)))}disconnectedCallback(){i.jmp((()=>{}))}componentOnReady(){return J(this).N}};s.U=t[0],n.includes(r)||o.get(r)||(l.push(r),o.define(r,B(c,s,1)))})))),u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles",""),s.insertBefore(u,a?a.nextSibling:s.firstChild),d=!1,f.length?f.map((t=>t.connectedCallback())):i.jmp((()=>$=setTimeout(F,30)))},I=new WeakMap,J=t=>I.get(t),K=(t,e)=>I.set(e.M=t,e),Q=(t,e)=>{const l={t:0,v:t,O:e,q:new Map};return l.N=new Promise((t=>l.P=t)),t["s-p"]=[],t["s-rc"]=[],I.set(t,l)},S=(t,e)=>e in t,X=(t,e)=>(0,console.error)(t,e),Y=new Map,Z=t=>{const e=t.A.replace(/-/g,"_"),l=t.U,n=Y.get(l);return n?n[e]:import(`./${l}.entry.js`).then((t=>(Y.set(l,t),t[e])),X)},tt=[],et=[],lt=(t,e)=>l=>{t.push(l),s||(s=!0,e&&4&i.t?st(ot):i.raf(ot))},nt=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){X(t)}t.length=0},ot=()=>{nt(tt),nt(et),(s=tt.length>0)&&i.raf(ot)},st=t=>a().then(t),rt=lt(et,!0);export{m as H,G as b,C as c,W as f,x as g,$ as h,a as p,K as r}