@ionic/lab
Version:
Ionic Lab utility for developing Ionic apps, used by Ionic CLI
1 lines • 9.03 kB
JavaScript
let t=0,e=!1,n=!1;const l="undefined"!=typeof window?window:{},o=l.CSS,s=l.document||{head:{}},r={t:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l)},c=t=>Promise.resolve(t),i=(()=>{try{return new CSSStyleSheet,!0}catch(t){}return!1})(),a=new WeakMap,u=t=>a.get(t),f=(t,e)=>a.set(e.o=t,e),p=(t,e)=>e in t,m=t=>console.error(t),w=new Map,d=new Map,$=[],h=[],y=[],b=(t,n)=>l=>{t.push(l),e||(e=!0,n&&4&r.t?_(v):r.raf(v))},g=(t,e)=>{let n=0,l=0;for(;n<t.length&&(l=performance.now())<e;)try{t[n++](l)}catch(o){m(o)}n===t.length?t.length=0:0!==n&&t.splice(0,n)},v=()=>{t++,(t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){m(e)}t.length=0})($);const n=2==(6&r.t)?performance.now()+10*Math.ceil(t*(1/22)):1/0;g(h,n),g(y,n),h.length>0&&(y.push(...h),h.length=0),(e=$.length+h.length+y.length>0)?r.raf(v):t=0},_=t=>c().then(t),j=b(h,!0),S={},M=t=>"object"==(t=typeof t)||"function"===t,O=()=>o&&o.supports&&o.supports("color","var(--c)")?c():__sc_import_app("./p-1826e5f0.js").then(()=>(r.s=l.__cssshim)?(!1).i():0),L=()=>{r.s=l.__cssshim;const t=Array.from(s.querySelectorAll("script")).find(t=>new RegExp("/app(\\.esm)?\\.js($|\\?|#)").test(t.src)||"app"===t.getAttribute("data-stencil-namespace")),e={};return"onbeforeload"in t&&!history.scrollRestoration?{then(){}}:(e.resourcesUrl=new URL(".",new URL(t.getAttribute("data-resources-url")||t.src,l.location.href)).href,U(e.resourcesUrl,t),l.customElements?c(e):__sc_import_app("./p-3b66a627.js").then(()=>e))},U=(t,e)=>{const n=`__sc_import_${"app".replace(/\s|-/g,"_")}`;try{l[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(o){const r=new Map;l[n]=o=>{const c=new URL(o,t).href;let i=r.get(c);if(!i){const t=s.createElement("script");t.type="module",t.crossOrigin=e.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${c}'; window.${n}.m = m;`],{type:"application/javascript"})),i=new Promise(e=>{t.onload=()=>{e(l[n].m),t.remove()}}),r.set(c,i),s.head.appendChild(t)}return i}}},R=new WeakMap,k=t=>"sc-"+t,x=(t,e,...n)=>{let l=null,o=!1,s=!1,r=[];const c=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!M(l))&&(l=String(l)),o&&s?r[r.length-1].u+=l:r.push(o?C(null,l):l),s=o)};if(c(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter(e=>t[e]).join(" "))}const i=C(t,null);return i.p=e,r.length>0&&(i.$=r),i},C=(t,e)=>({t:0,h:t,u:e,g:null,$:null,p:null}),P={},E=(t,e,n,o,s,c)=>{if(n!==o){let a=p(t,e),u=e.toLowerCase();if("class"===e){const e=t.classList,l=A(n),s=A(o);e.remove(...l.filter(t=>t&&!s.includes(t))),e.add(...s.filter(t=>t&&!l.includes(t)))}else if(a||"o"!==e[0]||"n"!==e[1]){const l=M(o);if((a||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]=o;else{let l=null==o?"":o;"list"===e?a=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(i){}null==o||!1===o?t.removeAttribute(e):(!a||4&c||s)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else e="-"===e[2]?e.slice(3):p(l,u)?u.slice(2):u[2]+e.slice(3),n&&r.rel(t,e,n,!1),o&&r.ael(t,e,o,!1)}},W=/\s/,A=t=>t?t.split(W):[],T=(t,e,n,l)=>{const o=11===e.g.nodeType&&e.g.host?e.g.host:e.g,s=t&&t.p||S,r=e.p||S;for(l in s)l in r||E(o,l,s[l],void 0,n,e.t);for(l in r)E(o,l,s[l],r[l],n,e.t)},F=(t,e,l)=>{let o,r,c=e.$[l],i=0;if(null!==c.u)o=c.g=s.createTextNode(c.u);else{if(n||(n="svg"===c.h),o=c.g=s.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.h),n&&"foreignObject"===c.h&&(n=!1),T(null,c,n),c.$)for(i=0;i<c.$.length;++i)r=F(t,c,i),r&&o.appendChild(r);"svg"===c.h?n=!1:"foreignObject"===o.tagName&&(n=!0)}return o},H=(t,e,n,l,o,s)=>{let r,c=t;for(;o<=s;++o)l[o]&&(r=F(null,n,o),r&&(l[o].g=r,c.insertBefore(r,e)))},q=(t,e,n,l)=>{for(;e<=n;++e)(l=t[e])&&l.g.remove()},B=(t,e)=>t.h===e.h,D=(t,e)=>{const l=e.g=t.g,o=t.$,s=e.$,r=e.h,c=e.u;null===c?(n="svg"===r||"foreignObject"!==r&&n,T(t,e,n),null!==o&&null!==s?((t,e,n,l)=>{let o,s=0,r=0,c=e.length-1,i=e[0],a=e[c],u=l.length-1,f=l[0],p=l[u];for(;s<=c&&r<=u;)null==i?i=e[++s]:null==a?a=e[--c]:null==f?f=l[++r]:null==p?p=l[--u]:B(i,f)?(D(i,f),i=e[++s],f=l[++r]):B(a,p)?(D(a,p),a=e[--c],p=l[--u]):B(i,p)?(D(i,p),t.insertBefore(i.g,a.g.nextSibling),i=e[++s],p=l[--u]):B(a,f)?(D(a,f),t.insertBefore(a.g,i.g),a=e[--c],f=l[++r]):(o=F(e&&e[r],n,r),f=l[++r],o&&i.g.parentNode.insertBefore(o,i.g));s>c?H(t,null==l[u+1]?null:l[u+1].g,n,l,r,u):r>u&&q(e,s,c)})(l,o,e,s):null!==s?(null!==t.u&&(l.textContent=""),H(l,null,e,s,0,s.length-1)):null!==o&&q(o,0,o.length-1),n&&"svg"===r&&(n=!1)):t.u!==c&&(l.data=c)},N=(t,e)=>{e&&!t.v&&e["s-p"].push(new Promise(e=>t.v=e))},V=(t,e,n,l)=>{if(e.t|=16,4&e.t)return void(e.t|=512);const o=e.o,s=()=>z(t,e,n,o,l);let r;return N(e,e._),l?(e.t|=256,e.j&&(e.j.forEach(([t,e])=>K(o,t,e)),e.j=null),r=K(o,"componentWillLoad")):r=K(o,"componentWillUpdate"),Q(r,()=>j(s))},z=(t,e,n,l,o)=>{const r=t["s-rc"];o&&((t,e)=>{((t,e)=>{let n=k(e.S),l=d.get(n);if(t=11===t.nodeType?t:s,l)if("string"==typeof l){let e,o=R.get(t=t.head||t);o||R.set(t,o=new Set),o.has(n)||(e=s.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l])})(t.getRootNode(),e)})(t,n),((t,e,n,l)=>{const o=e.M||C(null,null),s=(r=l)&&r.h===P?l:x(null,null,l);var r;s.h=null,s.t|=4,e.M=s,s.g=o.g=t,D(o,s)})(t,e,0,G(l)),e.t&=-17,e.t|=2,r&&(r.forEach(t=>t()),t["s-rc"]=void 0);{const l=t["s-p"],o=()=>I(t,e,n);0===l.length?o():(Promise.all(l).then(o),e.t|=4,l.length=0)}},G=t=>{try{t=t.render()}catch(e){m(e)}return t},I=(t,e,n)=>{const l=e.o,o=e._;64&e.t||(e.t|=64,X(t),K(l,"componentDidLoad"),e.O(t),o||J()),e.v&&(e.v(),e.v=void 0),512&e.t&&_(()=>V(t,e,n,!1)),e.t&=-517},J=()=>{X(s.documentElement),r.t|=2},K=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(l){m(l)}},Q=(t,e)=>t&&t.then?t.then(e):e(),X=t=>t.classList.add("hydrated"),Y=(t,e,n)=>{if(e.L){const l=Object.entries(e.L),o=t.prototype;if(l.forEach(([t,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,t,{get(){return e=t,u(this).U.get(e);var e},set(n){((t,e,n,l)=>{const o=u(this),s=o.R,r=o.U.get(e),c=o.t,i=o.o;var a,f;f=l.L[e][0],(n=null==(a=n)||M(a)?a:4&f?"false"!==a&&(""===a||!!a):1&f?String(a):a)===r||8&c&&void 0!==r||(o.U.set(e,n),i&&2==(18&c)&&V(s,o,l,!1))})(0,t,n,e)},configurable:!0,enumerable:!0})}),1&n){const e=new Map;o.attributeChangedCallback=function(t,n,l){r.jmp(()=>{const n=e.get(t);this[n]=(null!==l||"boolean"!=typeof this[n])&&l})},t.observedAttributes=l.filter(([t,e])=>15&e[0]).map(([t,n])=>{const l=n[1]||t;return e.set(l,t),l})}}return t},Z=(t,e={})=>{const n=[],o=e.exclude||[],c=l.customElements,f=s.head,p=f.querySelector("meta[charset]"),$=s.createElement("style"),h=[];let y,b=!0;Object.assign(r,e),r.l=new URL(e.resourcesUrl||"./",s.baseURI).href,e.syncQueue&&(r.t|=4),t.forEach(t=>t[1].forEach(e=>{const l={t:e[0],S:e[1],L:e[2],k:e[3]};l.L=e[2],l.k=e[3];const s=l.S,f=class extends HTMLElement{constructor(t){super(t),(t=>{const e={t:0,R:t,U:new Map};e.C=new Promise(t=>e.O=t),t["s-p"]=[],t["s-rc"]=[],a.set(t,e)})(t=this)}connectedCallback(){y&&(clearTimeout(y),y=null),b?h.push(this):r.jmp(()=>((t,e)=>{if(0==(1&r.t)){const n=()=>{},l=u(t);if(e.k&&(l.P=((t,e,n)=>{e.j=e.j||[];const l=n.map(([n,l,o])=>{const s=t,c=((t,e)=>n=>{256&t.t?t.o[e](n):t.j.push([e,n])})(e,o),i=(t=>0!=(2&t))(n);return r.ael(s,l,c,i),()=>r.rel(s,l,c,i)});return()=>l.forEach(t=>t())})(t,l,e.k)),!(1&l.t)){l.t|=1;{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){N(l,l._=e);break}}e.L&&Object.entries(e.L).forEach(([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}}),_(()=>(async(t,e,n,l,o)=>{if(0==(32&e.t)){e.t|=32;{if((o=(t=>{const e=t.S.replace(/-/g,"_"),n=t.W,l=w.get(n);return l?l[e]:__sc_import_app(`./${n}.entry.js`).then(t=>(w.set(n,t),t[e]),m)})(n)).then){const t=()=>{};o=await o,t()}o.isProxied||(Y(o,n,2),o.isProxied=!0);const t=()=>{};e.t|=8;try{new o(e)}catch(c){m(c)}e.t&=-9,t()}const t=k(n.S);if(!d.has(t)&&o.style){const e=()=>{};((t,e,n)=>{let l=d.get(t);i&&n?(l=l||new CSSStyleSheet,l.replace(e)):l=e,d.set(t,l)})(t,o.style,!!(1&n.t)),e()}}const s=e._,r=()=>V(t,e,n,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(t,l,e))}n()}})(this,l))}disconnectedCallback(){r.jmp(()=>(()=>{if(0==(1&r.t)){const t=u(this);t.P&&(t.P(),t.P=void 0)}})())}forceUpdate(){((t,e)=>{{const n=u(t);n.R.isConnected&&2==(18&n.t)&&V(t,n,e,!1)}})(this,l)}componentOnReady(){return u(this).C}};l.W=t[0],o.includes(s)||c.get(s)||(n.push(s),c.define(s,Y(f,l,1)))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),f.insertBefore($,p?p.nextSibling:f.firstChild),b=!1,h.length>0?h.forEach(t=>t.connectedCallback()):r.jmp(()=>y=setTimeout(J,30))},tt=(t,e,n)=>{const l=et(t);return{emit:t=>{const o=new CustomEvent(e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t});return l.dispatchEvent(o),o}}},et=t=>u(t).R;export{P as H,O as a,Z as b,tt as c,x as h,L as p,f as r};