@progracol/bingo-board-component
Version:
Componente cartón de bingo
1 lines • 9.01 kB
JavaScript
let e,t,n=0,o=!1;const s=window,l=document,r={t:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o)},i=(()=>!!l.documentElement.attachShadow)(),c=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),a=new WeakMap,f=e=>a.get(e),u=(e,t)=>a.set(t.s=e,t),d=(e,t)=>t in e,p=e=>console.error(e),m=new Map,$=new Map,h=[],b=[],w=[],y=(e,t)=>n=>{e.push(n),o||(o=!0,t&&4&r.t?j(_):r.raf(_))},g=(e,t)=>{let n=0,o=0;for(;n<e.length&&(o=performance.now())<t;)try{e[n++](o)}catch(s){p(s)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},_=()=>{n++,(e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(t){p(t)}e.length=0})(h);const e=2==(6&r.t)?performance.now()+10*Math.ceil(n*(1/22)):1/0;g(b,e),g(w,e),b.length>0&&(w.push(...b),b.length=0),(o=h.length+b.length+w.length>0)?r.raf(_):n=0},j=e=>Promise.resolve().then(e),v=y(b,!0),S={},M=e=>null!=e,U=e=>"object"==(e=typeof e)||"function"===e,O=()=>s.CSS&&s.CSS.supports&&s.CSS.supports("color","var(--c)")?Promise.resolve():__sc_import_bingoboard("./p-1635c1a0.js").then(()=>{r.l=s.__stencil_cssshim}),k=async()=>{r.l=s.__stencil_cssshim;const e=new RegExp("/bingoboard(\\.esm)?\\.js($|\\?|#)"),t=Array.from(l.querySelectorAll("script")).find(t=>e.test(t.src)||"bingoboard"===t.getAttribute("data-stencil-namespace")),n=t["data-opts"];{const e=new URL(".",new URL(t.getAttribute("data-resources-url")||t.src,s.location.href));return L(e.href),window.customElements||await __sc_import_bingoboard("./p-d0882b30.js"),Object.assign(Object.assign({},n),{resourcesUrl:e.href})}},L=e=>{const t=(()=>`__sc_import_${"bingoboard".replace(/\s|-/g,"_")}`)();try{s[t]=new Function("w",`return import(w);//${Math.random()}`)}catch(n){const o=new Map;s[t]=n=>{const r=new URL(n,e).href;let i=o.get(r);if(!i){const e=l.createElement("script");e.type="module",e.src=URL.createObjectURL(new Blob([`import * as m from '${r}'; window.${t}.m = m;`],{type:"application/javascript"})),i=new Promise(n=>{e.onload=()=>{n(s[t].m),e.remove()}}),o.set(r,i),l.head.appendChild(e)}return i}}},R=new WeakMap,x=e=>"sc-"+e,C=(e,t,...n)=>{let o,s=null,l=!1,r=!1,i=[];const c=t=>{for(let n=0;n<t.length;n++)s=t[n],Array.isArray(s)?c(s):null!=s&&"boolean"!=typeof s&&((l="function"!=typeof e&&!U(s))&&(s=String(s)),l&&r?i[i.length-1].i+=s:i.push(l?{t:0,i:s}:s),r=l)};if(c(n),t){o=t.key||void 0;{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter(t=>e[t]).join(" "))}}const a={t:0,u:e,p:i.length>0?i:null,$:void 0,h:t};return a.g=o,a},P={},W=(e,t,n,o,s,l)=>{if(n===o)return;let i=d(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList;A(n).forEach(e=>t.remove(e)),A(o).forEach(e=>t.add(e))}else if("key"===t);else if(i||"o"!==t[0]||"n"!==t[1]){const r=U(o);if((i||r&&null!==o)&&!s)try{if(e.tagName.includes("-"))e[t]=o;else{let s=null==o?"":o;null!=n&&e[t]==s||(e[t]=s)}}catch(a){}null==o||!1===o?e.removeAttribute(t):(!i||4&l||s)&&!r&&e.setAttribute(t,o=!0===o?"":o)}else t="-"===t[2]?t.substr(3):d(e,c)?c.substr(2):c[2]+t.substr(3),n&&r.rel(e,t,n,!1),o&&r.ael(e,t,o,!1)},A=e=>e?e.split(/\s+/).filter(e=>e):[],E=(e,t,n,o)=>{const s=11===t.$.nodeType&&t.$.host?t.$.host:t.$,l=e&&e.h||S,r=t.h||S;for(o in l)o in r||W(s,o,l[o],void 0,n,t.t);for(o in r)W(s,o,l[o],r[o],n,t.t)},F=(t,n,o)=>{let s,r,i=n.p[o],c=0;if(M(i.i))i.$=l.createTextNode(i.i);else if(s=i.$=l.createElement(i.u),E(null,i,!1),M(e)&&s["s-si"]!==e&&s.classList.add(s["s-si"]=e),i.p)for(c=0;c<i.p.length;++c)(r=F(t,i,c))&&s.appendChild(r);return i.$},T=(e,n,o,s,l,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);l<=r;++l)s[l]&&(i=F(null,o,l))&&(s[l].$=i,c.insertBefore(i,n))},D=(e,t,n)=>{for(;t<=n;++t)M(e[t])&&e[t].$.remove()},q=(e,t)=>e.u===t.u&&e.g===t.g,B=(e,t)=>{const n=t.$=e.$,o=e.p,s=t.p;M(t.i)||(E(e,t,!1),M(o)&&M(s)?((e,t,n,o)=>{let s,l,r=0,i=0,c=0,a=0,f=t.length-1,u=t[0],d=t[f],p=o.length-1,m=o[0],$=o[p];for(;r<=f&&i<=p;)if(null==u)u=t[++r];else if(null==d)d=t[--f];else if(null==m)m=o[++i];else if(null==$)$=o[--p];else if(q(u,m))B(u,m),u=t[++r],m=o[++i];else if(q(d,$))B(d,$),d=t[--f],$=o[--p];else if(q(u,$))B(u,$),e.insertBefore(u.$,d.$.nextSibling),u=t[++r],$=o[--p];else if(q(d,m))B(d,m),e.insertBefore(d.$,u.$),d=t[--f],m=o[++i];else{for(c=-1,a=r;a<=f;++a)if(t[a]&&M(t[a].g)&&t[a].g===m.g){c=a;break}c>=0?((l=t[c]).u!==m.u?s=F(t&&t[i],n,c):(B(l,m),t[c]=void 0,s=l.$),m=o[++i]):(s=F(t&&t[i],n,i),m=o[++i]),s&&u.$.parentNode.insertBefore(s,u.$)}r>f?T(e,null==o[p+1]?null:o[p+1].$,n,o,i,p):i>p&&D(t,r,f)})(n,o,t,s):M(s)?T(n,null,t,s,0,s.length-1):M(o)&&D(o,0,o.length-1))},H=(e,t,n,o)=>{t.t|=16;const s=t.s,l=()=>N(e,t,n,s,o);let r;return r=G(s,o?"componentWillLoad":"componentWillUpdate"),I(r,()=>v(l))},N=(n,o,s,r,c)=>{o.t&=-17,n["s-lr"]=!1,c&&((e,t)=>{const n=((e,t)=>{let n=x(t._),o=$.get(n);if(e=11===e.nodeType?e:l,o)if("string"==typeof o){let t,s=R.get(e=e.head||e);s||R.set(e,s=new Set),s.has(n)||((t=l.createElement("style")).setAttribute("data-styles",""),t.innerHTML=o,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return n})(i&&e.shadowRoot?e.shadowRoot:e.getRootNode(),t);10&t.t&&(e["s-sc"]=n,e.classList.add(n+"-h"))})(n,s),o.t|=4;try{((n,o,s,l)=>{t=n.tagName;const r=o.j||{t:0},i=(e=>e&&e.u===P)(l)?l:C(null,null,l);i.u=null,i.t|=4,o.j=i,i.$=r.$=n.shadowRoot||n,e=n["s-sc"],B(r,i)})(n,o,0,r.render())}catch(a){p(a)}o.t&=-5,n["s-lr"]=!0,o.t|=2,n["s-rc"].length>0&&(n["s-rc"].forEach(e=>e()),n["s-rc"].length=0),V(n,o)},V=(e,t,n)=>{if(!e["s-al"]){const o=t.s,s=t.v;64&t.t||(t.t|=64,e.classList.add("hydrated"),G(o,"componentDidLoad"),t.S(e),s||z()),s&&((n=s["s-al"])&&(n.delete(e),0===n.size&&(s["s-al"]=void 0,s["s-init"]())),t.v=void 0)}},z=()=>{l.documentElement.classList.add("hydrated"),r.t|=2},G=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(o){p(o)}},I=(e,t)=>e&&e.then?e.then(t):t(),J=(e,t,n)=>{if(t.M){e.watchers&&(t.U=e.watchers);const o=Object.entries(t.M),s=e.prototype;if(o.forEach(([e,[o]])=>{31&o||2&n&&32&o?Object.defineProperty(s,e,{get(){return((e,t)=>f(e).O.get(t))(this,e)},set(n){((e,t,n,o)=>{const s=f(this),l=s.k,r=s.O.get(t),i=s.t,c=s.s;if(!((n=((e,t)=>null==e||U(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?String(e):e)(n,o.M[t][0]))===r||8&i&&void 0!==r)&&(s.O.set(t,n),c)){if(o.U&&128&i){const e=o.U[t];e&&e.forEach(e=>{try{c[e](n,r,t)}catch(o){p(o)}})}2==(22&i)&&H(l,s,o,!1)}})(0,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(s,e,{value(...t){const n=f(this);return n.L.then(()=>n.s[e](...t))}})}),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,o){r.jmp(()=>{const n=t.get(e);this[n]=(null!==o||"boolean"!=typeof this[n])&&o})},e.observedAttributes=o.filter(([e,t])=>15&t[0]).map(([e,n])=>{const o=n[1]||e;return t.set(o,e),o})}}return e},K=(e,t={})=>{const n=[],o=t.exclude||[],u=l.head,d=s.customElements,h=u.querySelector("meta[charset]"),b=l.createElement("style");let w;Object.assign(r,t),r.o=new URL(t.resourcesUrl||"./",l.baseURI).href,t.syncQueue&&(r.t|=4),e.forEach(e=>e[1].forEach(t=>{const s={t:t[0],_:t[1],M:t[2],R:t[3],U:{}};!i&&1&s.t&&(s.t|=8);const l=s._,u=class extends HTMLElement{constructor(e){super(e),e=this,this["s-lr"]=!1,this["s-rc"]=[],(e=>{{const t={t:0,k:e,O:new Map};t.L=new Promise(e=>t.S=e),a.set(e,t)}})(e),1&s.t&&(i?e.attachShadow({mode:"open"}):"shadowRoot"in e||(e.shadowRoot=e))}connectedCallback(){w&&(clearTimeout(w),w=null),r.jmp(()=>((e,t)=>{if(0==(1&r.t)){const n=f(e);if(!(1&n.t)){n.t|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-init"]&&!1===t["s-lr"]){n.v=t,(t["s-al"]=t["s-al"]||new Set).add(e);break}}t.M&&Object.entries(t.M).forEach(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}}),j(()=>(async(e,t,n,o,s)=>{if(0==(32&t.t)){t.t|=32,(s=(e=>{const t=e._.replace(/-/g,"_"),n=e.C,o=m.get(n);return o?o[t]:__sc_import_bingoboard(`./${n}.entry.js`).then(e=>(m.set(n,e),e[t]),p)})(n)).then&&(s=await s),s.isProxied||(n.U=s.watchers,J(s,n,2),s.isProxied=!0),t.t|=8;try{new s(t)}catch(i){p(i)}t.t&=-9,t.t|=128;const e=x(n._);if(!$.has(e)&&s.style){let t=s.style;8&n.t&&(t=await __sc_import_bingoboard("./p-affe7c09.js").then(n=>n.scopeCss(t,e,!1))),((e,t,n)=>{let o=$.get(e);c&&n?(o=o||new CSSStyleSheet).replace(t):o=t,$.set(e,o)})(e,t,!!(1&n.t))}}const l=t.v,r=()=>H(e,t,n,!0);l&&!1===l["s-lr"]&&l["s-rc"]?l["s-rc"].push(r):r()})(e,n,t))}}})(this,s))}disconnectedCallback(){r.jmp(()=>(()=>{0==(1&r.t)&&G(f(this).s,"componentDidUnload")})())}"s-init"(){const e=f(this);e.s&&V(this,e)}"s-hmr"(e){}forceUpdate(){((e,t)=>{{const n=f(e);2&n.t&&H(e,n,t,!1)}})(this,s)}componentOnReady(){return f(this).L}};s.C=e[0],o.includes(l)||d.get(l)||(n.push(l),d.define(l,J(u,s,1)))})),b.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",b.setAttribute("data-styles",""),u.insertBefore(b,h?h.nextSibling:u.firstChild),r.jmp(()=>w=setTimeout(z,30))},Q=e=>f(e).k;export{O as a,K as b,Q as g,C as h,k as p,u as r};