UNPKG

@huluvu424242/honey-papercss-style

Version:
1 lines 4.31 kB
let e=!1;const t="undefined"!=typeof window?window:{},n=t.document||{head:{}},l={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},s=e=>Promise.resolve(e),o={},r=e=>"object"==(e=typeof e)||"function"===e,c=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!r(l))&&(l+=""),s&&o?c[c.length-1].o+=l:c.push(s?a(null,l):l),o=s)};i(n);const u=a(e,null);return u.i=t,c.length>0&&(u.u=c),u},a=(e,t)=>({t:0,$:e,o:t,m:null,u:null,i:null}),i={},u=(e,t,n,l,s,o)=>{if(n!==l){let c=T(e,t);t.toLowerCase();{const a=r(l);if((c||a&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&o||s)&&!a&&e.setAttribute(t,l=!0===l?"":l)}}},$=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,r=e&&e.i||o,c=t.i||o;for(l in c)u(s,l,r[l],c[l],n,t.t)},f=(e,t,l)=>{let s,o,r=t.u[l],c=0;if(s=r.m=n.createElement(r.$),$(null,r,!1),r.u)for(c=0;c<r.u.length;++c)o=f(e,r,c),o&&s.appendChild(o);return s},d=(e,t)=>{const n=e.p,l=e.h||a(null,null),s=(e=>e&&e.$===i)(t)?t:c(null,null,t);s.$=null,s.t|=4,e.h=s,s.m=l.m=n,((e,t)=>{const n=t.m=e.m,l=t.u;$(e,t,!1),null!==l&&((e,t,n,l,s,o)=>{let r,c=e;for(;s<=o;++s)l[s]&&(r=f(null,n,s),r&&(l[s].m=r,c.insertBefore(r,null)))})(n,0,t,l,0,l.length-1)})(l,s)},m=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.g=t)))},y=e=>{if(!(4&e.t))return m(e,e.k),_((()=>p(e)));e.t|=512},p=e=>{const t=e.v;return v(void 0,(()=>h(e,t)))},h=async(e,t)=>{const n=e.p,l=n["s-rc"];w(e,t),l&&(l.map((e=>e())),n["s-rc"]=void 0);{const t=n["s-p"],l=()=>b(e);0===t.length?l():(Promise.all(t).then(l),e.t|=4,t.length=0)}},w=(e,t)=>{try{t=t.render(),e.t|=2,d(e,t)}catch(t){U(t,e.p)}return null},b=e=>{const t=e.p,n=e.k;64&e.t||(e.t|=64,C(t),e.C(t),n||g()),e.g&&(e.g(),e.g=void 0),512&e.t&&W((()=>y(e))),e.t&=-517},g=()=>{C(n.documentElement),W((()=>(e=>{const t=l.ce("appload",{detail:{namespace:"honey-papercss-style"}});return e.dispatchEvent(t),t})(t)))},k=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){U(e)}},v=(e,t)=>e&&e.then?e.then(t):t(),C=e=>e.classList.add("hydrated"),M=e=>{k(e,"connectedCallback")},j=(e,s={})=>{const o=[],r=s.exclude||[],c=t.customElements,a=n.head,i=a.querySelector("meta[charset]"),u=n.createElement("style"),$=[];let f,d=!0;Object.assign(l,s),l.l=new URL(s.resourcesUrl||"./",n.baseURI).href,e.map((e=>e[1].map((t=>{const n={t:t[0],M:t[1],j:t[2],P:t[3]},s=n.M,a=class extends HTMLElement{constructor(e){super(e),R(e=this,n)}connectedCallback(){f&&(clearTimeout(f),f=null),d?$.push(this):l.jmp((()=>(e=>{if(0==(1&l.t)){const t=E(e),n=t.L,l=()=>{};if(1&t.t)M(t.v);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){m(t,t.k=n);break}}(async(e,t,n,l,s)=>{if(0==(32&t.t)){if(t.t|=32,(s=O(n)).then){const e=()=>{};s=await s,e()}const e=()=>{};try{new s(t)}catch(e){U(e)}e(),M(t.v)}const o=t.k,r=()=>y(t);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){l.jmp((()=>(()=>{0==(1&l.t)&&k(E(this).v,"disconnectedCallback")})()))}componentOnReady(){return E(this).R}};n.T=e[0],r.includes(s)||c.get(s)||(o.push(s),c.define(s,a))})))),u.innerHTML=o+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles",""),a.insertBefore(u,i?i.nextSibling:a.firstChild),d=!1,$.length?$.map((e=>e.connectedCallback())):l.jmp((()=>f=setTimeout(g,30)))},P=e=>{const n=new URL(e,l.l);return n.origin!==t.location.origin?n.href:n.pathname},x=new WeakMap,E=e=>x.get(e),L=(e,t)=>x.set(t.v=e,t),R=(e,t)=>{const n={t:0,p:e,L:t,U:new Map};return n.R=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],x.set(e,n)},T=(e,t)=>t in e,U=(e,t)=>(0,console.error)(e,t),A=new Map,O=e=>{const t=e.M.replace(/-/g,"_"),n=e.T,l=A.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(A.set(n,e),e[t])),U)},q=[],F=[],H=(t,n)=>s=>{t.push(s),e||(e=!0,n&&4&l.t?W(V):l.raf(V))},N=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){U(e)}e.length=0},V=()=>{N(q),N(F),(e=q.length>0)&&l.raf(V)},W=e=>s().then(e),_=H(F,!0);export{j as b,P as g,c as h,s as p,L as r}