@verajs/renderer 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -6
- package/dist/development/vera-renderer-elements.js.map +1 -1
- package/dist/development/vera-renderer-hydrate-slots.js +1 -1
- package/dist/development/vera-renderer-hydrate-slots.js.map +1 -1
- package/dist/development/vera-renderer-hydration.d.ts.map +1 -1
- package/dist/development/vera-renderer-hydration.js +42 -4
- package/dist/development/vera-renderer-hydration.js.map +1 -1
- package/dist/development/vera-renderer-portal.js +1 -1
- package/dist/development/vera-renderer-portal.js.map +1 -1
- package/dist/development/vera-renderer-profiler.d.ts.map +1 -1
- package/dist/development/vera-renderer-profiler.js +304 -97
- package/dist/development/vera-renderer-profiler.js.map +1 -1
- package/dist/development/vera-renderer-slots.js +1 -1
- package/dist/development/vera-renderer-slots.js.map +1 -1
- package/dist/development/vera-renderer-spread.js.map +1 -1
- package/dist/development/vera-renderer-tag.js.map +1 -1
- package/dist/development/vera-renderer.d.ts.map +1 -1
- package/dist/development/vera-renderer.js +304 -97
- package/dist/development/vera-renderer.js.map +1 -1
- package/dist/vera-renderer-elements.min.js.map +1 -1
- package/dist/vera-renderer-hydrate-slots.min.js +1 -1
- package/dist/vera-renderer-hydrate-slots.min.js.map +1 -1
- package/dist/vera-renderer-hydration.min.js +1 -1
- package/dist/vera-renderer-hydration.min.js.map +1 -1
- package/dist/vera-renderer-portal.min.js +1 -1
- package/dist/vera-renderer-portal.min.js.map +1 -1
- package/dist/vera-renderer-slots.min.js +1 -1
- package/dist/vera-renderer-slots.min.js.map +1 -1
- package/dist/vera-renderer-spread.min.js.map +1 -1
- package/dist/vera-renderer-tag.min.js.map +1 -1
- package/dist/vera-renderer.min.js +1 -1
- package/dist/vera-renderer.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),n=n=>n.includes("-")&&!o.has(n.toLowerCase());let t=null;const e=(o,n,e)=>((o,n,t,e)=>{if(o?.length)for(const e of o)e(n,t);else((o,n)=>{"function"!=typeof reportError?console.error(n,o):reportError(o)})(n,e)})(t?.get("error"),o,(o=>null==o?void 0:11===o.nodeType?o.host:o)(n),e),l=o=>1===o.nodeType?o:o.firstElementChild,r=(o,n)=>{if(null!==o.firstElementChild)return o.firstElementChild;for(let t=o;null!==t&&t!==n;t=t.parentElement)if(null!==t.nextElementSibling)return t.nextElementSibling;return null},i=[o=>{t=o},{name:"@verajs/renderer/elements",on:"template",fn:(o,n,i,s)=>{const f=t?.get("element");if(void 0===f||0===f.length)return;const c=o,u=[],d=[];let a=0;for(let o=l(s);null!==o;o=r(o,s),a++)for(let n=0;n<f.length;n++){const t=f[n](o);void 0!==t&&(u.push(a),d.push(t))}u.length>0&&(c._$inst$=((o,n)=>({$c:(t,i,s)=>{const f=[],c=Array.isArray(t);let u=c?null:l(t),d=0;for(let l=0;l<o.length;l++){if(c)u=t[o[l]];else for(;d<o[l];d++)u=r(u,t);try{n[l].create?.(u,s)}catch(o){e(o,i,"[vera] claim-threw");continue}f.push(u,n[l])}return{f:f,r:i,a:s,k:void 0,d:!1}},$m:o=>{const n=o;if(n.d)return;const t=n.f,l={root:n.r,adopted:n.a};n.f=null;for(let o=0;o<t.length;o+=2){const r=t[o+1];let i;try{i=r.mount?.(t[o],l)}catch(o){e(o,n.r,"[vera] claim-threw");continue}void 0!==i&&void 0!==r.unmount&&(n.k??=[]).push(t[o],r,i)}},$q:o=>{const n=o;n.d=!0;const t=n.k;if(void 0!==t)for(let o=0;o<t.length;o+=3)try{t[o+1].unmount(t[o+2],t[o])}catch(o){e(o,n.r,"[vera] claim-threw")}}}))(u,d))},priority:10}],s=o=>3===o.nodeType?"":1===o.nodeType?o.getAttribute("slot")??"":null,f=o=>{const n=ko(o);return n.parentNode!==o.host&&o.host.insertBefore(n,o.host.firstChild),wo(o),n},c=Symbol(),u=o=>o[c],d=o=>void 0!==o[c],a=new WeakMap,v=new WeakMap,h=new WeakMap,m=new WeakMap,w={},p=o=>{const n=[];for(const t of o.units)if(t.a===t.z)n.push(t.a);else for(let o=t.a.nextSibling;null!==o&&o!==t.z;o=o.nextSibling)n.push(h.get(o)??o);return n},b=o=>{const n=v.get(o);void 0!==n&&(v.delete(o),h.delete(n),n.remove())},y=o=>o.$rec?.rs??o,g=o=>o.$rec?.re??o,k=(o,n,t)=>{const e=g(n);for(let l=y(n);null!==l;){const n=l===e?null:l.nextSibling;o.insertBefore(l,t),l=n}},S=(o,n,t)=>{const e=o.ownerDocument.createComment("");n.insertBefore(e,t),v.set(o,e),h.set(e,o)},M=(o,n)=>{const t=v.get(n);void 0!==t?(k(f(o),n,t),b(n),m.delete(n)):(k(f(o),n,o.holding.lastChild),m.set(n,null))},W=o=>{const n=[];let t=o.rs??o.slot;for(;;){if(n.unshift(t),o.light.host.contains(t))return n;let e=t;for(;null!==e.parentNode;)e=e.parentNode;const l=e.$rec;if(void 0===l||null===l.rs)return null;t=l.rs}},j=(o,n)=>!!(4&o.compareDocumentPosition(n)),q=o=>{if(null!==o.rs)return;const n=o.slot.ownerDocument,t=o.slot.parentNode;o.rs=n.createComment("["),o.re=n.createComment("]"),t.insertBefore(o.rs,o.slot),t.insertBefore(o.re,o.slot),t.removeChild(o.slot),ro(t,o.light)},z=o=>{null!==o.rs&&(o.rs.parentNode?.insertBefore(o.slot,o.rs),o.rs.remove(),o.re.remove(),o.rs=o.re=null)},L=o=>{for(const n of p(o.light))m.get(n)===o&&M(o.light,n);z(o)},E=o=>o.light.recs.splice(o.light.recs.indexOf(o),1),x=o=>{o.queued||(o.queued=!0,queueMicrotask((()=>{o.queued=!1,o.slot.dispatchEvent(new o.slot.ownerDocument.defaultView.Event("slotchange",{bubbles:!0,composed:!1}))})))},F=(o,n)=>{if(m.get(o)===w)return!0;const t=o.parentNode;if(null===t)return!1;if(t===n.holding)return!0;for(const o of n.recs)if(null!==o.re&&o.re.parentNode===t)return!0;return!1};let $=!1;const N=o=>{if($)eo(o);else{$=!0;try{do{O(o)}while(o.dirty)}finally{$=!1}}},O=o=>{o.dirty=!1;const n=o.fresh;G&&(o.fresh=!1);const t=o.host,e=e=>y(e).parentNode===o.holding||n&&y(e).parentNode===t;o.units=o.units.filter((l=>l.a===l.z?((o,n)=>{const t=m.get(o);if(t===w)return!0;const e=y(o).parentNode;return null==t?e===n.holding:t.light===n&&null!==e&&e===t.re?.parentNode})(l.a,o)||n&&y(l.a).parentNode===t:e(l.a)&&e(l.z)));for(const n of o.units)if(n.a!==n.z)for(let t=n.a.nextSibling;null!==t&&t!==n.z;t=t.nextSibling){const n=h.get(t);void 0===n||F(n,o)||(m.delete(n),b(n))}const l=[],r=new Set;for(const n of o.recs){const o=W(n);null!==o?l.push({rec:n,at:o}):r.add(n)}l.sort(((o,n)=>((o,n)=>{for(let t=0;t<o.length&&t<n.length;t++)if(o[t]!==n[t])return j(o[t],n[t]);return o.length<n.length})(o.at,n.at)?-1:1));const i=new Map;for(const{rec:o}of l){const n=o.slot.getAttribute("name")??"";i.has(n)||i.set(n,o)}const c=p(o),u=new Set;for(const n of o.units)n.a===n.z&&u.add(n.a);const d=new Map,a=new Set;for(const o of c){const n=s(o),t=null===n?void 0:i.get(n);if(void 0===t)continue;let e=d.get(t);void 0===e&&d.set(t,e=[]),e.push(o),a.add(o)}for(const{rec:o}of l){const n=d.get(o)??[];if(n.length>0){q(o);const t=o.re.parentNode;let l=o.rs;for(const r of n){const n=y(r);n.parentNode!==t||n.previousSibling!==l?(u.has(r)||!e(r)||v.has(r)||S(r,n.parentNode,n),k(t,r,l.nextSibling),r._$slotted$=!0,m.set(r,o),l=g(r)):l=g(r)}}(n.length!==o.shown.length||n.some(((n,t)=>n!==o.shown[t])))&&(o.shown=n,x(o))}for(const n of c){if(a.has(n))continue;const e=m.get(n);null!=e&&r.has(e)||(e!==w||G)&&(v.has(n)||null!=e||G&&u.has(n)&&n.parentNode===t)&&M(o,n)}if(n&&G)for(const n of o.units)if(n.a!==n.z&&n.a.parentNode===t){const t=[];for(let o=n.a;null!==o&&(t.push(o),o!==n.z);o=o.nextSibling);const e=ko(o);for(const n of t)(8===n.nodeType?e:f(o)).insertBefore(n,e.lastChild);wo(o)}for(const{rec:o}of l)d.has(o)||z(o);(o=>{const n=o.holding;if(void 0!==n){for(let t=n.firstChild;null!==t;t=t.nextSibling)if(8!==t.nodeType)return void f(o);n.remove()}})(o)},T=o=>{const n=globalThis.MutationObserver??o.host.ownerDocument.defaultView.MutationObserver;return o.obs??=new n((n=>{oo(o,n),lo()}))};let A;const R=new WeakMap,B=o=>{no(o),lo()},C=(o,n=!0)=>void 0===o.obs||!n&&!0!==o.ho&&!0!==o.cw?[]:o.obs.takeRecords(),D=o=>{if(void 0!==o.obs&&(!0===o.ho||!0===o.cw))for(const n of o.obs.takeRecords())"attributes"===n.type&&(eo(n.target.$rec?.light??o),queueMicrotask(lo))};let G=!1,H=new WeakMap;const I=(o,n)=>n===o.holding||n===o.host&&!0===o.hw||n.$rec?.light===o||o.recs.some((o=>null!==o.re&&o.re.parentNode===n)),J=o=>{let n=o;for(;;){const o=n.$rec,t=void 0!==o&&null!==o.rs&&o.slot===n?o.rs:n.parentNode;if(null===t)return n;n=t}},K=(o,n)=>{for(let t=o;null!==t;){if(t===n)return!0;const o=t.$rec;t=void 0!==o&&null!==o.rs&&o.slot===t?o.rs:t.parentNode}return!1},P=o=>{E(o),L(o),eo(o.light)};function Q(){const o=this.$rec;void 0!==o&&null!==o.rs&&L(o),this.ownerDocument.defaultView.Element.prototype.remove.call(this)}function U(...o){const n=this.$rec;void 0!==n&&null!==n.rs&&L(n),this.ownerDocument.defaultView.Element.prototype.replaceWith.apply(this,o)}let V=[],X=!1;const Y=(o,n)=>{if(1!==n.nodeType)return;const t=n;if("slot"===t.localName)return void(void 0===t.$rec&&V.push([t,o]));if(null===t.firstElementChild)return;const e=t.getElementsByTagName("slot");for(let n=0;n<e.length;n++)void 0===e[n].$rec&&V.push([e[n],o])},Z=(o,n)=>{for(let t=o.parentNode;null!==t;t=t.parentNode){if(t===n.host)return!0;if(t===n.holding||m.has(t))return!1}return!1},_=()=>{X=!1;const o=V;V=[];for(const[n,t]of o)void 0===n.$rec&&u(t.host)===t&&Z(n,t)&&Eo.mount(n,{root:t.host})},oo=(o,n)=>{!0===o.ex&&((o,n)=>{for(const t of n){if("childList"!==t.type)continue;const n=t.addedNodes;for(let t=0,e=n.length;t<e;t++)Y(o,n[t])}})(o,n),H=new WeakMap;let t=!1;for(const e of n){const n=e.target;if(e.removedNodes.length>0&&(t=!0),"attributes"!==e.type){if((n===o.host?!0===o.hw:I(o,n))&&(eo(o),ho(o,e)),n===o.host){o.fresh&&vo(o,e);for(const n of e.addedNodes)co(o,n)}}else{const t=n.$rec;if(void 0!==t){eo(t.light);continue}(F(n,o)||n.parentNode===o.host)&&eo(o)}}if(t)for(let n=o.recs.length-1;n>=0;n--){const t=o.recs[n],e=t.rs??t.slot;K(e,o.host)||R.has(J(e))||P(t)}},no=o=>{for(const n of o)if("childList"!==n.type)for(let o=n.target;null!==o;o=o.parentNode){const n=o.$rec??m.get(o);if(n){eo(n.light);break}const t=u(o);if(void 0!==t){eo(t);break}}else{let o=n.target;for(;null!==o.parentNode;)o=o.parentNode;const t=R.get(o),e=void 0===t?void 0:u(t);void 0!==e&&!e.host.contains(n.target)&&I(e,n.target)&&(eo(e),ho(e,n))}},to=new Set,eo=o=>{o.dirty=!0,o.wait||to.add(o)},lo=(o,n)=>{if($)return;const t=[];void 0!==o&&t.push(o);const e=void 0===n?void 0:qo.get(n);if(void 0!==e){const o=[],l=n.isConnected;for(let n=0;n<e.length;n++){const r=e[n].deref();if(void 0===r)continue;if(!r.isConnected&&l)continue;o.push(e[n]);const i=u(r);void 0!==i&&t.push(i)}qo.set(n,o)}for(const o of t)oo(o,C(o));for(const o of to)oo(o,C(o,!1));void 0!==A&&no(A.takeRecords());for(const o of to)(o.dirty||G&&o.fresh)&&(N(o),D(o)),o.dirty||o.fresh&&o.host.isConnected||to.delete(o);for(const o of t)D(o);V.length>0&&!X&&(X=!0,queueMicrotask(_))},ro=(o,n)=>{if(o===n.host)return void(n.hw=!0);const t=T(n);void 0===o.$rec?(o===n.holding||((o,n)=>{for(let t=o;t!==n;t=t.parentNode)if(null===t||void 0!==t.$rec)return!0;return!1})(o,n.host))&&(n.cw=!0,t.observe(o,{childList:!0})):t.observe(o,{attributes:!0,attributeFilter:so(o)?["slot","name"]:["name"]})},io=Symbol(),so=o=>!0===o[io],fo=(o,n)=>{1===n.nodeType&&!0===o.ho&&(n[io]=!0,T(o).observe(n,{attributes:!0,attributeFilter:void 0!==n.$rec?["slot","name"]:["slot"]}))},co=(o,n)=>{if(8===n.nodeType||n.parentNode!==o.host||n===o.holding)return;const t=new Set;for(const n of o.units)t.add(n.a).add(n.z);if(t.has(n))return;let e=null,l=null;for(const n of o.host.childNodes)8!==n.nodeType||t.has(n)||(e??=n,l=n);if(null!==e&&e!==l&&j(e,n)&&j(n,l))return;const r=null!==e&&j(n,e);if(f(o).insertBefore(n,o.holding.lastChild),m.set(n,null),fo(o,n),r){const t=H.get(o)??0;o.units.splice(t,0,{a:n,z:n}),H.set(o,t+1)}else o.units.push({a:n,z:n});eo(o)},uo=(o,n)=>{const t=v.get(n);return o.units.findIndex(void 0===t?o=>o.a===n:o=>o.a!==o.z&&j(o.a,t)&&j(t,o.z))},ao=(o,n)=>{const t=n.parentNode;if(null!==t&&8!==n.nodeType)for(const e of o.recs){if(null===e.re||e.re.parentNode!==t)continue;if(!j(e.rs,n)||!j(n,e.re))continue;let l=-1;for(let t=n.nextSibling;null!==t&&t!==e.re&&l<0;t=t.nextSibling)l=uo(o,t);return l<0?o.units.push({a:n,z:n}):o.units.splice(l,0,{a:n,z:n}),m.set(n,e),void fo(o,n)}},vo=(o,n)=>{const t=o.holding;for(const o of n.removedNodes){const n=h.get(o);if(void 0!==n){const e=o.parentNode;if(e===t||null!==e&&11!==e.nodeType)continue;null===e?n.parentNode?.removeChild(n):e.insertBefore(n,o),m.delete(n),b(n)}else v.has(o)&&null===o.parentNode&&(m.delete(o),b(o))}},ho=(o,n)=>{const t=ko(o);vo(o,n);for(const e of n.addedNodes){if(e.parentNode!==n.target)continue;if(n.target===t){v.has(e)&&(m.delete(e),b(e)),fo(o,e);continue}if(void 0!==m.get(e)&&!v.has(e))continue;const l=n.nextSibling,r=n.previousSibling,i=n=>n.parentNode===t||o.fresh&&n.parentNode===o.host,s=null===l?void 0:v.get(l)??(i(l)?l:void 0),c=null===r?void 0:v.get(r)??(i(r)?r:void 0);if(void 0===s&&void 0===c){ao(o,e);continue}const u=s??c.nextSibling,d=v.get(e),a=null===u?t:u.parentNode;(a===t&&void 0===d?f(o):a).insertBefore(d??e,u),fo(o,e)}},mo=o=>{if(!0!==o.ho){o.ho=!0,T(o).observe(o.host,{childList:!0,subtree:!0});for(const n of p(o))fo(o,n);(void 0!==Ro?._$hydrateSlots$||o.units.some((o=>o.a!==o.z))||(o.holding?.childNodes.length??0)>2)&&wo(o)}},wo=o=>{!0===o.ho&&!0!==o.hh&&(o.hh=!0,ro(ko(o),o))},po=o=>{for(const n of o.recs)for(const o of[...n.shown]){const n=v.get(o);if(void 0===n)continue;if(null===o.parentNode){m.delete(o),b(o);continue}const t=n.parentNode;if(null===t)o.parentNode.removeChild(o);else{if(11!==t.nodeType)continue;t.insertBefore(o,n)}m.delete(o),b(o)}for(const n of o.recs)if(null!==n.rs&&null!==n.re)for(let t=n.rs.nextSibling;null!==t&&t!==n.re;){const e=t.nextSibling;m.has(t)||8===t.nodeType||ho(o,{target:n.re.parentNode,addedNodes:[t],removedNodes:[],previousSibling:t.previousSibling,nextSibling:t.nextSibling}),t=e}const n=o.host,t=new Set;for(const n of o.units)t.add(n.a).add(n.z);let e=null,l=null;for(let o=n.firstChild;null!==o;o=o.nextSibling)8!==o.nodeType||t.has(o)||(e??=o,l=o);const r=null!==e&&e!==l;for(const i of[...n.childNodes])8===i.nodeType||i===o.holding||t.has(i)||m.has(i)||r&&j(e,i)&&j(i,l)||o.units.some((o=>o.a!==o.z&&j(o.a,i)&&j(i,o.z)))||co(o,i)},bo=Symbol(),yo=o=>{if(!0!==o[bo]){o[bo]=!0;for(const n of[o.Element?.prototype,o.Text?.prototype]){const o=void 0===n?void 0:Object.getOwnPropertyDescriptor(n,"assignedSlot"),t=o?.get;void 0!==t&&Object.defineProperty(n,"assignedSlot",{configurable:!0,enumerable:o.enumerable,get(){const o=m.get(this);return null!=o&&o!==w?o.slot:t.call(this)}})}}},go=o=>{const n=o.ownerDocument;return o.setAttribute("hidden",""),o.setAttribute("data-vm-unassigned",""),o.style.setProperty("display","none","important"),o.insertBefore(n.createComment(""),o.firstChild),o.append(n.createComment("")),o},ko=o=>o.holding??=go(o.host.ownerDocument.createElement("ins")),So={get:o=>{const n=u(o);return void 0!==n&&ko(n),n},has:o=>d(o)},Mo=(...o)=>{const n=jo(...o);return ko(n),n},Wo=(o,n,t=null)=>{const e=o.ownerDocument.defaultView;null!==e&&yo(e),$o();const l={host:o,units:[],holding:null===t?void 0:go(t),recs:[],dirty:!1,fresh:!1,late:n,wait:!1};return((o,n)=>{o[c]=n})(o,l),l},jo=(o,n=null,t=[...o.childNodes],e=null,l=!1)=>{let r=u(o);if(void 0!==r&&!r.late)return r;const i=o.ownerDocument;r??=Wo(o,!1,e),r.late=!1;const s=a.get(o);let f=null;const c=()=>{if(null===f)return;const n=i.createComment(""),t=i.createComment("");o.insertBefore(n,f[0]),o.insertBefore(t,f[f.length-1].nextSibling),r.units.push({a:n,z:t}),f=null};for(const e of t){if(e===n)break;const t=e.parentNode;t!==o&&m.set(e,t===r.holding?null:w),fo(r,e),void 0===s||s.has(e)?(c(),r.units.push({a:e,z:e})):(f??=[]).push(e)}return c(),l?r.wait=!0:(r.fresh=!0,eo(r)),r},qo=new WeakMap,zo={mount:(o,{root:n})=>{if(null===n)return;let t=qo.get(n);void 0===t&&($o(),qo.set(n,t=[])),t.push(new WeakRef(o))},create:(o,n)=>{if(n)return;const t=new Set;let e=!1;for(const n of[...o.childNodes]){const l=3===n.nodeType&&""===n.data;if(l&&e){const e=o.ownerDocument.createComment("");o.insertBefore(e,n),t.add(e)}l||t.add(n),e=l}a.set(o,t)}},Lo=(o,n,t=!1)=>{lo(o.light);const e=o.shown.filter((o=>!n||1===o.nodeType));if(o.shown.length>0||!t)return e;for(const t of o.slot.childNodes){const o=t.$rec;if(void 0!==o)e.push(...Lo(o,n,!0));else{if(1===t.nodeType&&"slot"===t.localName)continue;(1===t.nodeType||!n&&3===t.nodeType)&&e.push(t)}}return e},Eo={mount:(o,t)=>{const e=t.root;if(null!==e&&11===e.nodeType){const o=u(e.host);void 0!==o&&0===o.recs.length&&(o=>{for(const n of o.units)if(n.a!==n.z)for(let t=n.a.nextSibling;null!==t&&t!==n.z;){const n=t.nextSibling;o.host.appendChild(h.get(t)??t),t=n}else k(o.host,n.a,null);o.holding?.remove(),o.host[c]=void 0,to.delete(o),o.obs?.disconnect(),o.obs=void 0})(o)}if(null===e||1!==e.nodeType)return;lo(u(e));const l=u(e)??Wo(e,n(e.localName)),r=o,i={slot:r,light:l,rs:null,re:null,shown:[],queued:!1};r.$rec=i;const s=r._$region$;if(void 0!==s){r._$region$=void 0,[i.rs,i.re]=s;for(let o=i.rs.nextSibling;o!==i.re;o=o.nextSibling)m.set(o,i),o._$slotted$=!0;ro(i.re.parentNode,l)}return r.assignedNodes=o=>Lo(i,!1,o?.flatten),r.remove=Q,r.replaceWith=U,r.assignedElements=o=>Lo(i,!0,o?.flatten),l.recs.push(i),l.wait=!1,ro(r,l),N(l),D(l),l.fresh||!0===l.ho||queueMicrotask((()=>{!0!==l.ho&&u(l.host)===l&&(po(l),lo(l),mo(l))})),i},unmount:o=>{lo(o.light),E(o),L(o),N(o.light),D(o.light)}};let xo,Fo;const $o=()=>{void 0!==Fo&&Fo._$done$!==xo&&(Fo._$done$=xo)},No=o=>{1===o.nodeType&&n(o.localName)&&$o();const t=1===o.nodeType?o.getAttribute(Ao):null;if(null!==t){if(!t.endsWith(":"))throw new Error("[vera] hydration-unwired");for(let n=o.firstChild;null!==n;){const t=n.nextSibling;1===n.nodeType&&n.hasAttribute("data-vm-sheet")||o.removeChild(n),n=t}o.removeAttribute(Ao)}},Oo=o=>{const n=u(o);return void 0===n?null:(lo(n),p(n))},To=(o,n="")=>{const t=u(o);if(void 0!==t){lo(t);for(const o of t.recs)if((o.slot.getAttribute("name")??"")===n&&o.shown.length>0)return[...o.shown];return p(t).filter((o=>s(o)===n))}const e=o._$r$??o.shadowRoot,l=[...e?.querySelectorAll("slot")??[]].find((o=>(o.getAttribute("name")??"")===n));return void 0===l?[]:l.assignedNodes()},Ao="data-vm-light";let Ro=null;const Bo=[i,{name:"@verajs/renderer/slots-capture",on:"init",fn:(o,t)=>{const e=t?.observeSlots,l="eager"===(void 0!==e?e:Ro?._$observeSlots$);if((null!==o.firstChild||l)&&null==o._$r$&&null===o.shadowRoot&&n(o.localName)&&!d(o)&&(!0!==Ro?._$hydrating$||!o.hasAttribute(Ao))){const n=jo(o);l&&(n.ex=!0)}},priority:10},{name:"@verajs/renderer/slot-discovery",on:"element",fn:o=>"slot"===o.localName?Eo:null!==o.firstChild&&n(o.localName)?zo:void 0,priority:10},o=>{Ro=o,o._$capture$=[1,Mo,Oo,So,S,m,w],o._$unadopted$=No,o._$parked$=(o,n)=>{$o(),null!==n&&R.set(o,n),(A??=new(globalThis.MutationObserver??o.ownerDocument.defaultView.MutationObserver)(B)).observe(o,{attributes:!0,attributeFilter:["slot"],childList:!0,subtree:!0})},Fo=o,xo=(o,t)=>{let e=u(o);if(1===o.nodeType&&(e?.late??o.firstChild!==t)&&null===o.shadowRoot&&n(o.localName)&&(jo(o,t),e=u(o)),void 0===e&&0===to.size&&void 0===A&&void 0===qo.get(o))return;e?.fresh&&!e.wait&&to.add(e);const l=void 0!==e&&e.recs.length>0;void 0!==e&&!0!==e.ho&&(e.fresh||l)&&po(e),G=!0;try{lo(e,o)}finally{G=!1}void 0===e||!0===e.ho||!l&&!0!==e.ex||mo(e)}}],Co=[Bo,{name:"@verajs/renderer/slots",on:"slot",fn:()=>null,priority:50}],Do=()=>{throw new Error("[vera] slots-wire-too-old")},Go=(o,n)=>{if("function"==typeof o?.get)return"function"!=typeof n&&Do(),void n(Co);const t=o,e=t?.observeSlots;return(o,n)=>{"function"!=typeof n&&Do(),n(Co),void 0!==e&&(o._$observeSlots$=e)}};export{Bo as slotDiscovery,Go as slots,To as slotted};
|
|
1
|
+
const o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),n=n=>n.includes("-")&&!o.has(n.toLowerCase());let t=null;const e=(o,n,e)=>((o,n,t,e)=>{if(o?.length)for(const e of o)e(n,t);else((o,n)=>{"function"!=typeof reportError?console.error(n,o):reportError(o)})(n,e)})(t?.get("error"),o,(o=>null==o?void 0:11===o.nodeType?o.host:o)(n),e),l=o=>1===o.nodeType?o:o.firstElementChild,r=(o,n)=>{if(null!==o.firstElementChild)return o.firstElementChild;for(let t=o;null!==t&&t!==n;t=t.parentElement)if(null!==t.nextElementSibling)return t.nextElementSibling;return null},i=[o=>{t=o},{name:"@verajs/renderer/elements",on:"template",fn:(o,n,i,s)=>{const f=t?.get("element");if(void 0===f||0===f.length)return;const c=o,u=[],d=[];let a=0;for(let o=l(s);null!==o;o=r(o,s),a++)for(let n=0;n<f.length;n++){const t=f[n](o);void 0!==t&&(u.push(a),d.push(t))}u.length>0&&(c._$inst$=((o,n)=>({$c:(t,i,s)=>{const f=[],c=Array.isArray(t);let u=c?null:l(t),d=0;for(let l=0;l<o.length;l++){if(c)u=t[o[l]];else for(;d<o[l];d++)u=r(u,t);try{n[l].create?.(u,s)}catch(o){e(o,i,"[vera] claim-threw");continue}f.push(u,n[l])}return{f:f,r:i,a:s,k:void 0,d:!1}},$m:o=>{const n=o;if(n.d)return;const t=n.f,l={root:n.r,adopted:n.a};n.f=null;for(let o=0;o<t.length;o+=2){const r=t[o+1];let i;try{i=r.mount?.(t[o],l)}catch(o){e(o,n.r,"[vera] claim-threw");continue}void 0!==i&&void 0!==r.unmount&&(n.k??=[]).push(t[o],r,i)}},$q:o=>{const n=o;n.d=!0;const t=n.k;if(void 0!==t)for(let o=0;o<t.length;o+=3)try{t[o+1].unmount(t[o+2],t[o])}catch(o){e(o,n.r,"[vera] claim-threw")}}}))(u,d))},priority:10}],s=o=>3===o.nodeType?"":1===o.nodeType?o.getAttribute("slot")??"":null,f=o=>{const n=ko(o);return n.parentNode!==o.host&&o.host.insertBefore(n,o.host.firstChild),wo(o),n},c=Symbol(),u=o=>o[c],d=o=>void 0!==o[c],a=new WeakMap,v=new WeakMap,h=new WeakMap,m=new WeakMap,w={},p=o=>{const n=[];for(const t of o.units)if(t.a===t.z)n.push(t.a);else for(let o=t.a.nextSibling;null!==o&&o!==t.z;o=o.nextSibling)n.push(h.get(o)??o);return n},b=o=>{const n=v.get(o);void 0!==n&&(v.delete(o),h.delete(n),n.remove())},y=o=>o.$rec?.rs??o,g=o=>o.$rec?.re??o,k=(o,n,t)=>{const e=g(n);for(let l=y(n);null!==l;){const n=l===e?null:l.nextSibling;o.insertBefore(l,t),l=n}},S=(o,n,t)=>{const e=o.ownerDocument.createComment("");n.insertBefore(e,t),v.set(o,e),h.set(e,o)},M=(o,n)=>{const t=v.get(n);void 0!==t?(k(f(o),n,t),b(n),m.delete(n)):(k(f(o),n,o.holding.lastChild),m.set(n,null))},W=o=>{const n=[];let t=o.rs??o.slot;for(;;){if(n.unshift(t),o.light.host.contains(t))return n;let e=t;for(;null!==e.parentNode;)e=e.parentNode;const l=e.$rec;if(void 0===l||null===l.rs)return null;t=l.rs}},j=(o,n)=>!!(4&o.compareDocumentPosition(n)),q=o=>{if(null!==o.rs)return;const n=o.slot.ownerDocument,t=o.slot.parentNode;o.rs=n.createComment("["),o.re=n.createComment("]"),t.insertBefore(o.rs,o.slot),t.insertBefore(o.re,o.slot),t.removeChild(o.slot),ro(t,o.light)},z=o=>{null!==o.rs&&(o.rs.parentNode?.insertBefore(o.slot,o.rs),o.rs.remove(),o.re.remove(),o.rs=o.re=null)},L=o=>{for(const n of p(o.light))m.get(n)===o&&M(o.light,n);z(o)},E=o=>o.light.recs.splice(o.light.recs.indexOf(o),1),x=o=>{o.queued||(o.queued=!0,queueMicrotask((()=>{o.queued=!1,o.slot.dispatchEvent(new o.slot.ownerDocument.defaultView.Event("slotchange",{bubbles:!0,composed:!1}))})))},F=(o,n)=>{if(m.get(o)===w)return!0;const t=o.parentNode;if(null===t)return!1;if(t===n.holding)return!0;for(const o of n.recs)if(null!==o.re&&o.re.parentNode===t)return!0;return!1};let $=!1;const N=o=>{if($)eo(o);else{$=!0;try{do{O(o)}while(o.dirty)}finally{$=!1}}},O=o=>{o.dirty=!1;const n=o.fresh;G&&(o.fresh=!1);const t=o.host,e=e=>y(e).parentNode===o.holding||n&&y(e).parentNode===t;o.units=o.units.filter((l=>l.a===l.z?((o,n)=>{const t=m.get(o);if(t===w)return!0;const e=y(o).parentNode;return null==t?e===n.holding:t.light===n&&null!==e&&e===t.re?.parentNode})(l.a,o)||n&&y(l.a).parentNode===t:e(l.a)&&e(l.z)));for(const n of o.units)if(n.a!==n.z)for(let t=n.a.nextSibling;null!==t&&t!==n.z;t=t.nextSibling){const n=h.get(t);void 0===n||F(n,o)||(m.delete(n),b(n))}const l=[],r=new Set;for(const n of o.recs){const o=W(n);null!==o?l.push({rec:n,at:o}):r.add(n)}l.sort(((o,n)=>((o,n)=>{for(let t=0;t<o.length&&t<n.length;t++)if(o[t]!==n[t])return j(o[t],n[t]);return o.length<n.length})(o.at,n.at)?-1:1));const i=new Map;for(const{rec:o}of l){const n=o.slot.getAttribute("name")??"";i.has(n)||i.set(n,o)}const c=p(o),u=new Set;for(const n of o.units)n.a===n.z&&u.add(n.a);const d=new Map,a=new Set;for(const o of c){const n=s(o),t=null===n?void 0:i.get(n);if(void 0===t)continue;let e=d.get(t);void 0===e&&d.set(t,e=[]),e.push(o),a.add(o)}for(const{rec:o}of l){const n=d.get(o)??[];if(n.length>0){q(o);const t=o.re.parentNode;let l=o.rs;for(const r of n){const n=y(r);n.parentNode!==t||n.previousSibling!==l?(u.has(r)||!e(r)||v.has(r)||S(r,n.parentNode,n),k(t,r,l.nextSibling),r._$slotted$=!0,m.set(r,o),l=g(r)):l=g(r)}}(n.length!==o.shown.length||n.some(((n,t)=>n!==o.shown[t])))&&(o.shown=n,x(o))}for(const n of c){if(a.has(n))continue;const e=m.get(n);null!=e&&r.has(e)||(e!==w||G)&&(v.has(n)||null!=e||G&&u.has(n)&&n.parentNode===t)&&M(o,n)}if(n&&G)for(const n of o.units)if(n.a!==n.z&&n.a.parentNode===t){const t=[];for(let o=n.a;null!==o&&(t.push(o),o!==n.z);o=o.nextSibling);const e=ko(o);for(const n of t)(8===n.nodeType?e:f(o)).insertBefore(n,e.lastChild);wo(o)}for(const{rec:o}of l)d.has(o)||z(o);(o=>{const n=o.holding;if(void 0!==n){for(let t=n.firstChild;null!==t;t=t.nextSibling)if(8!==t.nodeType)return void f(o);n.remove()}})(o)},T=o=>{const n=globalThis.MutationObserver??o.host.ownerDocument.defaultView.MutationObserver;return o.obs??=new n((n=>{oo(o,n),lo()}))};let A;const R=new WeakMap,B=o=>{no(o),lo()},C=(o,n=!0)=>void 0===o.obs||!n&&!0!==o.ho&&!0!==o.cw?[]:o.obs.takeRecords(),D=o=>{if(void 0!==o.obs&&(!0===o.ho||!0===o.cw))for(const n of o.obs.takeRecords())"attributes"===n.type&&(eo(n.target.$rec?.light??o),queueMicrotask(lo))};let G=!1,H=new WeakMap;const I=(o,n)=>n===o.holding||n===o.host&&!0===o.hw||n.$rec?.light===o||o.recs.some((o=>null!==o.re&&o.re.parentNode===n)),J=o=>{let n=o;for(;;){const o=n.$rec,t=void 0!==o&&null!==o.rs&&o.slot===n?o.rs:n.parentNode;if(null===t)return n;n=t}},K=(o,n)=>{for(let t=o;null!==t;){if(t===n)return!0;const o=t.$rec;t=void 0!==o&&null!==o.rs&&o.slot===t?o.rs:t.parentNode}return!1},P=o=>{E(o),L(o),eo(o.light)};function Q(){const o=this.$rec;void 0!==o&&null!==o.rs&&L(o),this.ownerDocument.defaultView.Element.prototype.remove.call(this)}function U(...o){const n=this.$rec;void 0!==n&&null!==n.rs&&L(n),this.ownerDocument.defaultView.Element.prototype.replaceWith.apply(this,o)}let V=[],X=!1;const Y=(o,n)=>{if(1!==n.nodeType)return;const t=n;if("slot"===t.localName)return void(void 0===t.$rec&&V.push([t,o]));if(null===t.firstElementChild)return;const e=t.getElementsByTagName("slot");for(let n=0;n<e.length;n++)void 0===e[n].$rec&&V.push([e[n],o])},Z=(o,n)=>{for(let t=o.parentNode;null!==t;t=t.parentNode){if(t===n.host)return!0;if(t===n.holding||m.has(t))return!1}return!1},_=()=>{X=!1;const o=V;V=[];for(const[n,t]of o)void 0===n.$rec&&u(t.host)===t&&Z(n,t)&&Eo.mount(n,{root:t.host})},oo=(o,n)=>{!0===o.ex&&((o,n)=>{for(const t of n){if("childList"!==t.type)continue;const n=t.addedNodes;for(let t=0,e=n.length;t<e;t++)Y(o,n[t])}})(o,n),H=new WeakMap;let t=!1;for(const e of n){const n=e.target;if(e.removedNodes.length>0&&(t=!0),"attributes"!==e.type){if((n===o.host?!0===o.hw:I(o,n))&&(eo(o),ho(o,e)),n===o.host){o.fresh&&vo(o,e);for(const n of e.addedNodes)co(o,n)}}else{const t=n.$rec;if(void 0!==t){eo(t.light);continue}(F(n,o)||n.parentNode===o.host)&&eo(o)}}if(t)for(let n=o.recs.length-1;n>=0;n--){const t=o.recs[n],e=t.rs??t.slot;K(e,o.host)||R.has(J(e))||P(t)}},no=o=>{for(const n of o)if("childList"!==n.type)for(let o=n.target;null!==o;o=o.parentNode){const n=o.$rec??m.get(o);if(n){eo(n.light);break}const t=u(o);if(void 0!==t){eo(t);break}}else{let o=n.target;for(;null!==o.parentNode;)o=o.parentNode;const t=R.get(o),e=void 0===t?void 0:u(t);void 0!==e&&!e.host.contains(n.target)&&I(e,n.target)&&(eo(e),ho(e,n))}},to=new Set,eo=o=>{o.dirty=!0,o.wait||to.add(o)},lo=(o,n)=>{if($)return;const t=[];void 0!==o&&t.push(o);const e=void 0===n?void 0:qo.get(n);if(void 0!==e){const o=[],l=n.isConnected;for(let n=0;n<e.length;n++){const r=e[n].deref();if(void 0===r)continue;if(!r.isConnected&&l)continue;o.push(e[n]);const i=u(r);void 0!==i&&t.push(i)}qo.set(n,o)}for(const o of t)oo(o,C(o));for(const o of to)oo(o,C(o,!1));void 0!==A&&no(A.takeRecords());for(const o of to)(o.dirty||G&&o.fresh)&&(N(o),D(o)),o.dirty||o.fresh&&o.host.isConnected||to.delete(o);for(const o of t)D(o);V.length>0&&!X&&(X=!0,queueMicrotask(_))},ro=(o,n)=>{if(o===n.host)return void(n.hw=!0);const t=T(n);void 0===o.$rec?(o===n.holding||((o,n)=>{for(let t=o;t!==n;t=t.parentNode)if(null===t||void 0!==t.$rec)return!0;return!1})(o,n.host))&&(n.cw=!0,t.observe(o,{childList:!0})):t.observe(o,{attributes:!0,attributeFilter:so(o)?["slot","name"]:["name"]})},io=Symbol(),so=o=>!0===o[io],fo=(o,n)=>{1===n.nodeType&&!0===o.ho&&(n[io]=!0,T(o).observe(n,{attributes:!0,attributeFilter:void 0!==n.$rec?["slot","name"]:["slot"]}))},co=(o,n)=>{if(8===n.nodeType||n.parentNode!==o.host||n===o.holding)return;const t=new Set;for(const n of o.units)t.add(n.a).add(n.z);if(t.has(n))return;let e=null,l=null;for(const n of o.host.childNodes)8!==n.nodeType||t.has(n)||(e??=n,l=n);if(null!==e&&e!==l&&j(e,n)&&j(n,l))return;const r=null!==e&&j(n,e);if(f(o).insertBefore(n,o.holding.lastChild),m.set(n,null),fo(o,n),r){const t=H.get(o)??0;o.units.splice(t,0,{a:n,z:n}),H.set(o,t+1)}else o.units.push({a:n,z:n});eo(o)},uo=(o,n)=>{const t=v.get(n);return o.units.findIndex(void 0===t?o=>o.a===n:o=>o.a!==o.z&&j(o.a,t)&&j(t,o.z))},ao=(o,n)=>{const t=n.parentNode;if(null!==t&&8!==n.nodeType)for(const e of o.recs){if(null===e.re||e.re.parentNode!==t)continue;if(!j(e.rs,n)||!j(n,e.re))continue;let l=-1;for(let t=n.nextSibling;null!==t&&t!==e.re&&l<0;t=t.nextSibling)l=uo(o,t);return l<0?o.units.push({a:n,z:n}):o.units.splice(l,0,{a:n,z:n}),m.set(n,e),void fo(o,n)}},vo=(o,n)=>{const t=o.holding;for(const o of n.removedNodes){const n=h.get(o);if(void 0!==n){const e=o.parentNode;if(e===t||null!==e&&11!==e.nodeType)continue;null===e?n.parentNode?.removeChild(n):e.insertBefore(n,o),m.delete(n),b(n)}else v.has(o)&&null===o.parentNode&&(m.delete(o),b(o))}},ho=(o,n)=>{const t=ko(o);vo(o,n);for(const e of n.addedNodes){if(e.parentNode!==n.target)continue;if(n.target===t){v.has(e)&&(m.delete(e),b(e)),fo(o,e);continue}if(void 0!==m.get(e)&&!v.has(e))continue;const l=n.nextSibling,r=n.previousSibling,i=n=>n.parentNode===t||o.fresh&&n.parentNode===o.host,s=null===l?void 0:v.get(l)??(i(l)?l:void 0),c=null===r?void 0:v.get(r)??(i(r)?r:void 0);if(void 0===s&&void 0===c){ao(o,e);continue}const u=s??c.nextSibling,d=v.get(e),a=null===u?t:u.parentNode;(a===t&&void 0===d?f(o):a).insertBefore(d??e,u),fo(o,e)}},mo=o=>{if(!0!==o.ho){o.ho=!0,T(o).observe(o.host,{childList:!0,subtree:!0});for(const n of p(o))fo(o,n);(void 0!==Ro?._$hydrateSlots$||o.units.some((o=>o.a!==o.z))||(o.holding?.childNodes.length??0)>2)&&wo(o)}},wo=o=>{!0===o.ho&&!0!==o.hh&&(o.hh=!0,ro(ko(o),o))},po=o=>{for(const n of o.recs)for(const o of[...n.shown]){const n=v.get(o);if(void 0===n)continue;if(null===o.parentNode){m.delete(o),b(o);continue}const t=n.parentNode;if(null===t)o.parentNode.removeChild(o);else{if(11!==t.nodeType)continue;t.insertBefore(o,n)}m.delete(o),b(o)}for(const n of o.recs)if(null!==n.rs&&null!==n.re)for(let t=n.rs.nextSibling;null!==t&&t!==n.re;){const e=t.nextSibling;m.has(t)||8===t.nodeType||ho(o,{target:n.re.parentNode,addedNodes:[t],removedNodes:[],previousSibling:t.previousSibling,nextSibling:t.nextSibling}),t=e}const n=o.host,t=new Set;for(const n of o.units)t.add(n.a).add(n.z);let e=null,l=null;for(let o=n.firstChild;null!==o;o=o.nextSibling)8!==o.nodeType||t.has(o)||(e??=o,l=o);const r=null!==e&&e!==l;for(const i of[...n.childNodes])8===i.nodeType||i===o.holding||t.has(i)||m.has(i)||r&&j(e,i)&&j(i,l)||o.units.some((o=>o.a!==o.z&&j(o.a,i)&&j(i,o.z)))||co(o,i)},bo=Symbol(),yo=o=>{if(!0!==o[bo]){o[bo]=!0;for(const n of[o.Element?.prototype,o.Text?.prototype]){const o=void 0===n?void 0:Object.getOwnPropertyDescriptor(n,"assignedSlot"),t=o?.get;void 0!==t&&Object.defineProperty(n,"assignedSlot",{configurable:!0,enumerable:o.enumerable,get(){const o=m.get(this);return null!=o&&o!==w?o.slot:t.call(this)}})}}},go=o=>{const n=o.ownerDocument;return o.setAttribute("hidden",""),o.setAttribute("data-vm-unassigned",""),o.style.setProperty("display","none","important"),o.insertBefore(n.createComment(""),o.firstChild),o.append(n.createComment("")),o},ko=o=>o.holding??=go(o.host.ownerDocument.createElement("ins")),So={get:o=>{const n=u(o);return void 0!==n&&ko(n),n},has:o=>d(o)},Mo=(...o)=>{const n=jo(...o);return ko(n),n},Wo=(o,n,t=null)=>{const e=o.ownerDocument.defaultView;null!==e&&yo(e),$o();const l={host:o,units:[],holding:null===t?void 0:go(t),recs:[],dirty:!1,fresh:!1,late:n,wait:!1};return((o,n)=>{o[c]=n})(o,l),l},jo=(o,n=null,t=[...o.childNodes],e=null,l=!1)=>{let r=u(o);if(void 0!==r&&!r.late)return r;const i=o.ownerDocument;r??=Wo(o,!1,e),r.late=!1;const s=a.get(o);let f=null;const c=()=>{if(null===f)return;const n=i.createComment(""),t=i.createComment("");o.insertBefore(n,f[0]),o.insertBefore(t,f[f.length-1].nextSibling),r.units.push({a:n,z:t}),f=null};for(const e of t){if(e===n)break;const t=e.parentNode;t!==o&&m.set(e,t===r.holding?null:w),fo(r,e),void 0===s||s.has(e)?(c(),r.units.push({a:e,z:e})):(f??=[]).push(e)}return c(),l?r.wait=!0:(r.fresh=!0,eo(r)),r},qo=new WeakMap,zo={mount:(o,{root:n})=>{if(null===n)return;let t=qo.get(n);void 0===t&&($o(),qo.set(n,t=[])),t.push(new WeakRef(o))},create:(o,n)=>{if(n)return;const t=new Set;let e=!1;for(const n of[...o.childNodes]){const l=3===n.nodeType&&""===n.data;if(l&&e){const e=o.ownerDocument.createComment("");o.insertBefore(e,n),t.add(e)}l||t.add(n),e=l}a.set(o,t)}},Lo=(o,n,t=!1)=>{lo(o.light);const e=o.shown.filter((o=>!n||1===o.nodeType));if(o.shown.length>0||!t)return e;for(const t of o.slot.childNodes){const o=t.$rec;if(void 0!==o)e.push(...Lo(o,n,!0));else{if(1===t.nodeType&&"slot"===t.localName)continue;(1===t.nodeType||!n&&3===t.nodeType)&&e.push(t)}}return e},Eo={mount:(o,t)=>{const e=t.root;if(null!==e&&11===e.nodeType){const o=u(e.host);void 0!==o&&0===o.recs.length&&(o=>{for(const n of o.units)if(n.a!==n.z)for(let t=n.a.nextSibling;null!==t&&t!==n.z;){const n=t.nextSibling;o.host.appendChild(h.get(t)??t),t=n}else k(o.host,n.a,null);o.holding?.remove(),o.host[c]=void 0,to.delete(o),o.obs?.disconnect(),o.obs=void 0})(o)}if(null===e||1!==e.nodeType)return;lo(u(e));const l=u(e)??Wo(e,n(e.localName)),r=o,i={slot:r,light:l,rs:null,re:null,shown:[],queued:!1};r.$rec=i;const s=r._$region$;if(void 0!==s){r._$region$=void 0,[i.rs,i.re]=s;for(let o=i.rs.nextSibling;o!==i.re;o=o.nextSibling)m.set(o,i),o._$slotted$=!0;ro(i.re.parentNode,l)}return r.assignedNodes=o=>Lo(i,!1,o?.flatten),r.remove=Q,r.replaceWith=U,r.assignedElements=o=>Lo(i,!0,o?.flatten),l.recs.push(i),l.wait=!1,ro(r,l),N(l),D(l),l.fresh||!0===l.ho||queueMicrotask((()=>{!0!==l.ho&&u(l.host)===l&&(po(l),lo(l),mo(l))})),i},unmount:o=>{lo(o.light),E(o),L(o),N(o.light),D(o.light)}};let xo,Fo;const $o=()=>{void 0!==Fo&&Fo._$done$!==xo&&(Fo._$done$=xo)},No=o=>{1===o.nodeType&&n(o.localName)&&$o();const t=1===o.nodeType?o.getAttribute(Ao):null;if(null!==t){if(!t.endsWith(":"))throw new Error("[vera] hydration-unwired");for(let n=o.firstChild;null!==n;){const t=n.nextSibling;1===n.nodeType&&n.hasAttribute("data-vm-sheet")||o.removeChild(n),n=t}o.removeAttribute(Ao)}},Oo=o=>{const n=u(o);return void 0===n?null:(lo(n),p(n))},To=(o,n="")=>{const t=u(o);if(void 0!==t){lo(t);for(const o of t.recs)if((o.slot.getAttribute("name")??"")===n&&o.shown.length>0)return[...o.shown];return p(t).filter((o=>s(o)===n))}const e=o._$r$??o.shadowRoot,l=[...e?.querySelectorAll("slot")??[]].find((o=>(o.getAttribute("name")??"")===n));return void 0===l?[]:l.assignedNodes()},Ao="data-vm-light";let Ro=null;const Bo=[i,{name:"@verajs/renderer/slots-capture",on:"init",fn:(o,t)=>{const e=t?.observeSlots,l="eager"===(void 0!==e?e:Ro?._$observeSlots$);if((null!==o.firstChild||l)&&null==o._$r$&&null===o.shadowRoot&&n(o.localName)&&!d(o)&&(!0!==Ro?._$hydrating$||!o.hasAttribute(Ao))){const n=jo(o);l&&(n.ex=!0)}},priority:10},{name:"@verajs/renderer/slot-discovery",on:"element",fn:o=>"slot"===o.localName?Eo:null!==o.firstChild&&n(o.localName)?zo:void 0,priority:10},o=>{Ro=o,o._$capture$=[2,Mo,Oo,So,S,m,w],o._$unadopted$=No,o._$parked$=(o,n)=>{$o(),null!==n&&R.set(o,n),(A??=new(globalThis.MutationObserver??o.ownerDocument.defaultView.MutationObserver)(B)).observe(o,{attributes:!0,attributeFilter:["slot"],childList:!0,subtree:!0})},Fo=o,xo=(o,t)=>{let e=u(o);if(1===o.nodeType&&(e?.late??o.firstChild!==t)&&null===o.shadowRoot&&n(o.localName)&&(jo(o,t),e=u(o)),void 0===e&&0===to.size&&void 0===A&&void 0===qo.get(o))return;e?.fresh&&!e.wait&&to.add(e);const l=void 0!==e&&e.recs.length>0;void 0!==e&&!0!==e.ho&&(e.fresh||l)&&po(e),G=!0;try{lo(e,o)}finally{G=!1}void 0===e||!0===e.ho||!l&&!0!==e.ex||mo(e)}}],Co=[Bo,{name:"@verajs/renderer/slots",on:"slot",fn:()=>null,priority:50}],Do=()=>{throw new Error("[vera] slots-wire-too-old")},Go=(o,n)=>{if("function"==typeof o?.get)return"function"!=typeof n&&Do(),void n(Co);const t=o,e=t?.observeSlots;return(o,n)=>{"function"!=typeof n&&Do(),n(Co),void 0!==e&&(o._$observeSlots$=e)}};export{Bo as slotDiscovery,Go as slots,To as slotted};
|
|
2
2
|
//# sourceMappingURL=vera-renderer-slots.min.js.map
|