Comparing version 0.2.1 to 0.3.0
@@ -24,3 +24,5 @@ 'use strict'; | ||
const hook = typeof what === 'function' ? what() : what; | ||
const info = cache.get(where) || cache.set(where, createCache()); | ||
const info = cache.get(where) || cache.set(where, createCache(null)); | ||
info.w = where; | ||
info.W = what; | ||
return $render( | ||
@@ -52,2 +54,11 @@ where, | ||
let update = false; | ||
const updateEntry = (entry, node) => { | ||
if (node !== entry.node) { | ||
if (entry.node) | ||
update = true; | ||
entry.node = node; | ||
} | ||
}; | ||
const createHook = (info, entry) => augmentor(function () { | ||
@@ -57,8 +68,19 @@ const hole = entry.fn.apply(null, arguments); | ||
unrollHole(info, hole); | ||
return view(entry, hole); | ||
updateEntry(entry, view(entry, hole)); | ||
} | ||
return hole; | ||
else | ||
updateEntry(entry, hole); | ||
try { return entry.node; } | ||
finally { | ||
if (update) { | ||
update = false; | ||
let p = info; | ||
while (p.p) | ||
p = p.p; | ||
render(p.w, p.W); | ||
} | ||
} | ||
}); | ||
const createCache = () => ({stack: [], entry: null}); | ||
const createCache = p => ({p, stack: [], entry: null}); | ||
@@ -68,4 +90,4 @@ const unroll = (info, {fn, template, values}) => { | ||
if (!entry || entry.fn !== fn) { | ||
info.entry = (entry = {fn, hook: null}); | ||
entry.hook = createHook(createCache(), entry); | ||
info.entry = (entry = {fn, hook: null, node: null}); | ||
entry.hook = createHook(createCache(info), entry); | ||
} | ||
@@ -79,11 +101,12 @@ return entry.hook(template, ...values); | ||
const unrollValues = ({stack}, values, length) => { | ||
const unrollValues = (info, values, length) => { | ||
const {stack} = info; | ||
for (let i = 0; i < length; i++) { | ||
const hook = values[i]; | ||
if (hook instanceof Hook) | ||
values[i] = unroll(stack[i] || (stack[i] = createCache()), hook); | ||
values[i] = unroll(stack[i] || (stack[i] = createCache(info)), hook); | ||
else if (hook instanceof Hole) | ||
unrollHole(stack[i] || (stack[i] = createCache()), hook); | ||
unrollHole(stack[i] || (stack[i] = createCache(info)), hook); | ||
else if (isArray(hook)) | ||
unrollValues(stack[i] || (stack[i] = createCache()), hook, hook.length); | ||
unrollValues(stack[i] || (stack[i] = createCache(info)), hook, hook.length); | ||
else | ||
@@ -115,3 +138,3 @@ stack[i] = null; | ||
const store = cache.get(entry) || cache.set(entry, create(null)); | ||
const info = store[id] || (store[id] = createCache()); | ||
const info = store[id] || (store[id] = createCache(null)); | ||
return (template, ...values) => { | ||
@@ -118,0 +141,0 @@ unrollValues(info, values); |
@@ -1,7 +0,7 @@ | ||
self.uland=function(e){"use strict";var t=CustomEvent,n=WeakSet;var r="function"==typeof cancelAnimationFrame,o=r?cancelAnimationFrame:clearTimeout,s=r?requestAnimationFrame:setTimeout;function l(e){var t,n,l,a,c;return i(),function(e,r,o){return l=e,a=r,c=o,n||(n=s(u)),--t<0&&f(!0),f};function u(){i(),l.apply(a,c||[])}function i(){t=e||1/0,n=r?0:null}function f(e){var t=!!n;return t&&(o(n),e&&u()),t}}var a=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)}) | ||
/*! (c) Andrea Giammarchi - ISC */;let c=null;const u=e=>{const t=[];return function n(){const r=c,o=[];c={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{c=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}},i=a(new WeakMap),f=(e,t,n)=>{e.apply(t,n)},d={async:!1,always:!1},h=(e,t)=>"function"==typeof t?t(e):t,p=(e,t,n,r)=>{const o=c.i++,{hook:s,args:a,stack:u,length:p}=c;o===p&&(c.length=u.push({}));const g=u[o];if(g.args=a,o===p){const o="function"==typeof n,{async:a,always:c}=(o?r:n)||r||d;g.$=o?n(t):h(void 0,t),g._=a?i.get(s)||i.set(s,l()):f,g.f=t=>{const n=e(g.$,t);(c||g.$!==n)&&(g.$=n,g._(s,null,g.args))}}return[g.$,g.f]},g=new WeakMap,v=({hook:e,args:t})=>{e.apply(null,t)};function m(e){this.value!==e&&(this.value=e,g.get(this).forEach(v))}function y({hook:e}){return e===this.hook}const w=new WeakMap,k=a(w),b=()=>{},N=e=>(t,n)=>{const r=c.i++,{hook:o,after:s,stack:a,length:u}=c;if(r<u){const o=a[r],{update:l,values:c,stop:u}=o;if(!n||n.some(T,c)){o.values=n,e&&u(e);const{clean:r}=o;r&&(o.clean=null,r());const a=()=>{o.clean=t()};e?l(a):s.push(a)}}else{const r=e?l():b,u={clean:null,update:r,values:n,stop:b};c.length=a.push(u),(k.get(o)||k.set(o,[])).push(u);const i=()=>{u.clean=t()};e?u.stop=r(i):s.push(i)}},C=e=>{(w.get(e)||[]).forEach(e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())})},$=w.has.bind(w),x=N(!0),E=N(!1),M=(e,t)=>{const n=c.i++,{stack:r,length:o}=c;return n===o?c.length=r.push({$:e(),_:t}):t&&!t.some(T,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function T(e,t){return e!==this[t]} | ||
self.uland=function(e){"use strict";var t=CustomEvent,n=WeakSet;var r="function"==typeof cancelAnimationFrame,o=r?cancelAnimationFrame:clearTimeout,l=r?requestAnimationFrame:setTimeout;function s(e){var t,n,s,a,c;return i(),function(e,r,o){return s=e,a=r,c=o,n||(n=l(u)),--t<0&&f(!0),f};function u(){i(),s.apply(a,c||[])}function i(){t=e||1/0,n=r?0:null}function f(e){var t=!!n;return t&&(o(n),e&&u()),t}}var a=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)}) | ||
/*! (c) Andrea Giammarchi - ISC */;let c=null;const u=e=>{const t=[];return function n(){const r=c,o=[];c={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{c=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}},i=a(new WeakMap),f=(e,t,n)=>{e.apply(t,n)},d={async:!1,always:!1},p=(e,t)=>"function"==typeof t?t(e):t,h=(e,t,n,r)=>{const o=c.i++,{hook:l,args:a,stack:u,length:h}=c;o===h&&(c.length=u.push({}));const g=u[o];if(g.args=a,o===h){const o="function"==typeof n,{async:a,always:c}=(o?r:n)||r||d;g.$=o?n(t):p(void 0,t),g._=a?i.get(l)||i.set(l,s()):f,g.f=t=>{const n=e(g.$,t);(c||g.$!==n)&&(g.$=n,g._(l,null,g.args))}}return[g.$,g.f]},g=new WeakMap,v=({hook:e,args:t})=>{e.apply(null,t)};function m(e){this.value!==e&&(this.value=e,g.get(this).forEach(v))}function y({hook:e}){return e===this.hook}const w=new WeakMap,k=a(w),b=()=>{},N=e=>(t,n)=>{const r=c.i++,{hook:o,after:l,stack:a,length:u}=c;if(r<u){const o=a[r],{update:s,values:c,stop:u}=o;if(!n||n.some(T,c)){o.values=n,e&&u(e);const{clean:r}=o;r&&(o.clean=null,r());const a=()=>{o.clean=t()};e?s(a):l.push(a)}}else{const r=e?s():b,u={clean:null,update:r,values:n,stop:b};c.length=a.push(u),(k.get(o)||k.set(o,[])).push(u);const i=()=>{u.clean=t()};e?u.stop=r(i):l.push(i)}},C=e=>{(w.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))},$=w.has.bind(w),x=N(!0),E=N(!1),M=(e,t)=>{const n=c.i++,{stack:r,length:o}=c;return n===o?c.length=r.push({$:e(),_:t}):t&&!t.some(T,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function T(e,t){return e!==this[t]} | ||
/*! (c) Andrea Giammarchi - ISC */const A= | ||
/*! (c) Andrea Giammarchi */ | ||
function(e){var t=e.Event,n=e.WeakSet,r=!0,o=null;return function(e){return r&&(r=!r,o=new n,function(e){var r=new n,s=new n;try{new MutationObserver(u).observe(e,{subtree:!0,childList:!0})}catch(t){var l=0,a=[],c=function(e){a.push(e),clearTimeout(l),l=setTimeout((function(){u(a.splice(l=0,a.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){c({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){c({addedNodes:[e.target],removedNodes:[]})}),!0)}function u(e){for(var t,n=e.length,o=0;o<n;o++)i((t=e[o]).removedNodes,"disconnected",s,r),i(t.addedNodes,"connected",r,s)}function i(e,n,r,o){for(var s,l=new t(n),a=e.length,c=0;c<a;1===(s=e[c++]).nodeType&&f(s,l,n,r,o));}function f(e,t,n,r,s){o.has(e)&&!r.has(e)&&(s.delete(e),r.add(e),e.dispatchEvent(t));for(var l=e.children||[],a=l.length,c=0;c<a;f(l[c++],t,n,r,s));}}(e.ownerDocument)),o.add(e),e}}({Event:t,WeakSet:n}),L=(e,t)=>{const{nodeType:n}=e;if(n){const r=1===n?e:(e=>{let{firstChild:t}=e;for(;t&&1!==t.nodeType;)t=t.nextSibling;if(t)return t;throw"unobservable"})(e);A(r),r.addEventListener("disconnected",t,!1)}else{const n=e.valueOf();n!==e&&L(n,t)}},S=e=>{let t=null;const n=u(e);return function(){const e=n.apply(this,arguments);return $(n)&&L(e,t||(t=C.bind(null,n))),e}},O=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,W=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,_=/<[a-z][^>]+$/i,D=/>[^<>]*$/,R=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,j=/\s+$/,B=(e,t)=>0<t--&&(_.test(e[t])||!D.test(e[t])&&B(e,t)),F=(e,t,n)=>W.test(t)?e:`<${t}${n.replace(j,"")}></${t}>`;const{isArray:H}=Array,{indexOf:z,slice:q}=[],I=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e; | ||
function(e){var t=e.Event,n=e.WeakSet,r=!0,o=null;return function(e){return r&&(r=!r,o=new n,function(e){var r=new n,l=new n;try{new MutationObserver(u).observe(e,{subtree:!0,childList:!0})}catch(t){var s=0,a=[],c=function(e){a.push(e),clearTimeout(s),s=setTimeout((function(){u(a.splice(s=0,a.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){c({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){c({addedNodes:[e.target],removedNodes:[]})}),!0)}function u(e){for(var t,n=e.length,o=0;o<n;o++)i((t=e[o]).removedNodes,"disconnected",l,r),i(t.addedNodes,"connected",r,l)}function i(e,n,r,o){for(var l,s=new t(n),a=e.length,c=0;c<a;1===(l=e[c++]).nodeType&&f(l,s,n,r,o));}function f(e,t,n,r,l){o.has(e)&&!r.has(e)&&(l.delete(e),r.add(e),e.dispatchEvent(t));for(var s=e.children||[],a=s.length,c=0;c<a;f(s[c++],t,n,r,l));}}(e.ownerDocument)),o.add(e),e}}({Event:t,WeakSet:n}),L=(e,t)=>{const{nodeType:n}=e;if(n){const r=1===n?e:(e=>{let{firstChild:t}=e;for(;t&&1!==t.nodeType;)t=t.nextSibling;if(t)return t;throw"unobservable"})(e);A(r),r.addEventListener("disconnected",t,!1)}else{const n=e.valueOf();n!==e&&L(n,t)}},S=e=>{let t=null;const n=u(e);return function(){const e=n.apply(this,arguments);return $(n)&&L(e,t||(t=C.bind(null,n))),e}},O=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,W=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,_=/<[a-z][^>]+$/i,j=/>[^<>]*$/,D=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,R=/\s+$/,B=(e,t)=>0<t--&&(_.test(e[t])||!j.test(e[t])&&B(e,t)),F=(e,t,n)=>W.test(t)?e:`<${t}${n.replace(R,"")}></${t}>`;const{isArray:H}=Array,{indexOf:z,slice:q}=[],P=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e; | ||
/*! (c) Andrea Giammarchi - ISC */ | ||
self.P=function(e){var t="fragment",n="template",r="content"in s(n)?function(e){var t=s(n);return t.innerHTML=e,t.content}:function(e){var r=s(t),l=s(n),a=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;l.innerHTML="<table>"+e+"</table>",a=l.querySelectorAll(c)}else l.innerHTML=e,a=l.childNodes;return o(r,a),r};return function(e,t){return("svg"===t?l:r)(e)};function o(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function s(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function l(e){var n=s(t),r=s("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",o(n,r.firstChild.childNodes),n}}(document);const G=({childNodes:e},t)=>e[t],J=e=>{const t=[];let{parentNode:n}=e;for(;n;)t.push(z.call(n.childNodes,e)),n=(e=n).parentNode;return t},{createTreeWalker:K,importNode:Q}=document,U=1!=Q.length,V=U?(e,t)=>Q.call(document,P(e,t),!0):P,X=U?e=>K.call(document,e,129,null,!1):e=>K.call(document,e,129),Y=(e,t,n)=>((e,t,n,r,o)=>{const s=n.length;let l=t.length,a=s,c=0,u=0,i=null;for(;c<l||u<a;)if(l===c){const t=a<s?u?r(n[u-1],-0).nextSibling:r(n[a-u],0):o;for(;u<a;)e.insertBefore(r(n[u++],1),t)}else if(a===u)for(;c<l;)i&&i.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[u])c++,u++;else if(t[l-1]===n[a-1])l--,a--;else if(t[c]===n[a-1]&&n[u]===t[l-1]){const o=r(t[--l],-1).nextSibling;e.insertBefore(r(n[u++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--a],1),o),t[l]=n[a]}else{if(!i){i=new Map;let e=u;for(;e<a;)i.set(n[e],e++)}if(i.has(t[c])){const o=i.get(t[c]);if(u<o&&o<a){let s=c,f=1;for(;++s<l&&s<a&&i.get(t[s])===o+f;)f++;if(f>o-u){const s=r(t[c],0);for(;u<o;)e.insertBefore(r(n[u++],1),s)}else e.replaceChild(r(n[u++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,t,n,I,e),Z=(e,t)=>"ref"===t?(e=>t=>{"function"==typeof t?t(e):t.current=e})(e):"aria"===t?(e=>t=>{for(const n in t){const r="role"===n?n:"aria-"+n,o=t[n];null==o?e.removeAttribute(r):e.setAttribute(r,o)}})(e):".dataset"===t?(({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}})(e):"."===t.slice(0,1)?((e,t)=>n=>{e[t]=n})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const o=H(t)?t:[t,!1];n!==o[0]&&(n&&e.removeEventListener(r,n,o[1]),(n=o[0])&&e.addEventListener(r,n,o[1]))}})(e,t):((e,t)=>{let n,r=!0;const o=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(o),r=!0):(o.value=t,r&&(e.setAttributeNodeNS(o),r=!1)))}})(e,t);function ee(e){const{type:t,path:n}=e,r=n.reduceRight(G,this);return"node"===t?(e=>{let t,n,r=[];const o=s=>{switch(typeof s){case"string":case"number":case"boolean":t!==s&&(t=s,n?n.textContent=s:n=document.createTextNode(s),r=Y(e,r,[n]));break;case"object":case"undefined":if(null==s){t!=s&&(t=s,r=Y(e,r,[]));break}if(H(s)){t=s,0===s.length?r=Y(e,r,[]):"object"==typeof s[0]?r=Y(e,r,s):o(String(s));break}"ELEMENT_NODE"in s&&t!==s&&(t=s,r=Y(e,r,11===s.nodeType?q.call(s.childNodes):[s]))}};return o})(r):"attr"===t?Z(r,e.name):(e=>{let t;return n=>{t!=n&&(t=n,e.textContent=null==n?"":n)}})(r)}const te="isµ",ne=a(new WeakMap),re=(e,t)=>{const n=((e,t,n)=>{const r=[],{length:o}=e;for(let n=1;n<o;n++){const o=e[n-1];r.push(O.test(o)&&B(e,n)?o.replace(O,(e,r,o)=>`${t}${n-1}=${o||'"'}${r}${o?"":'"'}`):`${o}\x3c!--${t}${n-1}--\x3e`)}r.push(e[o-1]);const s=r.join("").trim();return n?s:s.replace(R,F)})(t,te,"svg"===e),r=V(n,e),o=X(r),s=[],l=t.length-1;let a=0,c="isµ"+a;for(;a<l;){const e=o.nextNode();if(!e)throw"bad template: "+n;if(8===e.nodeType)e.textContent===c&&(s.push({type:"node",path:J(e)}),c="isµ"+ ++a);else{for(;e.hasAttribute(c);)s.push({type:"attr",path:J(e),name:e.getAttribute(c)}),e.removeAttribute(c),c="isµ"+ ++a;/^(?:style|textarea)$/i.test(e.tagName)&&e.textContent.trim()===`\x3c!--${c}--\x3e`&&(s.push({type:"text",path:J(e)}),c="isµ"+ ++a)}}return{content:r,nodes:s}},oe=(e,t)=>{const{content:n,nodes:r}=ne.get(t)||ne.set(t,re(e,t)),o=Q.call(document,n,!0);return{content:o,updates:r.map(ee,o)}},se=(e,{type:t,template:n,values:r})=>{const{length:o}=r;le(e,r,o);let{entry:s}=e;s&&s.template===n&&s.type===t||(e.entry=s=((e,t)=>{const{content:n,updates:r}=oe(e,t);return{type:e,template:t,content:n,updates:r,wire:null}})(t,n));const{content:l,updates:a,wire:c}=s;for(let e=0;e<o;e++)a[e](r[e]);return c||(s.wire=(e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=q.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf(){if(t.length!==n){let t=0;for(;t<n;)e.appendChild(r[t++])}return e}}})(l))},le=({stack:e},t,n)=>{for(let r=0;r<n;r++){const n=t[r];n instanceof ae?t[r]=se(e[r]||(e[r]={stack:[],entry:null,wire:null}),n):H(n)?le(e[r]||(e[r]={stack:[],entry:null,wire:null}),n,n.length):e[r]=null}n<e.length&&e.splice(n)};function ae(e,t,n){this.type=e,this.template=t,this.values=n}const{create:ce,defineProperties:ue}=Object,ie=e=>{const t=a(new WeakMap);return ue((t,...n)=>new ae(e,t,n),{for:{value(n,r){const o=t.get(n)||t.set(n,ce(null));return o[r]||(o[r]=(t=>(n,...r)=>se(t,{type:e,template:n,values:r}))({stack:[],entry:null,wire:null}))}},node:{value:(t,...n)=>se({stack:[],entry:null,wire:null},{type:e,template:t,values:n}).valueOf()}})},fe=a(new WeakMap),de=ie("html"),he=ie("svg"),{isArray:pe}=Array,{create:ge}=Object,ve=(e,...t)=>new ae("html",e,t);ve.for=xe(de);const me=(e,...t)=>new ae("svg",e,t);me.for=xe(he);const ye=a(new WeakMap),we=()=>({stack:[],entry:null}),ke=(e,{fn:t,template:n,values:r})=>{let{entry:o}=e;return o&&o.fn===t||(e.entry=o={fn:t,hook:null},o.hook=((e,t)=>S((function(){const n=t.fn.apply(null,arguments);return n instanceof ae?(be(e,n),Ce(t,n)):n})))(we(),o)),o.hook(n,...r)},be=(e,{values:t})=>{Ne(e,t,t.length)},Ne=({stack:e},t,n)=>{for(let r=0;r<n;r++){const n=t[r];n instanceof $e?t[r]=ke(e[r]||(e[r]=we()),n):n instanceof ae?be(e[r]||(e[r]=we()),n):pe(n)?Ne(e[r]||(e[r]=we()),n,n.length):e[r]=null}n<e.length&&e.splice(n)},Ce=(e,{type:t,template:n,values:r})=>("svg"===t?he:de).for(e,t)(n,...r);function $e(e,t,n){this.fn=e,this.template=t,this.values=n}function xe(e){const t=a(new WeakMap);return(n,r)=>{const o=t.get(n)||t.set(n,ge(null)),s=o[r]||(o[r]=we());return(t,...o)=>(Ne(s,o),e.for(n,r)(t,...o))}}return e.Component=function(e){return(t,...n)=>new $e(e,t,n)},e.contextual=e=>{let t=!0,n=null;const r=u((function(){return e.apply(n,arguments)}));return function e(){const o=r.apply(n=this,arguments);return t&&(t=!t,$(r)&&w.set(e,w.get(r))),o}},e.createContext=e=>{const t={value:e,provide:m};return g.set(t,[]),t},e.html=ve,e.render=(e,t)=>{const n="function"==typeof t?t():t,r=ye.get(e)||ye.set(e,we());return((e,t)=>{const n="function"==typeof t?t():t,r=fe.get(e)||fe.set(e,{stack:[],entry:null,wire:null}),o=n instanceof ae?se(r,n):n;return o!==r.wire&&(r.wire=o,e.textContent="",e.appendChild(o.valueOf())),e})(e,n instanceof $e?ke(r,n):(be(r,n),n))},e.svg=me,e.useCallback=(e,t)=>M(()=>e,t),e.useContext=e=>{const{hook:t,args:n}=c,r=g.get(e),o={hook:t,args:n};return r.some(y,o)||r.push(o),e.value},e.useEffect=x,e.useLayoutEffect=E,e.useMemo=M,e.useReducer=p,e.useRef=e=>{const t=c.i++,{stack:n,length:r}=c;return t===r&&(c.length=n.push({current:e})),n[t]},e.useState=(e,t)=>p(h,e,void 0,t),e}({}); | ||
self.I=function(e){var t="fragment",n="template",r="content"in l(n)?function(e){var t=l(n);return t.innerHTML=e,t.content}:function(e){var r=l(t),s=l(n),a=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;s.innerHTML="<table>"+e+"</table>",a=s.querySelectorAll(c)}else s.innerHTML=e,a=s.childNodes;return o(r,a),r};return function(e,t){return("svg"===t?s:r)(e)};function o(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function l(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function s(e){var n=l(t),r=l("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",o(n,r.firstChild.childNodes),n}}(document);const G=({childNodes:e},t)=>e[t],J=e=>{const t=[];let{parentNode:n}=e;for(;n;)t.push(z.call(n.childNodes,e)),n=(e=n).parentNode;return t},{createTreeWalker:K,importNode:Q}=document,U=1!=Q.length,V=U?(e,t)=>Q.call(document,I(e,t),!0):I,X=U?e=>K.call(document,e,129,null,!1):e=>K.call(document,e,129),Y=(e,t,n)=>((e,t,n,r,o)=>{const l=n.length;let s=t.length,a=l,c=0,u=0,i=null;for(;c<s||u<a;)if(s===c){const t=a<l?u?r(n[u-1],-0).nextSibling:r(n[a-u],0):o;for(;u<a;)e.insertBefore(r(n[u++],1),t)}else if(a===u)for(;c<s;)i&&i.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[u])c++,u++;else if(t[s-1]===n[a-1])s--,a--;else if(t[c]===n[a-1]&&n[u]===t[s-1]){const o=r(t[--s],-1).nextSibling;e.insertBefore(r(n[u++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--a],1),o),t[s]=n[a]}else{if(!i){i=new Map;let e=u;for(;e<a;)i.set(n[e],e++)}if(i.has(t[c])){const o=i.get(t[c]);if(u<o&&o<a){let l=c,f=1;for(;++l<s&&l<a&&i.get(t[l])===o+f;)f++;if(f>o-u){const l=r(t[c],0);for(;u<o;)e.insertBefore(r(n[u++],1),l)}else e.replaceChild(r(n[u++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,t,n,P,e),Z=(e,t)=>"ref"===t?(e=>t=>{"function"==typeof t?t(e):t.current=e})(e):"aria"===t?(e=>t=>{for(const n in t){const r="role"===n?n:"aria-"+n,o=t[n];null==o?e.removeAttribute(r):e.setAttribute(r,o)}})(e):".dataset"===t?(({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}})(e):"."===t.slice(0,1)?((e,t)=>n=>{e[t]=n})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const o=H(t)?t:[t,!1];n!==o[0]&&(n&&e.removeEventListener(r,n,o[1]),(n=o[0])&&e.addEventListener(r,n,o[1]))}})(e,t):((e,t)=>{let n,r=!0;const o=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(o),r=!0):(o.value=t,r&&(e.setAttributeNodeNS(o),r=!1)))}})(e,t);function ee(e){const{type:t,path:n}=e,r=n.reduceRight(G,this);return"node"===t?(e=>{let t,n,r=[];const o=l=>{switch(typeof l){case"string":case"number":case"boolean":t!==l&&(t=l,n?n.textContent=l:n=document.createTextNode(l),r=Y(e,r,[n]));break;case"object":case"undefined":if(null==l){t!=l&&(t=l,r=Y(e,r,[]));break}if(H(l)){t=l,0===l.length?r=Y(e,r,[]):"object"==typeof l[0]?r=Y(e,r,l):o(String(l));break}"ELEMENT_NODE"in l&&t!==l&&(t=l,r=Y(e,r,11===l.nodeType?q.call(l.childNodes):[l]))}};return o})(r):"attr"===t?Z(r,e.name):(e=>{let t;return n=>{t!=n&&(t=n,e.textContent=null==n?"":n)}})(r)}const te="isµ",ne=a(new WeakMap),re=(e,t)=>{const n=((e,t,n)=>{const r=[],{length:o}=e;for(let n=1;n<o;n++){const o=e[n-1];r.push(O.test(o)&&B(e,n)?o.replace(O,((e,r,o)=>`${t}${n-1}=${o||'"'}${r}${o?"":'"'}`)):`${o}\x3c!--${t}${n-1}--\x3e`)}r.push(e[o-1]);const l=r.join("").trim();return n?l:l.replace(D,F)})(t,te,"svg"===e),r=V(n,e),o=X(r),l=[],s=t.length-1;let a=0,c="isµ"+a;for(;a<s;){const e=o.nextNode();if(!e)throw"bad template: "+n;if(8===e.nodeType)e.textContent===c&&(l.push({type:"node",path:J(e)}),c="isµ"+ ++a);else{for(;e.hasAttribute(c);)l.push({type:"attr",path:J(e),name:e.getAttribute(c)}),e.removeAttribute(c),c="isµ"+ ++a;/^(?:style|textarea)$/i.test(e.tagName)&&e.textContent.trim()===`\x3c!--${c}--\x3e`&&(l.push({type:"text",path:J(e)}),c="isµ"+ ++a)}}return{content:r,nodes:l}},oe=(e,t)=>{const{content:n,nodes:r}=ne.get(t)||ne.set(t,re(e,t)),o=Q.call(document,n,!0);return{content:o,updates:r.map(ee,o)}},le=(e,{type:t,template:n,values:r})=>{const{length:o}=r;se(e,r,o);let{entry:l}=e;l&&l.template===n&&l.type===t||(e.entry=l=((e,t)=>{const{content:n,updates:r}=oe(e,t);return{type:e,template:t,content:n,updates:r,wire:null}})(t,n));const{content:s,updates:a,wire:c}=l;for(let e=0;e<o;e++)a[e](r[e]);return c||(l.wire=(e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=q.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf(){if(t.length!==n){let t=0;for(;t<n;)e.appendChild(r[t++])}return e}}})(s))},se=({stack:e},t,n)=>{for(let r=0;r<n;r++){const n=t[r];n instanceof ae?t[r]=le(e[r]||(e[r]={stack:[],entry:null,wire:null}),n):H(n)?se(e[r]||(e[r]={stack:[],entry:null,wire:null}),n,n.length):e[r]=null}n<e.length&&e.splice(n)};function ae(e,t,n){this.type=e,this.template=t,this.values=n}const{create:ce,defineProperties:ue}=Object,ie=e=>{const t=a(new WeakMap);return ue(((t,...n)=>new ae(e,t,n)),{for:{value(n,r){const o=t.get(n)||t.set(n,ce(null));return o[r]||(o[r]=(t=>(n,...r)=>le(t,{type:e,template:n,values:r}))({stack:[],entry:null,wire:null}))}},node:{value:(t,...n)=>le({stack:[],entry:null,wire:null},{type:e,template:t,values:n}).valueOf()}})},fe=a(new WeakMap),de=ie("html"),pe=ie("svg"),{isArray:he}=Array,{create:ge}=Object,ve=(e,...t)=>new ae("html",e,t);ve.for=Te(de);const me=(e,...t)=>new ae("svg",e,t);me.for=Te(pe);const ye=a(new WeakMap),we=(e,t)=>{const n="function"==typeof t?t():t,r=ye.get(e)||ye.set(e,Ne(null));return r.w=e,r.W=t,((e,t)=>{const n="function"==typeof t?t():t,r=fe.get(e)||fe.set(e,{stack:[],entry:null,wire:null}),o=n instanceof ae?le(r,n):n;return o!==r.wire&&(r.wire=o,e.textContent="",e.appendChild(o.valueOf())),e})(e,n instanceof Me?Ce(r,n):($e(r,n),n))};let ke=!1;const be=(e,t)=>{t!==e.node&&(e.node&&(ke=!0),e.node=t)},Ne=e=>({p:e,stack:[],entry:null}),Ce=(e,{fn:t,template:n,values:r})=>{let{entry:o}=e;return o&&o.fn===t||(e.entry=o={fn:t,hook:null,node:null},o.hook=((e,t)=>S((function(){const n=t.fn.apply(null,arguments);n instanceof ae?($e(e,n),be(t,Ee(t,n))):be(t,n);try{return t.node}finally{if(ke){ke=!1;let t=e;for(;t.p;)t=t.p;we(t.w,t.W)}}})))(Ne(e),o)),o.hook(n,...r)},$e=(e,{values:t})=>{xe(e,t,t.length)},xe=(e,t,n)=>{const{stack:r}=e;for(let o=0;o<n;o++){const n=t[o];n instanceof Me?t[o]=Ce(r[o]||(r[o]=Ne(e)),n):n instanceof ae?$e(r[o]||(r[o]=Ne(e)),n):he(n)?xe(r[o]||(r[o]=Ne(e)),n,n.length):r[o]=null}n<r.length&&r.splice(n)},Ee=(e,{type:t,template:n,values:r})=>("svg"===t?pe:de).for(e,t)(n,...r);function Me(e,t,n){this.fn=e,this.template=t,this.values=n}function Te(e){const t=a(new WeakMap);return(n,r)=>{const o=t.get(n)||t.set(n,ge(null)),l=o[r]||(o[r]=Ne(null));return(t,...o)=>(xe(l,o),e.for(n,r)(t,...o))}}return e.Component=function(e){return(t,...n)=>new Me(e,t,n)},e.contextual=e=>{let t=!0,n=null;const r=u((function(){return e.apply(n,arguments)}));return function e(){const o=r.apply(n=this,arguments);return t&&(t=!t,$(r)&&w.set(e,w.get(r))),o}},e.createContext=e=>{const t={value:e,provide:m};return g.set(t,[]),t},e.html=ve,e.render=we,e.svg=me,e.useCallback=(e,t)=>M((()=>e),t),e.useContext=e=>{const{hook:t,args:n}=c,r=g.get(e),o={hook:t,args:n};return r.some(y,o)||r.push(o),e.value},e.useEffect=x,e.useLayoutEffect=E,e.useMemo=M,e.useReducer=h,e.useRef=e=>{const t=c.i++,{stack:n,length:r}=c;return t===r&&(c.length=n.push({current:e})),n[t]},e.useState=(e,t)=>h(p,e,void 0,t),Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
@@ -23,3 +23,5 @@ import {augmentor} from 'dom-augmentor'; | ||
const hook = typeof what === 'function' ? what() : what; | ||
const info = cache.get(where) || cache.set(where, createCache()); | ||
const info = cache.get(where) || cache.set(where, createCache(null)); | ||
info.w = where; | ||
info.W = what; | ||
return $render( | ||
@@ -47,2 +49,11 @@ where, | ||
let update = false; | ||
const updateEntry = (entry, node) => { | ||
if (node !== entry.node) { | ||
if (entry.node) | ||
update = true; | ||
entry.node = node; | ||
} | ||
}; | ||
const createHook = (info, entry) => augmentor(function () { | ||
@@ -52,8 +63,19 @@ const hole = entry.fn.apply(null, arguments); | ||
unrollHole(info, hole); | ||
return view(entry, hole); | ||
updateEntry(entry, view(entry, hole)); | ||
} | ||
return hole; | ||
else | ||
updateEntry(entry, hole); | ||
try { return entry.node; } | ||
finally { | ||
if (update) { | ||
update = false; | ||
let p = info; | ||
while (p.p) | ||
p = p.p; | ||
render(p.w, p.W); | ||
} | ||
} | ||
}); | ||
const createCache = () => ({stack: [], entry: null}); | ||
const createCache = p => ({p, stack: [], entry: null}); | ||
@@ -63,4 +85,4 @@ const unroll = (info, {fn, template, values}) => { | ||
if (!entry || entry.fn !== fn) { | ||
info.entry = (entry = {fn, hook: null}); | ||
entry.hook = createHook(createCache(), entry); | ||
info.entry = (entry = {fn, hook: null, node: null}); | ||
entry.hook = createHook(createCache(info), entry); | ||
} | ||
@@ -74,11 +96,12 @@ return entry.hook(template, ...values); | ||
const unrollValues = ({stack}, values, length) => { | ||
const unrollValues = (info, values, length) => { | ||
const {stack} = info; | ||
for (let i = 0; i < length; i++) { | ||
const hook = values[i]; | ||
if (hook instanceof Hook) | ||
values[i] = unroll(stack[i] || (stack[i] = createCache()), hook); | ||
values[i] = unroll(stack[i] || (stack[i] = createCache(info)), hook); | ||
else if (hook instanceof Hole) | ||
unrollHole(stack[i] || (stack[i] = createCache()), hook); | ||
unrollHole(stack[i] || (stack[i] = createCache(info)), hook); | ||
else if (isArray(hook)) | ||
unrollValues(stack[i] || (stack[i] = createCache()), hook, hook.length); | ||
unrollValues(stack[i] || (stack[i] = createCache(info)), hook, hook.length); | ||
else | ||
@@ -110,3 +133,3 @@ stack[i] = null; | ||
const store = cache.get(entry) || cache.set(entry, create(null)); | ||
const info = store[id] || (store[id] = createCache()); | ||
const info = store[id] || (store[id] = createCache(null)); | ||
return (template, ...values) => { | ||
@@ -113,0 +136,0 @@ unrollValues(info, values); |
57
index.js
@@ -1369,6 +1369,16 @@ self.uland = (function (exports) { | ||
var hook = typeof what === 'function' ? what() : what; | ||
var info = cache$2.get(where) || cache$2.set(where, createCache$1()); | ||
var info = cache$2.get(where) || cache$2.set(where, createCache$1(null)); | ||
info.w = where; | ||
info.W = what; | ||
return render(where, hook instanceof Hook ? unroll$1(info, hook) : (unrollHole(info, hook), hook)); | ||
}; | ||
var update$1 = false; | ||
var updateEntry = function updateEntry(entry, node) { | ||
if (node !== entry.node) { | ||
if (entry.node) update$1 = true; | ||
entry.node = node; | ||
} | ||
}; | ||
var createHook = function createHook(info, entry) { | ||
@@ -1380,11 +1390,25 @@ return augmentor$1(function () { | ||
unrollHole(info, hole); | ||
return view(entry, hole); | ||
updateEntry(entry, view(entry, hole)); | ||
} else updateEntry(entry, hole); | ||
try { | ||
return entry.node; | ||
} finally { | ||
if (update$1) { | ||
update$1 = false; | ||
var p = info; | ||
while (p.p) { | ||
p = p.p; | ||
} | ||
render$1(p.w, p.W); | ||
} | ||
} | ||
return hole; | ||
}); | ||
}; | ||
var createCache$1 = function createCache() { | ||
var createCache$1 = function createCache(p) { | ||
return { | ||
p: p, | ||
stack: [], | ||
@@ -1406,5 +1430,6 @@ entry: null | ||
fn: fn, | ||
hook: null | ||
hook: null, | ||
node: null | ||
}; | ||
entry.hook = createHook(createCache$1(), entry); | ||
entry.hook = createHook(createCache$1(info), entry); | ||
} | ||
@@ -1420,8 +1445,8 @@ | ||
var unrollValues$1 = function unrollValues(_ref3, values, length) { | ||
var stack = _ref3.stack; | ||
var unrollValues$1 = function unrollValues(info, values, length) { | ||
var stack = info.stack; | ||
for (var i = 0; i < length; i++) { | ||
var hook = values[i]; | ||
if (hook instanceof Hook) values[i] = unroll$1(stack[i] || (stack[i] = createCache$1()), hook);else if (hook instanceof Hole) unrollHole(stack[i] || (stack[i] = createCache$1()), hook);else if (isArray$1(hook)) unrollValues(stack[i] || (stack[i] = createCache$1()), hook, hook.length);else stack[i] = null; | ||
if (hook instanceof Hook) values[i] = unroll$1(stack[i] || (stack[i] = createCache$1(info)), hook);else if (hook instanceof Hole) unrollHole(stack[i] || (stack[i] = createCache$1(info)), hook);else if (isArray$1(hook)) unrollValues(stack[i] || (stack[i] = createCache$1(info)), hook, hook.length);else stack[i] = null; | ||
} | ||
@@ -1432,6 +1457,6 @@ | ||
var view = function view(entry, _ref4) { | ||
var type = _ref4.type, | ||
template = _ref4.template, | ||
values = _ref4.values; | ||
var view = function view(entry, _ref3) { | ||
var type = _ref3.type, | ||
template = _ref3.template, | ||
values = _ref3.values; | ||
return (type === 'svg' ? svg : html)["for"](entry, type).apply(void 0, [template].concat(_toConsumableArray(values))); | ||
@@ -1460,3 +1485,3 @@ }; | ||
var store = cache.get(entry) || cache.set(entry, create$1(null)); | ||
var info = store[id] || (store[id] = createCache$1()); | ||
var info = store[id] || (store[id] = createCache$1(null)); | ||
return function (template) { | ||
@@ -1488,4 +1513,6 @@ for (var _len4 = arguments.length, values = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
return exports; | ||
}({})); |
12
min.js
@@ -1,6 +0,6 @@ | ||
self.uland=function(t){"use strict";function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")} | ||
/*! (c) Andrea Giammarchi - ISC */()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var r={};r.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(t){return e[t]=new e("").constructor[t],e;function e(t,e){e||(e={});var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!!e.bubbles,!!e.cancelable,e.detail),n}}("prototype");var a=r.CustomEvent,o={}; | ||
/*! (c) Andrea Giammarchi - ISC */try{o.WeakSet=WeakSet}catch(t){!function(t){var e=new t,n=r.prototype;function r(n){e.set(this,new t),n&&n.forEach(this.add,this)}n.add=function(t){return e.get(this).set(t,1),this},n.delete=function(t){return e.get(this).delete(t)},n.has=function(t){return e.get(this).has(t)},o.WeakSet=r}(WeakMap)}var u=o.WeakSet; | ||
/*! (c) Andrea Giammarchi */var i="function"==typeof cancelAnimationFrame,c=i?cancelAnimationFrame:clearTimeout,l=i?requestAnimationFrame:setTimeout;function f(t){var e,n,r,a,o;return f(),function(t,i,c){return r=t,a=i,o=c,n||(n=l(u)),--e<0&&s(!0),s};function u(){f(),r.apply(a,o||[])}function f(){e=t||1/0,n=i?0:null}function s(t){var e=!!n;return e&&(c(n),t&&u()),e}}var s=function(t){return{get:function(e){return t.get(e)},set:function(e,n){return t.set(e,n),n}}},v=null,d=function(t){var e=[];return function n(){var r=v,a=[];v={hook:n,args:arguments,stack:e,i:0,length:e.length,after:a};try{return t.apply(null,arguments)}finally{v=r;for(var o=0,u=a.length;o<u;o++)a[o]()}}},h=s(new WeakMap),p=function(t,e,n){t.apply(e,n)},g={async:!1,always:!1},y=function(t,e){return"function"==typeof e?e(t):e},m=function(t,e,n,r){var a=v.i++,o=v,u=o.hook,i=o.args,c=o.stack,l=o.length;a===l&&(v.length=c.push({}));var s=c[a];if(s.args=i,a===l){var d="function"==typeof n,m=(d?r:n)||r||g,w=m.async,b=m.always;s.$=d?n(e):y(void 0,e),s._=w?h.get(u)||h.set(u,f()):p,s.f=function(e){var n=t(s.$,e);(b||s.$!==n)&&(s.$=n,s._(u,null,s.args))}}return[s.$,s.f]},w=new WeakMap,b=function(t){var e=t.hook,n=t.args;e.apply(null,n)}; | ||
/*! (c) Andrea Giammarchi - ISC */function k(t){this.value!==t&&(this.value=t,w.get(this).forEach(b))}function C(t){return t.hook===this.hook}var A=new WeakMap,E=s(A),N=function(){},x=function(t){return function(e,n){var r=v.i++,a=v,o=a.hook,u=a.after,i=a.stack;if(r<a.length){var c=i[r],l=c.update,s=c.values,d=c.stop;if(!n||n.some($,s)){c.values=n,t&&d(t);var h=c.clean;h&&(c.clean=null,h());var p=function(){c.clean=e()};t?l(p):u.push(p)}}else{var g=t?f():N,y={clean:null,update:g,values:n,stop:N};v.length=i.push(y),(E.get(o)||E.set(o,[])).push(y);var m=function(){y.clean=e()};t?y.stop=g(m):u.push(m)}}},S=function(t){(A.get(t)||[]).forEach((function(t){var e=t.clean;(0,t.stop)(),e&&(t.clean=null,e())}))},M=A.has.bind(A),T=x(!0),O=x(!1),W=function(t,e){var n=v.i++,r=v,a=r.stack;return n===r.length?v.length=a.push({$:t(),_:e}):e&&!e.some($,a[n]._)||(a[n]={$:t(),_:e}),a[n].$};function $(t,e){return t!==this[e]} | ||
/*! (c) Andrea Giammarchi - ISC */var L=function(t){var e=t.Event,n=t.WeakSet,r=!0,a=null;return function(t){return r&&(r=!r,a=new n,function(t){var r=new n,o=new n;try{new MutationObserver(l).observe(t,{subtree:!0,childList:!0})}catch(e){var u=0,i=[],c=function(t){i.push(t),clearTimeout(u),u=setTimeout((function(){l(i.splice(u=0,i.length))}),0)};t.addEventListener("DOMNodeRemoved",(function(t){c({addedNodes:[],removedNodes:[t.target]})}),!0),t.addEventListener("DOMNodeInserted",(function(t){c({addedNodes:[t.target],removedNodes:[]})}),!0)}function l(t){for(var e,n=t.length,a=0;a<n;a++)f((e=t[a]).removedNodes,"disconnected",o,r),f(e.addedNodes,"connected",r,o)}function f(t,n,r,a){for(var o,u=new e(n),i=t.length,c=0;c<i;1===(o=t[c++]).nodeType&&s(o,u,n,r,a));}function s(t,e,n,r,o){a.has(t)&&!r.has(t)&&(o.delete(t),r.add(t),t.dispatchEvent(e));for(var u=t.children||[],i=u.length,c=0;c<i;s(u[c++],e,n,r,o));}}(t.ownerDocument)),a.add(t),t}}({Event:a,WeakSet:u}),j=function t(e,n){var r=e.nodeType;if(r){var a=1===r?e:function(t){for(var e=t.firstChild;e&&1!==e.nodeType;)e=e.nextSibling;if(e)return e;throw"unobservable"}(e);L(a),a.addEventListener("disconnected",n,!1)}else{var o=e.valueOf();o!==e&&t(o,n)}},_=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,R=/<[a-z][^>]+$/i,B=/>[^<>]*$/,F=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,H=/\s+$/,I=function(t,e,n){return D.test(e)?t:"<".concat(e).concat(n.replace(H,""),"></").concat(e,">")},z=function(t,e,n){for(var r=[],a=t.length,o=function(n){var a=t[n-1];r.push(_.test(a)&&function t(e,n){return 0<n--&&(R.test(e[n])||!B.test(e[n])&&t(e,n))}(t,n)?a.replace(_,(function(t,r,a){return"".concat(e).concat(n-1,"=").concat(a||'"').concat(r).concat(a?"":'"')})):"".concat(a,"\x3c!--").concat(e).concat(n-1,"--\x3e"))},u=1;u<a;u++)o(u);r.push(t[a-1]);var i=r.join("").trim();return n?i:i.replace(F,I)},q=Array.isArray,P=[],U=P.indexOf,G=P.slice,J=function(t,e){return 111===t.nodeType?1/e<0?e?function(t){var e=t.firstChild,n=t.lastChild,r=document.createRange();return r.setStartAfter(e),r.setEndAfter(n),r.deleteContents(),e}(t):t.lastChild:e?t.valueOf():t.firstChild:t},K=function(t){var e="fragment",n="template",r="content"in o(n)?function(t){var e=o(n);return e.innerHTML=t,e.content}:function(t){var r=o(e),u=o(n),i=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(t)){var c=RegExp.$1;u.innerHTML="<table>"+t+"</table>",i=u.querySelectorAll(c)}else u.innerHTML=t,i=u.childNodes;return a(r,i),r};return function(t,e){return("svg"===e?u:r)(t)};function a(t,e){for(var n=e.length;n--;)t.appendChild(e[0])}function o(n){return n===e?t.createDocumentFragment():t.createElementNS("http://www.w3.org/1999/xhtml",n)}function u(t){var n=o(e),r=o("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t+"</svg>",a(n,r.firstChild.childNodes),n}}(document),Q=function(t,e){return t.childNodes[e]},V=function(t){for(var e=[],n=t.parentNode;n;)e.push(U.call(n.childNodes,t)),n=(t=n).parentNode;return e},X=document,Y=X.createTreeWalker,Z=X.importNode,tt=1!=Z.length,et=tt?function(t,e){return Z.call(document,K(t,e),!0)}:K,nt=tt?function(t){return Y.call(document,t,129,null,!1)}:function(t){return Y.call(document,t,129)},rt=function(t,e,n){return function(t,e,n,r,a){for(var o=n.length,u=e.length,i=o,c=0,l=0,f=null;c<u||l<i;)if(u===c)for(var s=i<o?l?r(n[l-1],-0).nextSibling:r(n[i-l],0):a;l<i;)t.insertBefore(r(n[l++],1),s);else if(i===l)for(;c<u;)f&&f.has(e[c])||t.removeChild(r(e[c],-1)),c++;else if(e[c]===n[l])c++,l++;else if(e[u-1]===n[i-1])u--,i--;else if(e[c]===n[i-1]&&n[l]===e[u-1]){var v=r(e[--u],-1).nextSibling;t.insertBefore(r(n[l++],1),r(e[c++],-1).nextSibling),t.insertBefore(r(n[--i],1),v),e[u]=n[i]}else{if(!f){f=new Map;for(var d=l;d<i;)f.set(n[d],d++)}if(f.has(e[c])){var h=f.get(e[c]);if(l<h&&h<i){for(var p=c,g=1;++p<u&&p<i&&f.get(e[p])===h+g;)g++;if(g>h-l)for(var y=r(e[c],0);l<h;)t.insertBefore(r(n[l++],1),y);else t.replaceChild(r(n[l++],1),r(e[c++],-1))}else c++}else t.removeChild(r(e[c++],-1))}return n}(t.parentNode,e,n,J,t)},at=function(t,e){return"ref"===e?function(t){return function(e){"function"==typeof e?e(t):e.current=t}}(t):"aria"===e?function(t){return function(e){for(var n in e){var r="role"===n?n:"aria-".concat(n),a=e[n];null==a?t.removeAttribute(r):t.setAttribute(r,a)}}}(t):".dataset"===e?function(t){var e=t.dataset;return function(t){for(var n in t){var r=t[n];null==r?delete e[n]:e[n]=r}}}(t):"."===e.slice(0,1)?function(t,e){return function(n){t[e]=n}}(t,e.slice(1)):"on"===e.slice(0,2)?function(t,e){var n,r=e.slice(2);return!(e in t)&&e.toLowerCase()in t&&(r=r.toLowerCase()),function(e){var a=q(e)?e:[e,!1];n!==a[0]&&(n&&t.removeEventListener(r,n,a[1]),(n=a[0])&&t.addEventListener(r,n,a[1]))}}(t,e):function(t,e){var n,r=!0,a=document.createAttributeNS(null,e);return function(e){n!==e&&(null==(n=e)?r||(t.removeAttributeNode(a),r=!0):(a.value=e,r&&(t.setAttributeNodeNS(a),r=!1)))}}(t,e)};function ot(t){var e=t.type,n=t.path.reduceRight(Q,this);return"node"===e?function(t){var e,n,r=[];return function a(o){switch(typeof o){case"string":case"number":case"boolean":e!==o&&(e=o,n?n.textContent=o:n=document.createTextNode(o),r=rt(t,r,[n]));break;case"object":case"undefined":if(null==o){e!=o&&(e=o,r=rt(t,r,[]));break}if(q(o)){e=o,0===o.length?r=rt(t,r,[]):"object"==typeof o[0]?r=rt(t,r,o):a(String(o));break}"ELEMENT_NODE"in o&&e!==o&&(e=o,r=rt(t,r,11===o.nodeType?G.call(o.childNodes):[o]))}}}(n):"attr"===e?at(n,t.name):function(t){var e;return function(n){e!=n&&(e=n,t.textContent=null==n?"":n)}}(n)}var ut="isµ",it=s(new WeakMap),ct=function(t,e){var n=it.get(e)||it.set(e,function(t,e){for(var n=z(e,ut,"svg"===t),r=et(n,t),a=nt(r),o=[],u=e.length-1,i=0,c="".concat(ut).concat(i);i<u;){var l=a.nextNode();if(!l)throw"bad template: ".concat(n);if(8===l.nodeType)l.textContent===c&&(o.push({type:"node",path:V(l)}),c="".concat(ut).concat(++i));else{for(;l.hasAttribute(c);)o.push({type:"attr",path:V(l),name:l.getAttribute(c)}),l.removeAttribute(c),c="".concat(ut).concat(++i);/^(?:style|textarea)$/i.test(l.tagName)&&l.textContent.trim()==="\x3c!--".concat(c,"--\x3e")&&(o.push({type:"text",path:V(l)}),c="".concat(ut).concat(++i))}}return{content:r,nodes:o}}(t,e)),r=n.content,a=n.nodes,o=Z.call(document,r,!0);return{content:o,updates:a.map(ot,o)}},lt=function(t,e){var n=e.type,r=e.template,a=e.values,o=a.length;ft(t,a,o);var u=t.entry;u&&u.template===r&&u.type===n||(t.entry=u=function(t,e){var n=ct(t,e);return{type:t,template:e,content:n.content,updates:n.updates,wire:null}}(n,r));for(var i=u,c=i.content,l=i.updates,f=i.wire,s=0;s<o;s++)l[s](a[s]);return f||(u.wire=function(t){var e=t.childNodes,n=e.length;if(n<2)return n?e[0]:t;var r=G.call(e,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf:function(){if(e.length!==n)for(var a=0;a<n;)t.appendChild(r[a++]);return t}}}(c))},ft=function t(e,n,r){for(var a=e.stack,o=0;o<r;o++){var u=n[o];u instanceof st?n[o]=lt(a[o]||(a[o]={stack:[],entry:null,wire:null}),u):q(u)?t(a[o]||(a[o]={stack:[],entry:null,wire:null}),u,u.length):a[o]=null}r<a.length&&a.splice(r)};function st(t,e,n){this.type=t,this.template=e,this.values=n}var vt=Object.create,dt=Object.defineProperties,ht=function(t){var e=s(new WeakMap);return dt((function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new st(t,e,r)}),{for:{value:function(n,r){var a=e.get(n)||e.set(n,vt(null));return a[r]||(a[r]=function(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return lt(e,{type:t,template:n,values:a})}}({stack:[],entry:null,wire:null}))}},node:{value:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return lt({stack:[],entry:null,wire:null},{type:t,template:e,values:r}).valueOf()}}})},pt=s(new WeakMap),gt=ht("html"),yt=ht("svg"),mt=Array.isArray,wt=Object.create,bt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new st("html",t,n)};bt.for=Ot(gt);var kt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new st("svg",t,n)};kt.for=Ot(yt);var Ct=s(new WeakMap),At=function(t,e){return n=null,r=d((function(){var n=e.fn.apply(null,arguments);return n instanceof st?(xt(t,n),Mt(e,n)):n})),function(){var t=r.apply(this,arguments);return M(r)&&j(t,n||(n=S.bind(null,r))),t};var n,r},Et=function(){return{stack:[],entry:null}},Nt=function(t,n){var r,a=n.fn,o=n.template,u=n.values,i=t.entry;return i&&i.fn===a||(t.entry=i={fn:a,hook:null},i.hook=At(Et(),i)),(r=i).hook.apply(r,[o].concat(e(u)))},xt=function(t,e){var n=e.values;St(t,n,n.length)},St=function t(e,n,r){for(var a=e.stack,o=0;o<r;o++){var u=n[o];u instanceof Tt?n[o]=Nt(a[o]||(a[o]=Et()),u):u instanceof st?xt(a[o]||(a[o]=Et()),u):mt(u)?t(a[o]||(a[o]=Et()),u,u.length):a[o]=null}r<a.length&&a.splice(r)},Mt=function(t,n){var r=n.type,a=n.template,o=n.values;return("svg"===r?yt:gt).for(t,r).apply(void 0,[a].concat(e(o)))};function Tt(t,e,n){this.fn=t,this.template=e,this.values=n}function Ot(t){var e=s(new WeakMap);return function(n,r){var a=e.get(n)||e.set(n,wt(null)),o=a[r]||(a[r]=Et());return function(e){for(var a=arguments.length,u=new Array(a>1?a-1:0),i=1;i<a;i++)u[i-1]=arguments[i];return St(o,u),t.for(n,r).apply(void 0,[e].concat(u))}}}return t.Component=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new Tt(t,e,r)}},t.contextual=function(t){var e=!0,n=null,r=d((function(){return t.apply(n,arguments)}));return function t(){var a=r.apply(n=this,arguments);return e&&(e=!e,M(r)&&A.set(t,A.get(r))),a}},t.createContext=function(t){var e={value:t,provide:k};return w.set(e,[]),e},t.html=bt,t.render=function(t,e){var n="function"==typeof e?e():e,r=Ct.get(t)||Ct.set(t,Et());return function(t,e){var n="function"==typeof e?e():e,r=pt.get(t)||pt.set(t,{stack:[],entry:null,wire:null}),a=n instanceof st?lt(r,n):n;return a!==r.wire&&(r.wire=a,t.textContent="",t.appendChild(a.valueOf())),t}(t,n instanceof Tt?Nt(r,n):(xt(r,n),n))},t.svg=kt,t.useCallback=function(t,e){return W((function(){return t}),e)},t.useContext=function(t){var e=v,n=e.hook,r=e.args,a=w.get(t),o={hook:n,args:r};return a.some(C,o)||a.push(o),t.value},t.useEffect=T,t.useLayoutEffect=O,t.useMemo=W,t.useReducer=m,t.useRef=function(t){var e=v.i++,n=v,r=n.stack;return e===n.length&&(v.length=r.push({current:t})),r[e]},t.useState=function(t,e){return m(y,t,void 0,e)},t}({}); | ||
self.uland=function(e){"use strict";function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")} | ||
/*! (c) Andrea Giammarchi - ISC */()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var r={};r.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(e){return t[e]=new t("").constructor[e],t;function t(e,t){t||(t={});var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}}("prototype");var a=r.CustomEvent,o={}; | ||
/*! (c) Andrea Giammarchi - ISC */try{o.WeakSet=WeakSet}catch(e){!function(e){var t=new e,n=r.prototype;function r(n){t.set(this,new e),n&&n.forEach(this.add,this)}n.add=function(e){return t.get(this).set(e,1),this},n.delete=function(e){return t.get(this).delete(e)},n.has=function(e){return t.get(this).has(e)},o.WeakSet=r}(WeakMap)}var u=o.WeakSet; | ||
/*! (c) Andrea Giammarchi */var i="function"==typeof cancelAnimationFrame,c=i?cancelAnimationFrame:clearTimeout,l=i?requestAnimationFrame:setTimeout;function f(e){var t,n,r,a,o;return f(),function(e,i,c){return r=e,a=i,o=c,n||(n=l(u)),--t<0&&s(!0),s};function u(){f(),r.apply(a,o||[])}function f(){t=e||1/0,n=i?0:null}function s(e){var t=!!n;return t&&(c(n),e&&u()),t}}var s=function(e){return{get:function(t){return e.get(t)},set:function(t,n){return e.set(t,n),n}}},v=null,d=function(e){var t=[];return function n(){var r=v,a=[];v={hook:n,args:arguments,stack:t,i:0,length:t.length,after:a};try{return e.apply(null,arguments)}finally{v=r;for(var o=0,u=a.length;o<u;o++)a[o]()}}},p=s(new WeakMap),h=function(e,t,n){e.apply(t,n)},g={async:!1,always:!1},y=function(e,t){return"function"==typeof t?t(e):t},m=function(e,t,n,r){var a=v.i++,o=v,u=o.hook,i=o.args,c=o.stack,l=o.length;a===l&&(v.length=c.push({}));var s=c[a];if(s.args=i,a===l){var d="function"==typeof n,m=(d?r:n)||r||g,w=m.async,b=m.always;s.$=d?n(t):y(void 0,t),s._=w?p.get(u)||p.set(u,f()):h,s.f=function(t){var n=e(s.$,t);(b||s.$!==n)&&(s.$=n,s._(u,null,s.args))}}return[s.$,s.f]},w=new WeakMap,b=function(e){var t=e.hook,n=e.args;t.apply(null,n)}; | ||
/*! (c) Andrea Giammarchi - ISC */function k(e){this.value!==e&&(this.value=e,w.get(this).forEach(b))}function C(e){return e.hook===this.hook}var A=new WeakMap,E=s(A),N=function(){},x=function(e){return function(t,n){var r=v.i++,a=v,o=a.hook,u=a.after,i=a.stack;if(r<a.length){var c=i[r],l=c.update,s=c.values,d=c.stop;if(!n||n.some($,s)){c.values=n,e&&d(e);var p=c.clean;p&&(c.clean=null,p());var h=function(){c.clean=t()};e?l(h):u.push(h)}}else{var g=e?f():N,y={clean:null,update:g,values:n,stop:N};v.length=i.push(y),(E.get(o)||E.set(o,[])).push(y);var m=function(){y.clean=t()};e?y.stop=g(m):u.push(m)}}},S=function(e){(A.get(e)||[]).forEach((function(e){var t=e.clean;(0,e.stop)(),t&&(e.clean=null,t())}))},M=A.has.bind(A),T=x(!0),O=x(!1),W=function(e,t){var n=v.i++,r=v,a=r.stack;return n===r.length?v.length=a.push({$:e(),_:t}):t&&!t.some($,a[n]._)||(a[n]={$:e(),_:t}),a[n].$};function $(e,t){return e!==this[t]} | ||
/*! (c) Andrea Giammarchi - ISC */var L=function(e){var t=e.Event,n=e.WeakSet,r=!0,a=null;return function(e){return r&&(r=!r,a=new n,function(e){var r=new n,o=new n;try{new MutationObserver(l).observe(e,{subtree:!0,childList:!0})}catch(t){var u=0,i=[],c=function(e){i.push(e),clearTimeout(u),u=setTimeout((function(){l(i.splice(u=0,i.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){c({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){c({addedNodes:[e.target],removedNodes:[]})}),!0)}function l(e){for(var t,n=e.length,a=0;a<n;a++)f((t=e[a]).removedNodes,"disconnected",o,r),f(t.addedNodes,"connected",r,o)}function f(e,n,r,a){for(var o,u=new t(n),i=e.length,c=0;c<i;1===(o=e[c++]).nodeType&&s(o,u,n,r,a));}function s(e,t,n,r,o){a.has(e)&&!r.has(e)&&(o.delete(e),r.add(e),e.dispatchEvent(t));for(var u=e.children||[],i=u.length,c=0;c<i;s(u[c++],t,n,r,o));}}(e.ownerDocument)),a.add(e),e}}({Event:a,WeakSet:u}),j=function e(t,n){var r=t.nodeType;if(r){var a=1===r?t:function(e){for(var t=e.firstChild;t&&1!==t.nodeType;)t=t.nextSibling;if(t)return t;throw"unobservable"}(t);L(a),a.addEventListener("disconnected",n,!1)}else{var o=t.valueOf();o!==t&&e(o,n)}},_=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,R=/<[a-z][^>]+$/i,B=/>[^<>]*$/,F=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,H=/\s+$/,I=function e(t,n){return 0<n--&&(R.test(t[n])||!B.test(t[n])&&e(t,n))},z=function(e,t,n){return D.test(t)?e:"<".concat(t).concat(n.replace(H,""),"></").concat(t,">")},q=function(e,t,n){for(var r=[],a=e.length,o=function(n){var a=e[n-1];r.push(_.test(a)&&I(e,n)?a.replace(_,(function(e,r,a){return"".concat(t).concat(n-1,"=").concat(a||'"').concat(r).concat(a?"":'"')})):"".concat(a,"\x3c!--").concat(t).concat(n-1,"--\x3e"))},u=1;u<a;u++)o(u);r.push(e[a-1]);var i=r.join("").trim();return n?i:i.replace(F,z)},P=Array.isArray,U=[],G=U.indexOf,J=U.slice,K=function(e,t){return 111===e.nodeType?1/t<0?t?function(e){var t=e.firstChild,n=e.lastChild,r=document.createRange();return r.setStartAfter(t),r.setEndAfter(n),r.deleteContents(),t}(e):e.lastChild:t?e.valueOf():e.firstChild:e},Q=function(e){var t="fragment",n="template",r="content"in o(n)?function(e){var t=o(n);return t.innerHTML=e,t.content}:function(e){var r=o(t),u=o(n),i=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;u.innerHTML="<table>"+e+"</table>",i=u.querySelectorAll(c)}else u.innerHTML=e,i=u.childNodes;return a(r,i),r};return function(e,t){return("svg"===t?u:r)(e)};function a(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function o(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function u(e){var n=o(t),r=o("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",a(n,r.firstChild.childNodes),n}}(document),V=function(e,t){return e.childNodes[t]},X=function(e){for(var t=[],n=e.parentNode;n;)t.push(G.call(n.childNodes,e)),n=(e=n).parentNode;return t},Y=document,Z=Y.createTreeWalker,ee=Y.importNode,te=1!=ee.length,ne=te?function(e,t){return ee.call(document,Q(e,t),!0)}:Q,re=te?function(e){return Z.call(document,e,129,null,!1)}:function(e){return Z.call(document,e,129)},ae=function(e,t,n){return function(e,t,n,r,a){for(var o=n.length,u=t.length,i=o,c=0,l=0,f=null;c<u||l<i;)if(u===c)for(var s=i<o?l?r(n[l-1],-0).nextSibling:r(n[i-l],0):a;l<i;)e.insertBefore(r(n[l++],1),s);else if(i===l)for(;c<u;)f&&f.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[l])c++,l++;else if(t[u-1]===n[i-1])u--,i--;else if(t[c]===n[i-1]&&n[l]===t[u-1]){var v=r(t[--u],-1).nextSibling;e.insertBefore(r(n[l++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--i],1),v),t[u]=n[i]}else{if(!f){f=new Map;for(var d=l;d<i;)f.set(n[d],d++)}if(f.has(t[c])){var p=f.get(t[c]);if(l<p&&p<i){for(var h=c,g=1;++h<u&&h<i&&f.get(t[h])===p+g;)g++;if(g>p-l)for(var y=r(t[c],0);l<p;)e.insertBefore(r(n[l++],1),y);else e.replaceChild(r(n[l++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n}(e.parentNode,t,n,K,e)},oe=function(e,t){return"ref"===t?function(e){return function(t){"function"==typeof t?t(e):t.current=e}}(e):"aria"===t?function(e){return function(t){for(var n in t){var r="role"===n?n:"aria-".concat(n),a=t[n];null==a?e.removeAttribute(r):e.setAttribute(r,a)}}}(e):".dataset"===t?function(e){var t=e.dataset;return function(e){for(var n in e){var r=e[n];null==r?delete t[n]:t[n]=r}}}(e):"."===t.slice(0,1)?function(e,t){return function(n){e[t]=n}}(e,t.slice(1)):"on"===t.slice(0,2)?function(e,t){var n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),function(t){var a=P(t)?t:[t,!1];n!==a[0]&&(n&&e.removeEventListener(r,n,a[1]),(n=a[0])&&e.addEventListener(r,n,a[1]))}}(e,t):function(e,t){var n,r=!0,a=document.createAttributeNS(null,t);return function(t){n!==t&&(null==(n=t)?r||(e.removeAttributeNode(a),r=!0):(a.value=t,r&&(e.setAttributeNodeNS(a),r=!1)))}}(e,t)};function ue(e){var t=e.type,n=e.path.reduceRight(V,this);return"node"===t?function(e){var t,n,r=[];return function a(o){switch(typeof o){case"string":case"number":case"boolean":t!==o&&(t=o,n?n.textContent=o:n=document.createTextNode(o),r=ae(e,r,[n]));break;case"object":case"undefined":if(null==o){t!=o&&(t=o,r=ae(e,r,[]));break}if(P(o)){t=o,0===o.length?r=ae(e,r,[]):"object"==typeof o[0]?r=ae(e,r,o):a(String(o));break}"ELEMENT_NODE"in o&&t!==o&&(t=o,r=ae(e,r,11===o.nodeType?J.call(o.childNodes):[o]))}}}(n):"attr"===t?oe(n,e.name):function(e){var t;return function(n){t!=n&&(t=n,e.textContent=null==n?"":n)}}(n)}var ie="isµ",ce=s(new WeakMap),le=function(e,t){var n=ce.get(t)||ce.set(t,function(e,t){for(var n=q(t,ie,"svg"===e),r=ne(n,e),a=re(r),o=[],u=t.length-1,i=0,c="".concat(ie).concat(i);i<u;){var l=a.nextNode();if(!l)throw"bad template: ".concat(n);if(8===l.nodeType)l.textContent===c&&(o.push({type:"node",path:X(l)}),c="".concat(ie).concat(++i));else{for(;l.hasAttribute(c);)o.push({type:"attr",path:X(l),name:l.getAttribute(c)}),l.removeAttribute(c),c="".concat(ie).concat(++i);/^(?:style|textarea)$/i.test(l.tagName)&&l.textContent.trim()==="\x3c!--".concat(c,"--\x3e")&&(o.push({type:"text",path:X(l)}),c="".concat(ie).concat(++i))}}return{content:r,nodes:o}}(e,t)),r=n.content,a=n.nodes,o=ee.call(document,r,!0);return{content:o,updates:a.map(ue,o)}},fe=function(e,t){var n=t.type,r=t.template,a=t.values,o=a.length;se(e,a,o);var u=e.entry;u&&u.template===r&&u.type===n||(e.entry=u=function(e,t){var n=le(e,t);return{type:e,template:t,content:n.content,updates:n.updates,wire:null}}(n,r));for(var i=u,c=i.content,l=i.updates,f=i.wire,s=0;s<o;s++)l[s](a[s]);return f||(u.wire=function(e){var t=e.childNodes,n=t.length;if(n<2)return n?t[0]:e;var r=J.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf:function(){if(t.length!==n)for(var a=0;a<n;)e.appendChild(r[a++]);return e}}}(c))},se=function e(t,n,r){for(var a=t.stack,o=0;o<r;o++){var u=n[o];u instanceof ve?n[o]=fe(a[o]||(a[o]={stack:[],entry:null,wire:null}),u):P(u)?e(a[o]||(a[o]={stack:[],entry:null,wire:null}),u,u.length):a[o]=null}r<a.length&&a.splice(r)};function ve(e,t,n){this.type=e,this.template=t,this.values=n}var de=Object.create,pe=Object.defineProperties,he=function(e){var t=s(new WeakMap);return pe((function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new ve(e,t,r)}),{for:{value:function(n,r){var a=t.get(n)||t.set(n,de(null));return a[r]||(a[r]=function(t){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return fe(t,{type:e,template:n,values:a})}}({stack:[],entry:null,wire:null}))}},node:{value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return fe({stack:[],entry:null,wire:null},{type:e,template:t,values:r}).valueOf()}}})},ge=s(new WeakMap),ye=he("html"),me=he("svg"),we=Array.isArray,be=Object.create,ke=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new ve("html",e,n)};ke.for=je(ye);var Ce=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new ve("svg",e,n)};Ce.for=je(me);var Ae=s(new WeakMap),Ee=function(e,t){var n="function"==typeof t?t():t,r=Ae.get(e)||Ae.set(e,Me(null));return r.w=e,r.W=t,function(e,t){var n="function"==typeof t?t():t,r=ge.get(e)||ge.set(e,{stack:[],entry:null,wire:null}),a=n instanceof ve?fe(r,n):n;return a!==r.wire&&(r.wire=a,e.textContent="",e.appendChild(a.valueOf())),e}(e,n instanceof Le?Te(r,n):(Oe(r,n),n))},Ne=!1,xe=function(e,t){t!==e.node&&(e.node&&(Ne=!0),e.node=t)},Se=function(e,t){return n=null,r=d((function(){var n=t.fn.apply(null,arguments);n instanceof ve?(Oe(e,n),xe(t,$e(t,n))):xe(t,n);try{return t.node}finally{if(Ne){Ne=!1;for(var r=e;r.p;)r=r.p;Ee(r.w,r.W)}}})),function(){var e=r.apply(this,arguments);return M(r)&&j(e,n||(n=S.bind(null,r))),e};var n,r},Me=function(e){return{p:e,stack:[],entry:null}},Te=function(e,n){var r,a=n.fn,o=n.template,u=n.values,i=e.entry;return i&&i.fn===a||(e.entry=i={fn:a,hook:null,node:null},i.hook=Se(Me(e),i)),(r=i).hook.apply(r,[o].concat(t(u)))},Oe=function(e,t){var n=t.values;We(e,n,n.length)},We=function e(t,n,r){for(var a=t.stack,o=0;o<r;o++){var u=n[o];u instanceof Le?n[o]=Te(a[o]||(a[o]=Me(t)),u):u instanceof ve?Oe(a[o]||(a[o]=Me(t)),u):we(u)?e(a[o]||(a[o]=Me(t)),u,u.length):a[o]=null}r<a.length&&a.splice(r)},$e=function(e,n){var r=n.type,a=n.template,o=n.values;return("svg"===r?me:ye).for(e,r).apply(void 0,[a].concat(t(o)))};function Le(e,t,n){this.fn=e,this.template=t,this.values=n}function je(e){var t=s(new WeakMap);return function(n,r){var a=t.get(n)||t.set(n,be(null)),o=a[r]||(a[r]=Me(null));return function(t){for(var a=arguments.length,u=new Array(a>1?a-1:0),i=1;i<a;i++)u[i-1]=arguments[i];return We(o,u),e.for(n,r).apply(void 0,[t].concat(u))}}}return e.Component=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new Le(e,t,r)}},e.contextual=function(e){var t=!0,n=null,r=d((function(){return e.apply(n,arguments)}));return function e(){var a=r.apply(n=this,arguments);return t&&(t=!t,M(r)&&A.set(e,A.get(r))),a}},e.createContext=function(e){var t={value:e,provide:k};return w.set(t,[]),t},e.html=ke,e.render=Ee,e.svg=Ce,e.useCallback=function(e,t){return W((function(){return e}),t)},e.useContext=function(e){var t=v,n=t.hook,r=t.args,a=w.get(e),o={hook:n,args:r};return a.some(C,o)||a.push(o),e.value},e.useEffect=T,e.useLayoutEffect=O,e.useMemo=W,e.useReducer=m,e.useRef=function(e){var t=v.i++,n=v,r=n.stack;return t===n.length&&(v.length=r.push({current:e})),r[t]},e.useState=function(e,t){return m(y,e,void 0,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
{ | ||
"name": "uland", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"main": "./cjs/index.js", | ||
@@ -17,13 +17,13 @@ "scripts": { | ||
"devDependencies": { | ||
"@babel/core": "^7.11.4", | ||
"@babel/preset-env": "^7.11.0", | ||
"@ungap/degap": "^0.2.0", | ||
"@babel/core": "^7.12.3", | ||
"@babel/preset-env": "^7.12.1", | ||
"@ungap/degap": "^0.2.1", | ||
"ascjs": "^4.0.1", | ||
"drop-babel-typeof": "^1.0.3", | ||
"rollup": "^2.26.5", | ||
"rollup": "^2.32.1", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-includepaths": "^0.2.4", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-terser": "^7.0.0", | ||
"terser": "^5.2.1" | ||
"rollup-plugin-terser": "^7.0.2", | ||
"terser": "^5.3.8" | ||
}, | ||
@@ -39,3 +39,3 @@ "module": "./esm/index.js", | ||
"dom-augmentor": "^2.0.8", | ||
"uhtml": "^2.1.1", | ||
"uhtml": "^2.1.2", | ||
"umap": "^1.0.2" | ||
@@ -42,0 +42,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146258
1578
Updateduhtml@^2.1.2