bottom-sheet
Version:
Bottom Sheet implemented as a Vanilla Web Component
8 lines • 17.8 kB
JavaScript
/*!
* BottomSheet: Core, es2017
* Built with http://stenciljs.com
*/
function e(e,t){return"sc-"+e.t+(t&&t!==s?"-"+t:"")}function t(e,t){return e+(t?"-h":"-s")}function n(e,t){let n,o,i=null,s=!1,l=!1,r=arguments.length;for(;r-- >2;)g.push(arguments[r]);for(;g.length>0;){let t=g.pop();if(t&&void 0!==t.pop)for(r=t.length;r--;)g.push(t[r]);else"boolean"==typeof t&&(t=null),(l="function"!=typeof e)&&(null==t?t="":"number"==typeof t?t=String(t):"string"!=typeof t&&(l=!1)),l&&s?i[i.length-1].vtext+=t:null===i?i=[l?{vtext:t}:t]:i.push(l?{vtext:t}:t),s=l}if(null!=t){if(t.className&&(t.class=t.className),"object"==typeof t.class){for(r in t.class)t.class[r]&&g.push(r);t.class=g.join(" "),g.length=0}null!=t.key&&(n=t.key),null!=t.name&&(o=t.name)}return"function"==typeof e?e(t,i||[],M):{vtag:e,vchildren:i,vtext:void 0,vattrs:t,vkey:n,vname:o,o:void 0,i:!1}}function o(e,t,n={}){let o=Array.isArray(t)?t:[t];const s=e.document,l=n.hydratedCssClass||"hydrated",r=n.exclude;r&&(o=o.filter(e=>-1===r.indexOf(e[0])));const c=o.map(e=>e[0]);if(c.length>0){const e=s.createElement("style");e.innerHTML=c.join()+"{visibility:hidden}."+l+"{visibility:inherit}",e.setAttribute("data-styles",""),s.head.insertBefore(e,s.head.firstChild)}const a=n.namespace||"BottomSheet";return q||(q=!0,function f(e,t,n){(e["s-apps"]=e["s-apps"]||[]).push(t),n.componentOnReady||(n.componentOnReady=function t(){function n(t){if(o.nodeName.indexOf("-")>0){for(var n=e["s-apps"],i=0,s=0;s<n.length;s++)if(e[n[s]].componentOnReady){if(e[n[s]].componentOnReady(o,t))return;i++}if(i<n.length)return void(e["s-cr"]=e["s-cr"]||[]).push([o,t])}t(null)}var o=this;return e.Promise?new e.Promise(n):{then:n}})}(e,a,e.HTMLElement.prototype)),applyPolyfills(e).then(()=>{if(!H[a]){const t={},r=n.resourcesUrl||"./";i(a,t,e,s,r,l),H[a]=D(a,t,e,s,r,l,o)}(function t(){o.forEach(t=>{let n;!function o(e){return/\{\s*\[native code\]\s*\}/.test(""+e)}(e.customElements.define)?(n=function(t){return e.HTMLElement.call(this,t)}).prototype=Object.create(e.HTMLElement.prototype,{constructor:{value:n,configurable:!0}}):n=new Function("w","return class extends w.HTMLElement{}")(e),H[a].s(function i(e){const t=$(e),n=t.l,o=u(e[0]);return t.l=(({mode:e,scoped:t})=>(function i(e,t,n){return import(
/* webpackInclude: /\.entry\.js$/ */
/* webpackMode: "lazy" */
`./build/${e}${t?".sc":""}.entry.js`).then(e=>e[n])})("string"==typeof n?n:n[e],t,o)),t}(t),n)})})()})}var i=function(){};function applyPolyfills(){return Promise.resolve()}const s="$",l={},r={enter:13,escape:27,space:32,tab:9,left:37,up:38,right:39,down:40},c=(t,n,o,i)=>{let l=o.t+s,r=o[l];if((2===o.u||1===o.u&&!t.v.p)&&(i["s-sc"]=r?e(o,i.mode):e(o)),r){let e=n.m.head;if(n.p)if(1===o.u)e=i.shadowRoot;else{const t=i.getRootNode();t.host&&(e=t)}let s=t.g.get(e);if(s||t.g.set(e,s={}),!s[l]){let t;{t=r.content.cloneNode(!0),s[l]=!0;const o=e.querySelectorAll("[data-styles]");n.M(e,t,o.length&&o[o.length-1].nextSibling||e.firstChild)}}}},a=e=>null!=e,f=e=>e.toLowerCase(),u=e=>f(e).split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),p=()=>{},d=(e,t,n,o,i,s)=>{if("class"!==n||s)if("style"===n){for(const e in o)i&&null!=i[e]||(/-/.test(e)?t.style.removeProperty(e):t.style[e]="");for(const e in i)o&&i[e]===o[e]||(/-/.test(e)?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("o"!==n[0]||"n"!==n[1]||!/[A-Z]/.test(n[2])||n in t)if("list"!==n&&"type"!==n&&!s&&(n in t||-1!==["object","function"].indexOf(typeof i)&&null!==i)){const o=e.k(t);o&&o.C&&o.C[n]?y(t,n,i):"ref"!==n&&(y(t,n,null==i?"":i),null!=i&&!1!==i||e.v.j(t,n))}else null!=i&&"key"!==n?((e,t,n,o="boolean"==typeof n,i)=>{i=t!==(t=t.replace(/^xlink\:?/,"")),null==n||o&&(!n||"false"===n)?i?e.removeAttributeNS("http://www.w3.org/1999/xlink",f(t)):e.removeAttribute(t):"function"!=typeof n&&(n=o?"":n.toString(),i?e.setAttributeNS("http://www.w3.org/1999/xlink",f(t),n):e.setAttribute(t,n))})(t,n,i):(s||e.v.A(t,n)&&(null==i||!1===i))&&e.v.j(t,n);else n=f(n)in t?f(n.substring(2)):f(n[2])+n.substring(3),i?i!==o&&e.v.O(t,n,i):e.v._(t,n);else if(o!==i){const e=v(o),n=v(i),s=e.filter(e=>!n.includes(e)),l=v(t.className).filter(e=>!s.includes(e)),r=n.filter(t=>!e.includes(t)&&!l.includes(t));l.push(...r),t.className=l.join(" ")}},v=e=>null==e||""===e?[]:e.trim().split(/\s+/),y=(e,t,n)=>{try{e[t]=n}catch(e){}},m=(e,t,n,o,i)=>{const s=11===n.o.nodeType&&n.o.host?n.o.host:n.o,r=t&&t.vattrs||l,c=n.vattrs||l;for(i in r)c&&null!=c[i]||null==r[i]||d(e,s,i,r[i],void 0,o,n.i);for(i in c)i in r&&c[i]===("value"===i||"checked"===i?s[i]:r[i])||d(e,s,i,r[i],c[i],o,n.i)};let b=!1;const h=(e,t)=>{e&&(e.vattrs&&e.vattrs.ref&&e.vattrs.ref(t?null:e.o),e.vchildren&&e.vchildren.forEach(e=>{h(e,t)}))},w=(e,t)=>{{let n=0,o=!1;const i=()=>t.performance.now(),s=!1!==e.asyncQueue,l=Promise.resolve(),r=[],c=[],a=[],f=[],u=t=>n=>{t.push(n),o||(o=!0,e.raf(v))},p=e=>{for(let t=0;t<e.length;t++)try{e[t](i())}catch(e){console.error(e)}e.length=0},d=(e,t)=>{let n,o=0;for(;o<e.length&&(n=i())<t;)try{e[o++](n)}catch(e){console.error(e)}o===e.length?e.length=0:0!==o&&e.splice(0,o)},v=()=>{n++,p(c);const t=s?i()+7*Math.ceil(n*(1/22)):Infinity;d(a,t),d(f,t),a.length>0&&(f.push(...a),a.length=0),(o=c.length+a.length+f.length>0)?e.raf(v):n=0};return e.raf||(e.raf=t.requestAnimationFrame.bind(t)),{tick(e){r.push(e),1===r.length&&l.then(()=>p(r))},read:u(c),write:u(a)}}},g=[],M={forEach:(e,t)=>e.forEach(t),map:(e,t)=>e.map(t)},$=(e,t,n)=>{const[o,i,,s,l,r]=e,c={color:{S:"color"}};if(s)for(t=0;t<s.length;t++)c[(n=s[t])[0]]={W:n[1],N:!!n[2],S:"string"==typeof n[3]?n[3]:n[3]?n[0]:0,P:n[4]};return{t:o,l:i,C:Object.assign({},c),u:l,R:r?r.map(k):void 0}},k=e=>({L:e[0],T:e[1],D:!!e[2],H:!!e[3],q:!!e[4]}),C=(e,t)=>a(t)&&"object"!=typeof t&&"function"!=typeof t?e===Boolean||4===e?"false"!==t&&(""===t||!!t):e===Number||8===e?parseFloat(t):e===String||2===e?t.toString():t:t,E=(e,t,n)=>{e.B.add(t),e.F.has(t)||(e.F.set(t,!0),e.I?e.queue.write(()=>j(e,t,n)):e.queue.tick(()=>j(e,t,n)))},j=async(e,o,i,s,l,r)=>{if(e.F.delete(o),!e.U.has(o)){if(!(l=e.Y.get(o))){if((r=e.Z.get(o))&&!r["s-rn"])return void(r["s-rc"]=r["s-rc"]||[]).push(()=>{j(e,o,i)});if(l=N(e,o,e.G.get(o),i))try{l.componentWillLoad&&await l.componentWillLoad()}catch(t){e.J(t,3,o)}}((e,o,i,s)=>{try{const l=o.K.host,r=o.K.encapsulation,c="shadow"===r&&e.v.p;let a,f=i;if(c&&(f=i.shadowRoot),!i["s-rn"]){e.V(e,e.v,o,i);const n=i["s-sc"];n&&(e.v.X(i,t(n,!0)),"scoped"===r&&e.v.X(i,t(n)))}if(s.render||s.hostData||l||a){e.ee=!0;const t=s.render&&s.render();let o;o=s.hostData&&s.hostData(),e.ee=!1;const l=n(null,o,t),a=e.te.get(i)||{};a.o=f,e.te.set(i,e.render(i,a,l,c,r))}i["s-rn"]=!0,i["s-rc"]&&(i["s-rc"].forEach(e=>e()),i["s-rc"]=null)}catch(t){e.ee=!1,e.J(t,8,i,!0)}})(e,e.k(o),o,l),o["s-init"]()}},A=(e,t,n,o,i,s,l,r,c)=>{if(t.type||t.state){const f=e.ne.get(n);t.state||(!t.attr||void 0!==f[i]&&""!==f[i]||(r=s&&s.oe)&&a(c=r[t.attr])&&(f[i]=C(t.type,c)),n.hasOwnProperty(i)&&(void 0===f[i]&&(f[i]=C(t.type,n[i])),"mode"!==i&&delete n[i])),o.hasOwnProperty(i)&&void 0===f[i]&&(f[i]=o[i]),t.watchCallbacks&&(f[W+i]=t.watchCallbacks.slice()),S(o,i,function f(t){return(t=e.ne.get(e.ie.get(this)))&&t[i]},function u(n,o){(o=e.ie.get(this))&&(t.state||t.mutable)&&O(e,o,i,n,l)})}else t.elementRef?_(o,i,n):t.method?_(n,i,o[i].bind(o)):t.connect&&_(o,i,e.se(t.connect))},O=(e,t,n,o,i,s,l)=>{(l=e.ne.get(t))||e.ne.set(t,l={});const r=l[n];if(o!==r&&(l[n]=o,s=e.Y.get(t))){{const e=l[W+n];if(e)for(let t=0;t<e.length;t++)try{s[e[t]].call(s,o,r,n)}catch(e){console.error(e)}}!e.ee&&t["s-rn"]&&E(e,t,i)}},_=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,value:n})},S=(e,t,n,o)=>{Object.defineProperty(e,t,{configurable:!0,get:n,set:o})},W="wc-",N=(e,t,n,o,i,s,l,r)=>{try{i=new(s=e.k(t).K),((e,t,n,o,i,s)=>{e.ie.set(o,n),e.ne.has(n)||e.ne.set(n,{}),Object.entries(Object.assign({color:{type:String}},t.properties,{mode:{type:String}})).forEach(([t,l])=>{A(e,l,n,o,t,i,s)})})(e,s,t,i,n,o);try{if(l=e.le.get(t)){for(r=0;r<l.length;r+=2)i[l[r]](l[r+1]);e.le.delete(t)}}catch(n){e.J(n,2,t)}}catch(n){i={},e.J(n,7,t,!0)}return e.Y.set(t,i),i},x=(e,t,n,o,i,s)=>{if(e.B.delete(t),(i=e.Z.get(t))&&((o=i["s-ld"])&&((n=o.indexOf(t))>-1&&o.splice(n,1),o.length||i["s-init"]&&i["s-init"]()),e.Z.delete(t)),e.re.length&&!e.B.size)for(;s=e.re.shift();)s()},P=(e,t,n,o)=>{t.forEach(([t,i])=>{const s=i.W;3&s?S(n,t,function n(){return(e.ne.get(this)||{})[t]},function n(s){O(e,this,t,C(i.P,s),o)}):32===s&&_(n,t,p)})},R=(e,t,n,o,i)=>{if(n.connectedCallback=function(){((e,t,n)=>{e.ce.has(n)||(e.ce.set(n,!0),function o(e,t){const n=e.k(t);n.R&&n.R.forEach(n=>{n.D||e.v.O(t,n.L,function o(e,t,n,i){return o=>{(i=e.Y.get(t))?i[n](o):((i=e.le.get(t)||[]).push(n,o),e.le.set(t,i))}}(e,t,n.T),n.q,n.H)})}(e,n)),e.U.delete(n),e.ae.has(n)||(e.fe=!0,e.B.add(n),e.ae.set(n,!0),((e,t,n)=>{for(n=t;n=e.v.ue(n);)if(e.pe(n)){e.de.has(t)||(e.Z.set(t,n),(n["s-ld"]=n["s-ld"]||[]).push(t));break}})(e,n),e.queue.tick(()=>{e.G.set(n,((e,t,n,o,i)=>(n.mode||(n.mode=e.ve(n)),n["s-cr"]||e.ye(n,"ssrv")||e.p&&1===t.u||(n["s-cr"]=e.me(""),n["s-cr"]["s-cn"]=!0,e.M(n,n["s-cr"],e.be(n)[0])),1===t.u&&e.p&&!n.shadowRoot&&e.he(n,{mode:"open"}),o={oe:{}},t.C&&Object.keys(t.C).forEach(s=>{(i=t.C[s].S)&&(o.oe[i]=e.ye(n,i))}),o))(e.v,t,n)),e.we(t,n)}))})(e,t,this)},n.disconnectedCallback=function(){((e,t)=>{if(!e.ge&&((e,t)=>{for(;t;){if(!e.Me(t))return 9!==e.$e(t);t=e.Me(t)}})(e.v,t)){e.U.set(t,!0),x(e,t),h(e.te.get(t),!0),e.v._(t),e.ce.delete(t);{const n=e.Y.get(t);n&&n.componentDidUnload&&n.componentDidUnload()}[e.Z,e.ke,e.G].forEach(e=>e.delete(t))}})(e,this)},n["s-init"]=function(){((e,t,n,o,i,s,l)=>{if((i=e.Y.get(t))&&!e.U.has(t)&&(!t["s-ld"]||!t["s-ld"].length)){e.de.set(t,!0),(l=e.Ce.has(t))||(e.Ce.set(t,!0),t["s-ld"]=void 0,e.v.X(t,n));try{h(e.te.get(t)),(s=e.ke.get(t))&&(s.forEach(e=>e(t)),e.ke.delete(t)),!l&&i.componentDidLoad&&i.componentDidLoad()}catch(n){e.J(n,4,t)}x(e,t)}})(e,this,o)},n.forceUpdate=function(){E(e,this,i)},t.C){const o=Object.entries(t.C);{let e={};o.forEach(([t,{S:n}])=>{n&&(e[n]=t)}),e=Object.assign({},e),n.attributeChangedCallback=function(t,n,o){(function i(e,t,n,o){const i=e[f(n)];i&&(t[i]=o)})(e,this,t,o)}}P(e,o,n,i)}},L=(e,t,n,o)=>(function(){const i=arguments;return T(e,t,n).then(e=>e[o].apply(e,i))}),T=(e,t,n,o,i)=>(o=t[n],(i=e.m.body)?(o||(o=i.querySelector(n)),o||(o=t[n]=e.Ee(n),e.je(i,o)),o.componentOnReady()):Promise.resolve()),D=(e,t,o,i,l,u)=>{const p=o.performance,d={html:{}},v={},y=o[e]=o[e]||{},h=((e,t,n)=>{const o=new WeakMap,i={m:n,p:!!n.documentElement.attachShadow,Ae:!1,$e:e=>e.nodeType,Ee:e=>n.createElement(e),Oe:(e,t)=>n.createElementNS(e,t),me:e=>n.createTextNode(e),_e:e=>n.createComment(e),M:(e,t,n)=>e.insertBefore(t,n),Se:e=>e.remove(),je:(e,t)=>e.appendChild(t),X:(e,t)=>{e.classList.add(t)},be:e=>e.childNodes,Me:e=>e.parentNode,We:e=>e.nextSibling,Ne:e=>e.previousSibling,xe:e=>f(e.nodeName),Pe:e=>e.textContent,Re:(e,t)=>e.textContent=t,ye:(e,t)=>e.getAttribute(t),Le:(e,t,n)=>e.setAttribute(t,n),j:(e,t)=>e.removeAttribute(t),A:(e,t)=>e.hasAttribute(t),ve:t=>t.getAttribute("mode")||(e.Context||{}).mode,Te:(e,o)=>"child"===o?e.firstElementChild:"parent"===o?i.ue(e):"body"===o?n.body:"document"===o?n:"window"===o?t:e,O:(t,n,s,l,c,a,f,u,p)=>{let d=t,v=s,y=o.get(t);p=n,y&&y[p]&&y[p](),"string"==typeof a?d=i.Te(t,a):"object"==typeof a?d=a:(u=n.split(":")).length>1&&(d=i.Te(t,u[0]),n=u[1]),d&&((u=n.split(".")).length>1&&(n=u[0],v=(e=>{e.keyCode===r[u[1]]&&s(e)})),f=i.Ae?{capture:!!l,passive:!!c}:!!l,e.ael(d,n,v,f),y||o.set(t,y={}),y[p]=(()=>{d&&e.rel(d,n,v,f),y[p]=null}))},_:(e,t,n)=>{(n=o.get(e))&&(t?n[t]&&n[t]():Object.keys(n).forEach(e=>{n[e]&&n[e]()}))},De:(e,n,o,i)=>(i=new t.CustomEvent(n,o),e&&e.dispatchEvent(i),i),ue:(e,t)=>(t=i.Me(e))&&11===i.$e(t)?t.host:t,He:(e,t,n,o)=>e.setAttributeNS(t,n,o),he:(e,t)=>e.attachShadow(t)};e.ael||(e.ael=((e,t,n,o)=>e.addEventListener(t,n,o)),e.rel=((e,t,n,o)=>e.removeEventListener(t,n,o)));try{t.addEventListener("e",null,Object.defineProperty({},"passive",{get:()=>i.Ae=!0}))}catch(e){}return i})(y,o,i),g=h.m.documentElement,M=o["s-defined"]=o["s-defined"]||{},$={v:h,s:(e,t)=>{o.customElements.get(e.t)||(R($,d[e.t]=e,t.prototype,u,p),t.observedAttributes=Object.values(e.C).map(e=>e.S).filter(e=>!!e),o.customElements.define(e.t,t))},k:e=>d[h.xe(e)],qe:e=>t[e],isClient:!0,pe:e=>!(!M[h.xe(e)]&&!$.k(e)),J:(e,t,n)=>console.error(e,t,n&&n.tagName),queue:t.queue=w(y,o),we:(e,t)=>{{const n=!h.p,o={mode:t.mode,scoped:n};e.l(o).then(n=>{try{e.K=n,function o(e,t,n,i,l){if(i){const n=t.t+(l||s);if(!t[n]){const o=e.Ee("template");t[n]=o,o.innerHTML=`<style>${i}</style>`,e.je(e.m.head,o)}}}(h,e,e.u,n.style,n.styleMode)}catch(t){console.error(t),e.K=class{}}E($,t,p)})}},ee:!1,I:!1,ge:!1,V:c,Z:new WeakMap,g:new WeakMap,ae:new WeakMap,ce:new WeakMap,Ce:new WeakMap,de:new WeakMap,ie:new WeakMap,G:new WeakMap,Y:new WeakMap,U:new WeakMap,F:new WeakMap,ke:new WeakMap,le:new WeakMap,te:new WeakMap,ne:new WeakMap,B:new Set,re:[]};return t.isServer=t.isPrerender=!(t.isClient=!0),t.window=o,t.location=o.location,t.document=i,t.resourcesUrl=t.publicPath=l,t.enableListener=((e,t,n,o,i)=>(function s(e,t,n,o,i,l){if(t){const s=e.ie.get(t),r=e.k(s);if(r&&r.R)if(o){const o=r.R.find(e=>e.L===n);o&&e.v.O(s,n,e=>t[o.T](e),o.q,void 0===l?o.H:!!l,i)}else e.v._(s,n)}})($,e,t,n,o,i)),$.se=(e=>((e,t,n)=>({create:L(e,t,n,"create"),componentOnReady:L(e,t,n,"componentOnReady")}))(h,v,e)),y.h=n,y.Context=t,y.onReady=(()=>new Promise(e=>$.queue.write(()=>$.B.size?$.re.push(e):e()))),$.render=((e,t)=>{let n,o,i,s,l,r,c;const f=(i,p,d,v,y,h,w,g,M)=>{if(g=p.vchildren[d],n||(s=!0,"slot"===g.vtag&&(o&&t.X(v,o+"-s"),g.vchildren?g.Be=!0:g.Fe=!0)),a(g.vtext))g.o=t.me(g.vtext);else if(g.Fe)g.o=t.me("");else{if(h=g.o=b||"svg"===g.vtag?t.Oe("http://www.w3.org/2000/svg",g.vtag):t.Ee(g.Be?"slot-fb":g.vtag),e.pe(h)&&e.de.delete(c),b="svg"===g.vtag||"foreignObject"!==g.vtag&&b,m(e,null,g,b),a(o)&&h["s-si"]!==o&&t.X(h,h["s-si"]=o),g.vchildren)for(y=0;y<g.vchildren.length;++y)(w=f(i,g,y,h))&&t.je(h,w);"svg"===g.vtag&&(b=!1)}return g.o["s-hn"]=r,(g.Be||g.Fe)&&(g.o["s-sr"]=!0,g.o["s-cr"]=l,g.o["s-sn"]=g.vname||"",(M=i&&i.vchildren&&i.vchildren[d])&&M.vtag===g.vtag&&i.o&&u(i.o)),g.o},u=(n,o,i,l)=>{e.ge=!0;const c=t.be(n);for(i=c.length-1;i>=0;i--)(l=c[i])["s-hn"]!==r&&l["s-ol"]&&(t.Se(l),t.M(h(l),l,y(l)),t.Se(l["s-ol"]),l["s-ol"]=null,s=!0),o&&u(l,o);e.ge=!1},p=(e,n,o,i,s,l,c,u)=>{const p=e["s-cr"];for((c=p&&t.Me(p)||e).shadowRoot&&t.xe(c)===r&&(c=c.shadowRoot);s<=l;++s)i[s]&&(u=a(i[s].vtext)?t.me(i[s].vtext):f(null,o,s,e))&&(i[s].o=u,t.M(c,u,y(n)))},d=(e,n,o,s)=>{for(;n<=o;++n)a(e[n])&&(s=e[n].o,i=!0,s["s-ol"]?t.Se(s["s-ol"]):u(s,!0),t.Se(s))},v=(e,t)=>e.vtag===t.vtag&&e.vkey===t.vkey&&("slot"!==e.vtag||e.vname===t.vname),y=e=>e&&e["s-ol"]?e["s-ol"]:e,h=e=>t.Me(e["s-ol"]?e["s-ol"]:e),w=(n,o,i)=>{const s=o.o=n.o,l=n.vchildren,r=o.vchildren;b=o.o&&a(t.ue(o.o))&&void 0!==o.o.ownerSVGElement,b="svg"===o.vtag||"foreignObject"!==o.vtag&&b,a(o.vtext)?(i=s["s-cr"])?t.Re(t.Me(i),o.vtext):n.vtext!==o.vtext&&t.Re(s,o.vtext):("slot"!==o.vtag&&m(e,n,o,b),a(l)&&a(r)?((e,n,o,i,s,l,r,c)=>{let m=0,b=0,g=n.length-1,M=n[0],$=n[g],k=i.length-1,C=i[0],E=i[k];for(;m<=g&&b<=k;)if(null==M)M=n[++m];else if(null==$)$=n[--g];else if(null==C)C=i[++b];else if(null==E)E=i[--k];else if(v(M,C))w(M,C),M=n[++m],C=i[++b];else if(v($,E))w($,E),$=n[--g],E=i[--k];else if(v(M,E))"slot"!==M.vtag&&"slot"!==E.vtag||u(t.Me(M.o)),w(M,E),t.M(e,M.o,t.We($.o)),M=n[++m],E=i[--k];else if(v($,C))"slot"!==M.vtag&&"slot"!==E.vtag||u(t.Me($.o)),w($,C),t.M(e,$.o,M.o),$=n[--g],C=i[++b];else{for(s=null,l=m;l<=g;++l)if(n[l]&&a(n[l].vkey)&&n[l].vkey===C.vkey){s=l;break}a(s)?((c=n[s]).vtag!==C.vtag?r=f(n&&n[b],o,s,e):(w(c,C),n[s]=void 0,r=c.o),C=i[++b]):(r=f(n&&n[b],o,b,e),C=i[++b]),r&&t.M(h(M.o),r,y(M.o))}m>g?p(e,null==i[k+1]?null:i[k+1].o,o,i,b,k):b>k&&d(n,m,g)})(s,l,o,r):a(r)?(a(n.vtext)&&t.Re(s,""),p(s,null,o,r,0,r.length-1)):a(l)&&d(l,0,l.length-1)),b&&"svg"===o.vtag&&(b=!1)},g=(e,n,o,i,s,l,r,c)=>{for(i=0,s=(o=t.be(e)).length;i<s;i++)if(n=o[i],1===t.$e(n)){if(n["s-sr"])for(r=n["s-sn"],n.hidden=!1,l=0;l<s;l++)if(o[l]["s-hn"]!==n["s-hn"])if(c=t.$e(o[l]),""!==r){if(1===c&&r===t.ye(o[l],"slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==t.Pe(o[l]).trim()){n.hidden=!0;break}g(n)}},M=[],$=(e,n,o,s,l,r,c,a,f,u)=>{for(l=0,r=(n=t.be(e)).length;l<r;l++){if((o=n[l])["s-sr"]&&(s=o["s-cr"]))for(a=t.be(t.Me(s)),f=o["s-sn"],c=a.length-1;c>=0;c--)(s=a[c])["s-cn"]||s["s-nr"]||s["s-hn"]===o["s-hn"]||((3===(u=t.$e(s))||8===u)&&""===f||1===u&&null===t.ye(s,"slot")&&""===f||1===u&&t.ye(s,"slot")===f)&&(M.some(e=>e.Ie===s)||(i=!0,s["s-sn"]=f,M.push({Qe:o,Ie:s})));1===t.$e(o)&&$(o)}};return(a,f,u,p,d,v,y,m,b,h,k,C)=>{if(c=a,r=t.xe(c),l=c["s-cr"],n=p,o=c["s-sc"],s=i=!1,w(f,u),s){for($(u.o),y=0;y<M.length;y++)(m=M[y]).Ie["s-ol"]||((b=t.me(""))["s-nr"]=m.Ie,t.M(t.Me(m.Ie),m.Ie["s-ol"]=b,m.Ie));for(e.ge=!0,y=0;y<M.length;y++){for(m=M[y],k=t.Me(m.Qe),C=t.We(m.Qe),b=m.Ie["s-ol"];b=t.Ne(b);)if((h=b["s-nr"])&&h&&h["s-sn"]===m.Ie["s-sn"]&&k===t.Me(h)&&(h=t.We(h))&&h&&!h["s-nr"]){C=h;break}(!C&&k!==t.Me(m.Ie)||t.We(m.Ie)!==C)&&m.Ie!==C&&(t.Se(m.Ie),t.M(k,m.Ie,C))}e.ge=!1}return i&&g(u.o),M.length=0,u}})($,h),g["s-ld"]=[],g["s-rn"]=!0,g["s-init"]=(()=>{$.de.set(g,y.loaded=$.I=!0),h.De(o,"appload",{detail:{namespace:e}})}),((e,t,n,o,i,s)=>{if(t.componentOnReady=((t,n)=>{if(!t.nodeName.includes("-"))return n(null),!1;const o=e.k(t);if(o)if(e.de.has(t))n(t);else{const o=e.ke.get(t)||[];o.push(n),e.ke.set(t,o)}return!!o}),i){for(s=i.length-1;s>=0;s--)t.componentOnReady(i[s][0],i[s][1])&&i.splice(s,1);for(s=0;s<o.length;s++)if(!n[o[s]].componentOnReady)return;for(s=0;s<i.length;s++)i[s][1](null);i.length=0}})($,y,o,o["s-apps"],o["s-cr"]),y.initialized=!0,$},H={};let q=!1;export{o as defineCustomElement,n as h};