From b403c6aa52b6b9f646b2828830e9d0afe11ea857 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Sat, 30 Sep 2023 17:23:39 -0700 Subject: [PATCH] v0.9.0 --- dist/global.js | 2 +- dist/global.js.map | 2 +- dist/index.d.ts | 2 +- dist/index.js | 2 +- package.json | 2 +- src/index.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/global.js b/dist/global.js index 633b46e..3c1f879 100644 --- a/dist/global.js +++ b/dist/global.js @@ -1,2 +1,2 @@ -(()=>{var __webpack_modules__={839:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";var _utils_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(620),__WEBPACK_DEFAULT_EXPORT__=null,supportsSpread=isSyntaxSupported("Object(...[{}])"),supportsClass=isSyntaxSupported("class Test {}"),supportsNewTarget=isSyntaxSupported("new.target"),TRUE_CONSTRUCTOR=Symbol?Symbol("trueConstructor"):"__newlessTrueConstructor__",setPrototype=Object.setPrototypeOf||function(e,t){e.__proto__=t},construct=Reflect&&Reflect.construct||function(){if(supportsClass)return Function("constructor, args, target",`\n 'use strict';\n\n if (arguments.length === 3 && typeof target !== 'function')\n throw new TypeError(target + ' is not a constructor');\n\n target = target || constructor;\n\n // extend target so the right prototype is constructed (or nearly the\n // right one; ideally we'd do instantiator.prototype = target.prototype,\n // but a class's prototype property is not writable)\n class instantiator extends target {};\n // but ensure the *logic* is 'constructor' for ES2015-compliant engines\n Object.setPrototypeOf(instantiator, constructor);\n // ...and for Safari 9\n instantiator.prototype.constructor = constructor;\n\n // The spread operator is *dramatically faster, so use it if we can:\n // http://jsperf.com/new-via-spread-vs-dynamic-function/4\n ${supportsSpread?"\n\n var value = new instantiator(...([].slice.call(args)));\n\n ":"\n\n // otherwise, create a dynamic function in order to use 'new'\n // Note using 'function.bind' would be simpler, but is much slower:\n // http://jsperf.com/new-operator-with-dynamic-function-vs-bind\n var argList = '';\n for (var i = 0, len = args.length; i < len; i++) {\n if (i > 0) argList += ',';\n argList += 'args[' + i + ']';\n }\n var constructCall = Function('constructor, args',\n 'return new constructor( ' + argList + ' );'\n );\n var value = constructCall(constructor, args);\n\n args = Array.prototype.slice.call(args);\n args = [null].concat(args);\n var value = new constructor.bind.apply(constructor, args);\n\n "}\n\n // fix up the prototype so it matches the intended one, not one who's\n // prototype is the intended one :P\n Object.setPrototypeOf(value, target.prototype);\n return value;\n `);var e=function(){};return function(t,n,r){if(3===arguments.length&&"function"!=typeof r)throw new TypeError(r+" is not a constructor");e.prototype=(r||t).prototype;var o=new e,s=t.apply(o,n);return"object"==typeof s&&s?(s.__proto__=(r||t).prototype,s):o}}(),SKIP_PROPERTIES=null;function copyProperties(e,t){if(Object.getOwnPropertyNames&&Object.defineProperty){var n=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e)));for(var r=n.length-1;r>=0;r--)-1===SKIP_PROPERTIES.indexOf(n[r])&&Object.defineProperty(t,n[r],Object.getOwnPropertyDescriptor(e,n[r]))}else for(var o in e)t[o]=e[o]}function newless(constructor){var name=constructor.name,usesClassSyntax="class"===constructor.toString().substr(0,5),requiresNew=!!usesClassSyntax||null,newlessConstructor=(()=>function(){if(!requiresNew&&this instanceof newlessConstructor){if(!1===requiresNew){const e=constructor.apply(this,arguments);return"object"==typeof e&&e||this}try{requiresNew=!1;const e=constructor.apply(this,arguments);return"object"==typeof e&&e||this}catch(e){if(!(e instanceof TypeError&&(/class constructor/i.test(e.message)||/use the 'new' operator/i.test(e.message))))throw e instanceof Error&&/Illegal constructor/i.test(e.message)&&Object.create(constructor.prototype)instanceof Node&&console.error(`The following error can happen if a Custom Element is called\nwith 'new' before being defined. The constructor was ${constructor.name}: `,constructor),e;requiresNew=!0}}var newTarget,hasNewTarget=!1;supportsNewTarget&&(eval("newTarget = new.target"),newTarget&&(hasNewTarget=!0)),supportsNewTarget&&hasNewTarget||(newTarget=this instanceof newlessConstructor?this.constructor:constructor);const returnValue=construct(constructor,arguments,newTarget);return this instanceof newlessConstructor&&setPrototype(this,returnValue),returnValue})();if(name){const e=getFunctionBody(newlessConstructor);newlessConstructor=Function("constructor, construct, setPrototype, requiresNew, supportsNewTarget",`\n var newlessConstructor = function ${name}() { ${e} };\n return newlessConstructor\n `)(constructor,construct,setPrototype,requiresNew,supportsNewTarget)}return constructor.length&&setDescriptor(newlessConstructor,"length",{value:constructor.length}),newlessConstructor.prototype=Object.create(constructor.prototype),newlessConstructor.prototype.constructor=newlessConstructor,constructor.prototype.constructor=constructor,newlessConstructor[TRUE_CONSTRUCTOR]=constructor,copyProperties(constructor,newlessConstructor),setPrototype(newlessConstructor,constructor),newlessConstructor}function isSyntaxSupported(e,t=!0){try{return!!Function("",(t?"'use strict';":"")+e)}catch(e){return!1}}},620:(e,t,n)=>{"use strict";n.d(t,{Gm:()=>_,Ie:()=>r,Md:()=>d,Sh:()=>o,U8:()=>w,ld:()=>l,nk:()=>f,q$:()=>c,uh:()=>a,yA:()=>p});class r{constructor(){this.m=new WeakMap}set(e,t){this.m.set(e,t),this.m.set(t,e)}get(e){return this.m.get(e)}has(e){return this.m.has(e)}}function o(e){const t=e.toString().split("\n");return t.shift(),t.pop(),t.join("\n")}const s={enumerable:!0,configurable:!0};function c(e,t,n,r=!1){n=i(r?l(e,t):Object.getOwnPropertyDescriptor(e,t),n),Object.defineProperty(e,t,n)}function u(e,t){let n,r;const o=Object.getOwnPropertyDescriptors(e);for(const e in t)n=t[e],r=o[e],t[e]=i(r,n);Object.defineProperties(e,t)}function i(e,t){if(("get"in t||"set"in t)&&("value"in t||"writable"in t))throw new TypeError("cannot specify both accessors and a value or writable attribute");return e&&("get"in t||"set"in t?(delete e.value,delete e.writable):("value"in t||"writable"in t)&&(delete e.get,delete e.set)),{...s,...e,...t}}function a(e,t,n=!0){let r,o=!1;return r=1===arguments.length?e:n?l(e,t):Object.getOwnPropertyDescriptor(e,t),r&&(r.get||r.set)&&(o=!0),o}function l(e,t){let n,r=e;for(;r;){if(n=Object.getOwnPropertyDescriptor(r,t),n)return n.owner=r,n;r=r.__proto__}}function p(e){let t=e,n=[];for(;t;)n=n.concat(Object.getOwnPropertyNames(t)),t=t.__proto__;return n=Array.from(new Set(n)),n}function f(e,t){let n=e.__proto__;do{if(t===n)return!0;n=n.__proto__}while(n);return!1}function _(e,t,n){const r=Object.getOwnPropertyNames(e);let o=r.length;for(;o--;){const s=r[o],c=Object.getOwnPropertyDescriptor(e,s);n&&n(c),Object.defineProperty(t,s,c)}}function d(e,{defaultClassDescriptor:{writable:t,enumerable:n,configurable:r}}){const o=Object.getOwnPropertyDescriptors(e);let s;for(const e in o)s=o[e],("value"in s||"writable"in s)&&(s.writable=t),s.enumerable=n,s.configurable=r;u(e,o)}function w(e,{defaultClassDescriptor:{writable:t,enumerable:n,configurable:r}},o){const s=Object.getOwnPropertyDescriptors(e);let c;for(const e in s)o&&o.includes(e)?delete s[e]:(c=s[e],("value"in c||"writable"in c)&&(c.writable=t),c.enumerable=n,c.configurable=r);u(e,s)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_trackReactiveProperty:()=>be,autorun:()=>he,circular:()=>Se,reactify:()=>Oe,reactive:()=>ge,variable:()=>we,version:()=>Te});var e=__webpack_require__(620);const t=["subclass","extends",...Object.getOwnPropertyNames(new Function)],n=new WeakMap,r=new WeakMap,o=new e.Ie,s=new WeakMap,c=new WeakMap,u=new WeakMap,i=new WeakMap,a=new WeakMap,l={mode:"es5",nativeNaming:!1,prototypeWritable:!1,defaultClassDescriptor:{writable:!0,enumerable:!1,configurable:!0},setClassDescriptors:!0};class p extends Error{}class f extends Error{}function _(e,t){let n=e.cachedPublicAccesses.get(t);return n||(P(e,t)?e.cachedPublicAccesses.set(t,n=w(t).publicToPrivate.get(t)):v(e,t)?e.cachedPublicAccesses.set(t,n=o.get(t)):e.cachedPublicAccesses.set(t,n=t),n)}function d(e,t){let n=e.cachedProtectedAccesses.get(t);if(n)return n;if(y(e,t))e.cachedProtectedAccesses.set(t,n=o.get(t)||h(t));else if(P(e,t)){const r=w(t).publicToPrivate.get(t);e.cachedProtectedAccesses.set(t,n=o.get(r)||h(r))}else v(e,t)&&e.cachedProtectedAccesses.set(t,n=t);if(!n)throw new f("invalid access of protected member");return n}function w(e){return s.get(e)}function h(e){const t=function(e){let t=null,r=e.__proto__;for(;r;){if(t=n.get(r),t)return t;r=r.__proto__}return t}(e),r=Object.create(t);return o.set(e,r),r}function g(e,t){let n=e.cachedPrivateAccesses.get(t);if(n)return n;if(y(e,t))e.cachedPrivateAccesses.set(t,n=e.publicToPrivate.get(t)||b(e,t));else if(v(e,t)){const r=o.get(t);e.cachedPrivateAccesses.set(t,n=e.publicToPrivate.get(r)||b(e,r))}else P(e,t)&&e.cachedPrivateAccesses.set(t,n=t);if(!n)throw new f("invalid access of private member");return n}function b(e,t){const n=Object.create(e.privatePrototype);return e.publicToPrivate.set(t,n),s.set(n,e),n}function y(t,n,r=!0){if(!r)return(0,e.nk)(n,t.publicPrototype);for(const r of Array.from(c.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function v(t,n,r=!0){if(!r)return(0,e.nk)(n,t.protectedPrototype);for(const r of Array.from(u.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function P(t,n,r=!0){if(!r)return(0,e.nk)(n,t.privatePrototype);for(const r of Array.from(i.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function O(e,t,n){const{parentPublicPrototype:r,parentProtectedPrototype:o,parentPrivatePrototype:s}=t;if(y(t,n,!1))return m(n,r,e);if(v(t,n,!1))return m(n,o,e);if(P(t,n,!1))return m(n,s,e);throw new p("invalid super access")}function m(t,n,r){let o=r.get(t);if(!o){r.set(t,o=Object.create(n));const s=(0,e.yA)(n);let c=s.length;for(;c--;){const r=s[c];(0,e.q$)(o,r,{get:function(){let o;const s=(0,e.ld)(n,r);if(s&&(0,e.uh)(s)){const e=s.get;e&&(o=e.call(t))}else o=n[r];return o&&o.call&&"function"==typeof o&&(o=o.bind(t)),o},set:function(o){const s=(0,e.ld)(n,r);if(s&&(0,e.uh)(s)){const e=s.set;e&&(o=e.call(t,o))}else t[r]=o}},!0)}}return o}var S;!function(o){(o=o?{...l,...o}:l).defaultClassDescriptor={...l.defaultClassDescriptor,...o.defaultClassDescriptor};const{mode:s,prototypeWritable:p,setClassDescriptors:f,nativeNaming:w}=o;function h(...e){let t=!1;if("function"==typeof this&&(t=!0),e.length<=3){let n="",r=null,o=null;"string"==typeof e[0]?n=e[0]:"function"!=typeof e[0]&&"object"!=typeof e[0]||(r=e[0],o=e[1]),"function"!=typeof e[1]&&"object"!=typeof e[1]||(r=e[1],o=e[2]);const s=t?b.call(this,n,r,o):b(n,r,o);return s.extends=function(e,t,s){return t=t||r,s=s||o,b.call(e,n,t,s)},s}throw new TypeError("invalid args")}return h;function b(l,b,y){let v=this;if("string"!=typeof l)throw new TypeError("\n You must specify a string for the 'className' argument.\n ");let P=null;if(b&&"object"==typeof b)P=b;else if(!v&&(!b||"function"!=typeof b&&"object"!=typeof b)){let t;return w&&l?t=new Function(`return function ${l}() {}`)():(t=function(){},l&&(0,e.q$)(t,"name",{value:l})),t.prototype={__proto__:Object.prototype,constructor:t},(0,e.q$)(t,"subclass",{value:h,writable:!0,enumerable:!1,configurable:!1}),t}const m=y?void 0:new e.Ie;y&&(a.get(y)||a.set(y,new e.Ie));const S={className:l,get publicToPrivate(){return m||a.get(y)},classBrand:y=y||{brand:"lexical"},cachedPublicAccesses:new WeakMap,cachedProtectedAccesses:new WeakMap,cachedPrivateAccesses:new WeakMap},T=new WeakMap,k=O.bind(null,T,S),j=_.bind(null,S),A=d.bind(null,S),E=g.bind(null,S);if(j.prototype={},A.prototype={},E.prototype={},j.Public=j,j.Protected=A,j.Private=E,j.Super=k,A.Public=j,A.Protected=A,A.Private=E,A.Super=k,P=P||b&&b(j,A,E,k),P&&"object"!=typeof P&&"function"!=typeof P)throw new TypeError("\n The return value of a class definer function, if any, should be\n an object, or a class constructor.\n ");let N,C=null;"function"==typeof P&&(C=P,P=P.prototype,v=C.prototype.__proto__.constructor),P&&(N=P.static,delete P.static,"function"==typeof P.public&&(P.public=P.public(A,E)),"function"==typeof P.protected&&(P.protected=P.protected(j,E)),"function"==typeof P.private&&(P.private=P.private(j,A))),v=v||Object;const x=v.prototype,q=P&&P.public||P||Object.create(x);q.__proto__!==x&&(q.__proto__=x);const R=function(e){let t,r=e;for(;r&&!t;)t=n.get(r),r=r.__proto__;return t||{}}(x),M=P&&P.protected||Object.create(R);M.__proto__!==R&&(M.__proto__=R),n.set(q,M);const D=function(e){let t,n=e;for(;n&&!t;)t=r.get(n),n=n.__proto__;return t||{}}(x),I=P&&P.private||Object.create(D);if(I.__proto__!==D&&(I.__proto__=D),r.set(q,I),c.get(y)||c.set(y,new Set),u.get(y)||u.set(y,new Set),i.get(y)||i.set(y,new Set),c.get(y).add(q),u.get(y).add(M),i.get(y).add(I),S.publicPrototype=q,S.privatePrototype=I,S.protectedPrototype=M,S.parentPublicPrototype=x,S.parentProtectedPrototype=R,S.parentPrivatePrototype=D,(0,e.Gm)(j.prototype,q),(0,e.Gm)(A.prototype,M),(0,e.Gm)(E.prototype,I),P&&(delete P.public,delete P.protected,delete P.private,P!==q&&(0,e.Gm)(P,q)),C)return N&&(0,e.Gm)(N,C),C;const W=q.hasOwnProperty("constructor")?q.constructor:null;let L=null,$=null;if("es5"!==s)throw new TypeError("\n The lowclass \"mode\" option can only be 'es5' for now.\n ");if(L=function(){let e=null,t=null;return t=W||v,t!==Object&&(e=t.apply(this,arguments)),!e||"object"!=typeof e&&"function"!=typeof e?this:e},$=q,l)if(w){const t=(0,e.Sh)(L),n=L.prototype;L=new Function(" userConstructor, ParentClass ",`\n return function ${l}() { ${t} }\n `)(W,v),L.prototype=n}else(0,e.q$)(L,"name",{value:l});return W&&W.length&&(0,e.q$)(L,"length",{value:W.length}),L.__proto__=v,N&&(0,e.Gm)(N,L),(0,e.q$)(L,"subclass",{value:h,writable:!0,enumerable:!1,configurable:!1}),L.prototype=$,L.prototype.constructor=L,f&&((0,e.U8)(L,o,t),(0,e.q$)(L,"prototype",{writable:p}),(0,e.Md)(L.prototype,o),(0,e.Md)(M,o),(0,e.Md)(I,o)),S.constructor=L,L}}(),function(e){e.PROXIES_ON_INSTANCE_AND_PROTOTYPE="PROXIES_ON_INSTANCE_AND_PROTOTYPE",e.PROXIES_ON_PROTOTYPE="PROXIES_ON_PROTOTYPE",e.PROXY_AFTER_INSTANCE_AND_PROTOTYPE="PROXY_AFTER_INSTANCE_AND_PROTOTYPE"}(S||(S={})),S.PROXIES_ON_INSTANCE_AND_PROTOTYPE;new WeakMap;__webpack_require__(839);const T={};const k=(Symbol("solid-proxy"),Symbol("solid-track"),Symbol("solid-dev-component"),{equals:(e,t)=>e===t});let j=null,A=re;const E={},N=1,C=2,x={owned:null,cleanups:null,context:null,owner:null},[q,R]=X(!1);var M=null;let D,I=null,W=null,L=null,$=null,F=null,V=null,U=null,Y=0;function X(e,t){t=t?Object.assign({},k,t):k;const n={value:e,observers:null,observerSlots:null,pending:E,comparator:t.equals||void 0};return[H.bind(n),e=>("function"==typeof e&&(e=I&&I.running&&I.sources.has(n)?e(n.pending!==E?n.pending:n.tValue):e(n.pending!==E?n.pending:n.value)),J(n,e))]}function B(e,t,n){n=n?Object.assign({},k,n):k;const r=ee(e,t,!0,0);return r.pending=E,r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,W&&I&&I.running?(r.tState=N,V.push(r)):Q(r),H.bind(r)}function G(e){if(F)return e();let t;const n=F=[];try{t=e()}finally{F=null}return ne((()=>{for(let e=0;epe(t())))}function H(){const e=I&&I.running;if(this.sources&&(!e&&this.state||e&&this.tState)){const t=V;V=null,!e&&this.state===N||e&&this.tState===N?Q(this):se(this),V=t}if($){const e=this.observers?this.observers.length:0;$.sources?($.sources.push(this),$.sourceSlots.push(e)):($.sources=[this],$.sourceSlots=[e]),this.observers?(this.observers.push($),this.observerSlots.push($.sources.length-1)):(this.observers=[$],this.observerSlots=[$.sources.length-1])}return e&&I.sources.has(this)?this.tValue:this.value}function J(e,t,n){if(F)return e.pending===E&&F.push(e),e.pending=t,t;if(e.comparator)if(I&&I.running&&I.sources.has(e)){if(e.comparator(e.tValue,t))return t}else if(e.comparator(e.value,t))return t;let r=!1;return I?(r=I.running,(r||!n&&I.sources.has(e))&&(I.sources.add(e),e.tValue=t),r||(e.value=t)):e.value=t,e.observers&&e.observers.length&&ne((()=>{for(let t=0;t1e6)throw V=[],new Error}),!1),t}function Q(e){if(!e.fn)return;ue(e);const t=M,n=$,r=Y;$=M=e,Z(e,I&&I.running&&I.sources.has(e)?e.tValue:e.value,r),I&&!I.running&&I.sources.has(e)&&queueMicrotask((()=>{ne((()=>{I&&(I.running=!0),Z(e,e.tValue,r)}),!1)})),$=n,M=t}function Z(e,t,n){let r;try{r=e.fn(t)}catch(e){ae(e)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?J(e,r,!0):I&&I.running&&e.pure?(I.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ee(e,t,n,r=N,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:M,context:null,pure:n};if(I&&I.running&&(s.state=0,s.tState=r),null===M||M!==x&&(I&&I.running&&M.pure?M.tOwned?M.tOwned.push(s):M.tOwned=[s]:M.owned?M.owned.push(s):M.owned=[s]),L){const[e,t]=X(void 0,{equals:!1}),n=L(s.fn,t);!function(e){null===M||(null===M.cleanups?M.cleanups=[e]:M.cleanups.push(e))}((()=>n.dispose()));const r=()=>function(e){if(I&&I.running)return e(),I.done;const t=$,n=M;return Promise.resolve().then((()=>{let r;return $=t,M=n,(W||D)&&(r=I||(I={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise((e=>r.resolve=e))),r.running=!0),G(e),$=M=null,r?r.done:void 0}))}(t).then((()=>o.dispose())),o=L(s.fn,r);s.fn=t=>(e(),I&&I.running?o.track(t):n.track(t))}return s}function te(e){const t=I&&I.running;if(!t&&0===e.state||t&&0===e.tState)return;if(!t&&e.state===C||t&&e.tState===C)return se(e);if(e.suspense&&K(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--){if(e=n[r],t){let t=e,o=n[r+1];for(;(t=t.owner)&&t!==o;)if(I.disposed.has(t))return}if(!t&&e.state===N||t&&e.tState===N)Q(e);else if(!t&&e.state===C||t&&e.tState===C){const t=V;V=null,se(e,n[0]),V=t}}}function ne(e,t){if(V)return e();let n=!1;t||(V=[]),U?n=!0:U=[],Y++;try{const t=e();return function(e){if(V&&(W&&I&&I.running?function(e){for(let t=0;t{r.delete(n),ne((()=>{I.running=!0,te(n),r.size||(U.push.apply(U,I.effects),I.effects=[])}),!1),I&&(I.running=!1)})))}}(V):re(V),V=null),e)return;let t;if(I&&I.running){if(I.promises.size||I.queue.size)return I.running=!1,I.effects.push.apply(I.effects,U),U=null,void R(!0);const e=I.sources,n=I.disposed;t=I.resolve;for(const e of U)"tState"in e&&(e.state=e.tState),delete e.tState;I=null,G((()=>{for(const e of n)ue(e);for(const t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e{A(U),U=null})):U=null,t&&t()}(n),t}catch(e){V||(U=null),ae(e)}}function re(e){for(let t=0;tn=K((()=>(M.context={[e]:t.value},z((()=>t.children))))))),n}}function _e(){return this()}function de(e){return this(e)}function we(e){const[t,n]=X(e,{equals:!1}),r=e=>void 0===e?t():(n((()=>e)),e),o=_e.bind(r),s=de.bind(r);return r.get=o,r.set=s,r[0]=o,r[1]=s,r[Symbol.iterator]=function*(){yield r[0],yield r[1]},r}function he(e){let t;return function(e,t){const n=$,r=M,o=0===e.length,s=o?x:{owned:null,cleanups:null,context:null,owner:t||r},c=o?e:()=>e((()=>ue(s)));M=s,$=null;try{return ne(c,!0)}finally{$=n,M=r}}((n=>{t=n,function(e,t,n){A=oe;const r=ee(e,t,!1,N),o=D&&le(M,D.id);o&&(r.suspense=o),r.user=!0,U?U.push(r):Q(r)}(e)})),t}function ge(e,t,n){if(1===arguments.length&&"kind"in e){const t=e;return"class"===t.kind?{...t,finisher:ye}:{...t,finisher(e){var n,r;return be(e,t.key),null!==(r=null===(n=t.finisher)||void 0===n?void 0:n.call(t,e))&&void 0!==r?r:e}}}if(1===arguments.length&&"function"==typeof e)return ye(e);be(e.constructor,t)}function be(e,t){e.reactiveProperties&&e.hasOwnProperty("reactiveProperties")||(e.reactiveProperties=[]),e.reactiveProperties.includes(t)||e.reactiveProperties.push(t)}function ye(e){var t;return e.hasOwnProperty("__isReactive__")?e:((t=class extends e{constructor(...t){if($)return K((()=>{const n=Reflect.construct(e,t,new.target);return Oe(n,e),n}));super(...t),Oe(this,e)}}).__isReactive__=!0,t)}function ve(t,n){if("string"!=typeof n)throw new Error("TODO: support for non-string fields with @reactive decorator");const r="v_"+n;let o,s,c,u=(0,e.ld)(t,n);if(u)if(o=u.get,s=u.set,o||s){if(!o||!s)return void console.warn('The `@reactive` decorator was used on an accessor named "'+n+'" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. In this case the decorator does not do anything.');delete u.get,delete u.set}else{if(c=u.value,!u.writable)return void console.warn("The `@reactive` decorator was used on a property named "+n+" that is not writable. Reactivity is not enabled for non-writable properties.");delete u.value,delete u.writable}u={configurable:!0,enumerable:!0,...u,get:o?function(){return Pe(this,r,c)(),o.call(this)}:function(){return Pe(this,r,c)()},set:s?function(e){s.call(this,e),Pe(this,r)(e),this.__propsSetAtLeastOnce__||(this.__propsSetAtLeastOnce__=new Set),this.__propsSetAtLeastOnce__.add(n)}:function(e){Pe(this,r)(e),this.__propsSetAtLeastOnce__||(this.__propsSetAtLeastOnce__=new Set),this.__propsSetAtLeastOnce__.add(n)}},t.__reactifiedProps__||(t.__reactifiedProps__=new Set),t.__reactifiedProps__.add(n),Object.defineProperty(t,n,u)}function Pe(e,t,n=void 0){let r=e[t];return r||(e[t]=r=we(n),r)}function Oe(e,t){if(function(e){return"function"==typeof e}(t)){const n=t.reactiveProperties;Array.isArray(n)&&me(e,n)}else me(e,t);return e}function me(e,t){var n;for(const r of t){if(null===(n=e.__reactifiedProps__)||void 0===n?void 0:n.has(r))continue;const t=e[r];ve(e,r),e[r]=t}}function Se(e,t,n,r){let o=!0;const s=he((()=>{const t=e();o&&!(o=!1)?r(t):o=!0})),c=he((()=>{const e=n();o&&!(o=!1)?t(e):o=!0}));return function(){s(),c()}}Symbol("fallback"),function(e){const t=Symbol("context");fe(t)}();const Te="0.8.0"})();var __webpack_export_target__=LUME="undefined"==typeof LUME?{}:LUME;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); +(()=>{var __webpack_modules__={839:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";var _utils_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(620),__WEBPACK_DEFAULT_EXPORT__=null,supportsSpread=isSyntaxSupported("Object(...[{}])"),supportsClass=isSyntaxSupported("class Test {}"),supportsNewTarget=isSyntaxSupported("new.target"),TRUE_CONSTRUCTOR=Symbol?Symbol("trueConstructor"):"__newlessTrueConstructor__",setPrototype=Object.setPrototypeOf||function(e,t){e.__proto__=t},construct=Reflect&&Reflect.construct||function(){if(supportsClass)return Function("constructor, args, target",`\n 'use strict';\n\n if (arguments.length === 3 && typeof target !== 'function')\n throw new TypeError(target + ' is not a constructor');\n\n target = target || constructor;\n\n // extend target so the right prototype is constructed (or nearly the\n // right one; ideally we'd do instantiator.prototype = target.prototype,\n // but a class's prototype property is not writable)\n class instantiator extends target {};\n // but ensure the *logic* is 'constructor' for ES2015-compliant engines\n Object.setPrototypeOf(instantiator, constructor);\n // ...and for Safari 9\n instantiator.prototype.constructor = constructor;\n\n // The spread operator is *dramatically faster, so use it if we can:\n // http://jsperf.com/new-via-spread-vs-dynamic-function/4\n ${supportsSpread?"\n\n var value = new instantiator(...([].slice.call(args)));\n\n ":"\n\n // otherwise, create a dynamic function in order to use 'new'\n // Note using 'function.bind' would be simpler, but is much slower:\n // http://jsperf.com/new-operator-with-dynamic-function-vs-bind\n var argList = '';\n for (var i = 0, len = args.length; i < len; i++) {\n if (i > 0) argList += ',';\n argList += 'args[' + i + ']';\n }\n var constructCall = Function('constructor, args',\n 'return new constructor( ' + argList + ' );'\n );\n var value = constructCall(constructor, args);\n\n args = Array.prototype.slice.call(args);\n args = [null].concat(args);\n var value = new constructor.bind.apply(constructor, args);\n\n "}\n\n // fix up the prototype so it matches the intended one, not one who's\n // prototype is the intended one :P\n Object.setPrototypeOf(value, target.prototype);\n return value;\n `);var e=function(){};return function(t,n,r){if(3===arguments.length&&"function"!=typeof r)throw new TypeError(r+" is not a constructor");e.prototype=(r||t).prototype;var o=new e,s=t.apply(o,n);return"object"==typeof s&&s?(s.__proto__=(r||t).prototype,s):o}}(),SKIP_PROPERTIES=null;function copyProperties(e,t){if(Object.getOwnPropertyNames&&Object.defineProperty){var n=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e)));for(var r=n.length-1;r>=0;r--)-1===SKIP_PROPERTIES.indexOf(n[r])&&Object.defineProperty(t,n[r],Object.getOwnPropertyDescriptor(e,n[r]))}else for(var o in e)t[o]=e[o]}function newless(constructor){var name=constructor.name,usesClassSyntax="class"===constructor.toString().substr(0,5),requiresNew=!!usesClassSyntax||null,newlessConstructor=(()=>function(){if(!requiresNew&&this instanceof newlessConstructor){if(!1===requiresNew){const e=constructor.apply(this,arguments);return"object"==typeof e&&e||this}try{requiresNew=!1;const e=constructor.apply(this,arguments);return"object"==typeof e&&e||this}catch(e){if(!(e instanceof TypeError&&(/class constructor/i.test(e.message)||/use the 'new' operator/i.test(e.message))))throw e instanceof Error&&/Illegal constructor/i.test(e.message)&&Object.create(constructor.prototype)instanceof Node&&console.error(`The following error can happen if a Custom Element is called\nwith 'new' before being defined. The constructor was ${constructor.name}: `,constructor),e;requiresNew=!0}}var newTarget,hasNewTarget=!1;supportsNewTarget&&(eval("newTarget = new.target"),newTarget&&(hasNewTarget=!0)),supportsNewTarget&&hasNewTarget||(newTarget=this instanceof newlessConstructor?this.constructor:constructor);const returnValue=construct(constructor,arguments,newTarget);return this instanceof newlessConstructor&&setPrototype(this,returnValue),returnValue})();if(name){const e=getFunctionBody(newlessConstructor);newlessConstructor=Function("constructor, construct, setPrototype, requiresNew, supportsNewTarget",`\n var newlessConstructor = function ${name}() { ${e} };\n return newlessConstructor\n `)(constructor,construct,setPrototype,requiresNew,supportsNewTarget)}return constructor.length&&setDescriptor(newlessConstructor,"length",{value:constructor.length}),newlessConstructor.prototype=Object.create(constructor.prototype),newlessConstructor.prototype.constructor=newlessConstructor,constructor.prototype.constructor=constructor,newlessConstructor[TRUE_CONSTRUCTOR]=constructor,copyProperties(constructor,newlessConstructor),setPrototype(newlessConstructor,constructor),newlessConstructor}function isSyntaxSupported(e,t=!0){try{return!!Function("",(t?"'use strict';":"")+e)}catch(e){return!1}}},620:(e,t,n)=>{"use strict";n.d(t,{Gm:()=>_,Ie:()=>r,Md:()=>d,Sh:()=>o,U8:()=>w,ld:()=>l,nk:()=>f,q$:()=>c,uh:()=>a,yA:()=>p});class r{constructor(){this.m=new WeakMap}set(e,t){this.m.set(e,t),this.m.set(t,e)}get(e){return this.m.get(e)}has(e){return this.m.has(e)}}function o(e){const t=e.toString().split("\n");return t.shift(),t.pop(),t.join("\n")}const s={enumerable:!0,configurable:!0};function c(e,t,n,r=!1){n=i(r?l(e,t):Object.getOwnPropertyDescriptor(e,t),n),Object.defineProperty(e,t,n)}function u(e,t){let n,r;const o=Object.getOwnPropertyDescriptors(e);for(const e in t)n=t[e],r=o[e],t[e]=i(r,n);Object.defineProperties(e,t)}function i(e,t){if(("get"in t||"set"in t)&&("value"in t||"writable"in t))throw new TypeError("cannot specify both accessors and a value or writable attribute");return e&&("get"in t||"set"in t?(delete e.value,delete e.writable):("value"in t||"writable"in t)&&(delete e.get,delete e.set)),{...s,...e,...t}}function a(e,t,n=!0){let r,o=!1;return r=1===arguments.length?e:n?l(e,t):Object.getOwnPropertyDescriptor(e,t),r&&(r.get||r.set)&&(o=!0),o}function l(e,t){let n,r=e;for(;r;){if(n=Object.getOwnPropertyDescriptor(r,t),n)return n.owner=r,n;r=r.__proto__}}function p(e){let t=e,n=[];for(;t;)n=n.concat(Object.getOwnPropertyNames(t)),t=t.__proto__;return n=Array.from(new Set(n)),n}function f(e,t){let n=e.__proto__;do{if(t===n)return!0;n=n.__proto__}while(n);return!1}function _(e,t,n){const r=Object.getOwnPropertyNames(e);let o=r.length;for(;o--;){const s=r[o],c=Object.getOwnPropertyDescriptor(e,s);n&&n(c),Object.defineProperty(t,s,c)}}function d(e,{defaultClassDescriptor:{writable:t,enumerable:n,configurable:r}}){const o=Object.getOwnPropertyDescriptors(e);let s;for(const e in o)s=o[e],("value"in s||"writable"in s)&&(s.writable=t),s.enumerable=n,s.configurable=r;u(e,o)}function w(e,{defaultClassDescriptor:{writable:t,enumerable:n,configurable:r}},o){const s=Object.getOwnPropertyDescriptors(e);let c;for(const e in s)o&&o.includes(e)?delete s[e]:(c=s[e],("value"in c||"writable"in c)&&(c.writable=t),c.enumerable=n,c.configurable=r);u(e,s)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_trackReactiveProperty:()=>be,autorun:()=>he,circular:()=>Se,reactify:()=>Oe,reactive:()=>ge,variable:()=>we,version:()=>Te});var e=__webpack_require__(620);const t=["subclass","extends",...Object.getOwnPropertyNames(new Function)],n=new WeakMap,r=new WeakMap,o=new e.Ie,s=new WeakMap,c=new WeakMap,u=new WeakMap,i=new WeakMap,a=new WeakMap,l={mode:"es5",nativeNaming:!1,prototypeWritable:!1,defaultClassDescriptor:{writable:!0,enumerable:!1,configurable:!0},setClassDescriptors:!0};class p extends Error{}class f extends Error{}function _(e,t){let n=e.cachedPublicAccesses.get(t);return n||(P(e,t)?e.cachedPublicAccesses.set(t,n=w(t).publicToPrivate.get(t)):v(e,t)?e.cachedPublicAccesses.set(t,n=o.get(t)):e.cachedPublicAccesses.set(t,n=t),n)}function d(e,t){let n=e.cachedProtectedAccesses.get(t);if(n)return n;if(y(e,t))e.cachedProtectedAccesses.set(t,n=o.get(t)||h(t));else if(P(e,t)){const r=w(t).publicToPrivate.get(t);e.cachedProtectedAccesses.set(t,n=o.get(r)||h(r))}else v(e,t)&&e.cachedProtectedAccesses.set(t,n=t);if(!n)throw new f("invalid access of protected member");return n}function w(e){return s.get(e)}function h(e){const t=function(e){let t=null,r=e.__proto__;for(;r;){if(t=n.get(r),t)return t;r=r.__proto__}return t}(e),r=Object.create(t);return o.set(e,r),r}function g(e,t){let n=e.cachedPrivateAccesses.get(t);if(n)return n;if(y(e,t))e.cachedPrivateAccesses.set(t,n=e.publicToPrivate.get(t)||b(e,t));else if(v(e,t)){const r=o.get(t);e.cachedPrivateAccesses.set(t,n=e.publicToPrivate.get(r)||b(e,r))}else P(e,t)&&e.cachedPrivateAccesses.set(t,n=t);if(!n)throw new f("invalid access of private member");return n}function b(e,t){const n=Object.create(e.privatePrototype);return e.publicToPrivate.set(t,n),s.set(n,e),n}function y(t,n,r=!0){if(!r)return(0,e.nk)(n,t.publicPrototype);for(const r of Array.from(c.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function v(t,n,r=!0){if(!r)return(0,e.nk)(n,t.protectedPrototype);for(const r of Array.from(u.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function P(t,n,r=!0){if(!r)return(0,e.nk)(n,t.privatePrototype);for(const r of Array.from(i.get(t.classBrand)))if((0,e.nk)(n,r))return!0;return!1}function O(e,t,n){const{parentPublicPrototype:r,parentProtectedPrototype:o,parentPrivatePrototype:s}=t;if(y(t,n,!1))return m(n,r,e);if(v(t,n,!1))return m(n,o,e);if(P(t,n,!1))return m(n,s,e);throw new p("invalid super access")}function m(t,n,r){let o=r.get(t);if(!o){r.set(t,o=Object.create(n));const s=(0,e.yA)(n);let c=s.length;for(;c--;){const r=s[c];(0,e.q$)(o,r,{get:function(){let o;const s=(0,e.ld)(n,r);if(s&&(0,e.uh)(s)){const e=s.get;e&&(o=e.call(t))}else o=n[r];return o&&o.call&&"function"==typeof o&&(o=o.bind(t)),o},set:function(o){const s=(0,e.ld)(n,r);if(s&&(0,e.uh)(s)){const e=s.set;e&&(o=e.call(t,o))}else t[r]=o}},!0)}}return o}var S;!function(o){(o=o?{...l,...o}:l).defaultClassDescriptor={...l.defaultClassDescriptor,...o.defaultClassDescriptor};const{mode:s,prototypeWritable:p,setClassDescriptors:f,nativeNaming:w}=o;function h(...e){let t=!1;if("function"==typeof this&&(t=!0),e.length<=3){let n="",r=null,o=null;"string"==typeof e[0]?n=e[0]:"function"!=typeof e[0]&&"object"!=typeof e[0]||(r=e[0],o=e[1]),"function"!=typeof e[1]&&"object"!=typeof e[1]||(r=e[1],o=e[2]);const s=t?b.call(this,n,r,o):b(n,r,o);return s.extends=function(e,t,s){return t=t||r,s=s||o,b.call(e,n,t,s)},s}throw new TypeError("invalid args")}return h;function b(l,b,y){let v=this;if("string"!=typeof l)throw new TypeError("\n You must specify a string for the 'className' argument.\n ");let P=null;if(b&&"object"==typeof b)P=b;else if(!v&&(!b||"function"!=typeof b&&"object"!=typeof b)){let t;return w&&l?t=new Function(`return function ${l}() {}`)():(t=function(){},l&&(0,e.q$)(t,"name",{value:l})),t.prototype={__proto__:Object.prototype,constructor:t},(0,e.q$)(t,"subclass",{value:h,writable:!0,enumerable:!1,configurable:!1}),t}const m=y?void 0:new e.Ie;y&&(a.get(y)||a.set(y,new e.Ie));const S={className:l,get publicToPrivate(){return m||a.get(y)},classBrand:y=y||{brand:"lexical"},cachedPublicAccesses:new WeakMap,cachedProtectedAccesses:new WeakMap,cachedPrivateAccesses:new WeakMap},T=new WeakMap,k=O.bind(null,T,S),j=_.bind(null,S),A=d.bind(null,S),E=g.bind(null,S);if(j.prototype={},A.prototype={},E.prototype={},j.Public=j,j.Protected=A,j.Private=E,j.Super=k,A.Public=j,A.Protected=A,A.Private=E,A.Super=k,P=P||b&&b(j,A,E,k),P&&"object"!=typeof P&&"function"!=typeof P)throw new TypeError("\n The return value of a class definer function, if any, should be\n an object, or a class constructor.\n ");let N,C=null;"function"==typeof P&&(C=P,P=P.prototype,v=C.prototype.__proto__.constructor),P&&(N=P.static,delete P.static,"function"==typeof P.public&&(P.public=P.public(A,E)),"function"==typeof P.protected&&(P.protected=P.protected(j,E)),"function"==typeof P.private&&(P.private=P.private(j,A))),v=v||Object;const x=v.prototype,q=P&&P.public||P||Object.create(x);q.__proto__!==x&&(q.__proto__=x);const R=function(e){let t,r=e;for(;r&&!t;)t=n.get(r),r=r.__proto__;return t||{}}(x),M=P&&P.protected||Object.create(R);M.__proto__!==R&&(M.__proto__=R),n.set(q,M);const D=function(e){let t,n=e;for(;n&&!t;)t=r.get(n),n=n.__proto__;return t||{}}(x),I=P&&P.private||Object.create(D);if(I.__proto__!==D&&(I.__proto__=D),r.set(q,I),c.get(y)||c.set(y,new Set),u.get(y)||u.set(y,new Set),i.get(y)||i.set(y,new Set),c.get(y).add(q),u.get(y).add(M),i.get(y).add(I),S.publicPrototype=q,S.privatePrototype=I,S.protectedPrototype=M,S.parentPublicPrototype=x,S.parentProtectedPrototype=R,S.parentPrivatePrototype=D,(0,e.Gm)(j.prototype,q),(0,e.Gm)(A.prototype,M),(0,e.Gm)(E.prototype,I),P&&(delete P.public,delete P.protected,delete P.private,P!==q&&(0,e.Gm)(P,q)),C)return N&&(0,e.Gm)(N,C),C;const W=q.hasOwnProperty("constructor")?q.constructor:null;let L=null,$=null;if("es5"!==s)throw new TypeError("\n The lowclass \"mode\" option can only be 'es5' for now.\n ");if(L=function(){let e=null,t=null;return t=W||v,t!==Object&&(e=t.apply(this,arguments)),!e||"object"!=typeof e&&"function"!=typeof e?this:e},$=q,l)if(w){const t=(0,e.Sh)(L),n=L.prototype;L=new Function(" userConstructor, ParentClass ",`\n return function ${l}() { ${t} }\n `)(W,v),L.prototype=n}else(0,e.q$)(L,"name",{value:l});return W&&W.length&&(0,e.q$)(L,"length",{value:W.length}),L.__proto__=v,N&&(0,e.Gm)(N,L),(0,e.q$)(L,"subclass",{value:h,writable:!0,enumerable:!1,configurable:!1}),L.prototype=$,L.prototype.constructor=L,f&&((0,e.U8)(L,o,t),(0,e.q$)(L,"prototype",{writable:p}),(0,e.Md)(L.prototype,o),(0,e.Md)(M,o),(0,e.Md)(I,o)),S.constructor=L,L}}(),function(e){e.PROXIES_ON_INSTANCE_AND_PROTOTYPE="PROXIES_ON_INSTANCE_AND_PROTOTYPE",e.PROXIES_ON_PROTOTYPE="PROXIES_ON_PROTOTYPE",e.PROXY_AFTER_INSTANCE_AND_PROTOTYPE="PROXY_AFTER_INSTANCE_AND_PROTOTYPE"}(S||(S={})),S.PROXIES_ON_INSTANCE_AND_PROTOTYPE;new WeakMap;__webpack_require__(839);const T={};const k=(Symbol("solid-proxy"),Symbol("solid-track"),Symbol("solid-dev-component"),{equals:(e,t)=>e===t});let j=null,A=re;const E={},N=1,C=2,x={owned:null,cleanups:null,context:null,owner:null},[q,R]=X(!1);var M=null;let D,I=null,W=null,L=null,$=null,F=null,V=null,U=null,Y=0;function X(e,t){t=t?Object.assign({},k,t):k;const n={value:e,observers:null,observerSlots:null,pending:E,comparator:t.equals||void 0};return[H.bind(n),e=>("function"==typeof e&&(e=I&&I.running&&I.sources.has(n)?e(n.pending!==E?n.pending:n.tValue):e(n.pending!==E?n.pending:n.value)),J(n,e))]}function B(e,t,n){n=n?Object.assign({},k,n):k;const r=ee(e,t,!0,0);return r.pending=E,r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,W&&I&&I.running?(r.tState=N,V.push(r)):Q(r),H.bind(r)}function G(e){if(F)return e();let t;const n=F=[];try{t=e()}finally{F=null}return ne((()=>{for(let e=0;epe(t())))}function H(){const e=I&&I.running;if(this.sources&&(!e&&this.state||e&&this.tState)){const t=V;V=null,!e&&this.state===N||e&&this.tState===N?Q(this):se(this),V=t}if($){const e=this.observers?this.observers.length:0;$.sources?($.sources.push(this),$.sourceSlots.push(e)):($.sources=[this],$.sourceSlots=[e]),this.observers?(this.observers.push($),this.observerSlots.push($.sources.length-1)):(this.observers=[$],this.observerSlots=[$.sources.length-1])}return e&&I.sources.has(this)?this.tValue:this.value}function J(e,t,n){if(F)return e.pending===E&&F.push(e),e.pending=t,t;if(e.comparator)if(I&&I.running&&I.sources.has(e)){if(e.comparator(e.tValue,t))return t}else if(e.comparator(e.value,t))return t;let r=!1;return I?(r=I.running,(r||!n&&I.sources.has(e))&&(I.sources.add(e),e.tValue=t),r||(e.value=t)):e.value=t,e.observers&&e.observers.length&&ne((()=>{for(let t=0;t1e6)throw V=[],new Error}),!1),t}function Q(e){if(!e.fn)return;ue(e);const t=M,n=$,r=Y;$=M=e,Z(e,I&&I.running&&I.sources.has(e)?e.tValue:e.value,r),I&&!I.running&&I.sources.has(e)&&queueMicrotask((()=>{ne((()=>{I&&(I.running=!0),Z(e,e.tValue,r)}),!1)})),$=n,M=t}function Z(e,t,n){let r;try{r=e.fn(t)}catch(e){ae(e)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?J(e,r,!0):I&&I.running&&e.pure?(I.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ee(e,t,n,r=N,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:M,context:null,pure:n};if(I&&I.running&&(s.state=0,s.tState=r),null===M||M!==x&&(I&&I.running&&M.pure?M.tOwned?M.tOwned.push(s):M.tOwned=[s]:M.owned?M.owned.push(s):M.owned=[s]),L){const[e,t]=X(void 0,{equals:!1}),n=L(s.fn,t);!function(e){null===M||(null===M.cleanups?M.cleanups=[e]:M.cleanups.push(e))}((()=>n.dispose()));const r=()=>function(e){if(I&&I.running)return e(),I.done;const t=$,n=M;return Promise.resolve().then((()=>{let r;return $=t,M=n,(W||D)&&(r=I||(I={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise((e=>r.resolve=e))),r.running=!0),G(e),$=M=null,r?r.done:void 0}))}(t).then((()=>o.dispose())),o=L(s.fn,r);s.fn=t=>(e(),I&&I.running?o.track(t):n.track(t))}return s}function te(e){const t=I&&I.running;if(!t&&0===e.state||t&&0===e.tState)return;if(!t&&e.state===C||t&&e.tState===C)return se(e);if(e.suspense&&K(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--){if(e=n[r],t){let t=e,o=n[r+1];for(;(t=t.owner)&&t!==o;)if(I.disposed.has(t))return}if(!t&&e.state===N||t&&e.tState===N)Q(e);else if(!t&&e.state===C||t&&e.tState===C){const t=V;V=null,se(e,n[0]),V=t}}}function ne(e,t){if(V)return e();let n=!1;t||(V=[]),U?n=!0:U=[],Y++;try{const t=e();return function(e){if(V&&(W&&I&&I.running?function(e){for(let t=0;t{r.delete(n),ne((()=>{I.running=!0,te(n),r.size||(U.push.apply(U,I.effects),I.effects=[])}),!1),I&&(I.running=!1)})))}}(V):re(V),V=null),e)return;let t;if(I&&I.running){if(I.promises.size||I.queue.size)return I.running=!1,I.effects.push.apply(I.effects,U),U=null,void R(!0);const e=I.sources,n=I.disposed;t=I.resolve;for(const e of U)"tState"in e&&(e.state=e.tState),delete e.tState;I=null,G((()=>{for(const e of n)ue(e);for(const t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e{A(U),U=null})):U=null,t&&t()}(n),t}catch(e){V||(U=null),ae(e)}}function re(e){for(let t=0;tn=K((()=>(M.context={[e]:t.value},z((()=>t.children))))))),n}}function _e(){return this()}function de(e){return this(e)}function we(e){const[t,n]=X(e,{equals:!1}),r=e=>void 0===e?t():(n((()=>e)),e),o=_e.bind(r),s=de.bind(r);return r.get=o,r.set=s,r[0]=o,r[1]=s,r[Symbol.iterator]=function*(){yield r[0],yield r[1]},r}function he(e){let t;return function(e,t){const n=$,r=M,o=0===e.length,s=o?x:{owned:null,cleanups:null,context:null,owner:t||r},c=o?e:()=>e((()=>ue(s)));M=s,$=null;try{return ne(c,!0)}finally{$=n,M=r}}((n=>{t=n,function(e,t,n){A=oe;const r=ee(e,t,!1,N),o=D&&le(M,D.id);o&&(r.suspense=o),r.user=!0,U?U.push(r):Q(r)}(e)})),t}function ge(e,t,n){if(1===arguments.length&&"kind"in e){const t=e;return"class"===t.kind?{...t,finisher:ye}:{...t,finisher(e){var n,r;return be(e,t.key),null!==(r=null===(n=t.finisher)||void 0===n?void 0:n.call(t,e))&&void 0!==r?r:e}}}if(1===arguments.length&&"function"==typeof e)return ye(e);be(e.constructor,t)}function be(e,t){e.reactiveProperties&&e.hasOwnProperty("reactiveProperties")||(e.reactiveProperties=[]),e.reactiveProperties.includes(t)||e.reactiveProperties.push(t)}function ye(e){var t;return e.hasOwnProperty("__isReactive__")?e:((t=class extends e{constructor(...t){if($)return K((()=>{const n=Reflect.construct(e,t,new.target);return Oe(n,e),n}));super(...t),Oe(this,e)}}).__isReactive__=!0,t)}function ve(t,n){if("string"!=typeof n)throw new Error("TODO: support for non-string fields with @reactive decorator");const r="v_"+n;let o,s,c,u=(0,e.ld)(t,n);if(u)if(o=u.get,s=u.set,o||s){if(!o||!s)return void console.warn('The `@reactive` decorator was used on an accessor named "'+n+'" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. In this case the decorator does not do anything.');delete u.get,delete u.set}else{if(c=u.value,!u.writable)return void console.warn("The `@reactive` decorator was used on a property named "+n+" that is not writable. Reactivity is not enabled for non-writable properties.");delete u.value,delete u.writable}u={configurable:!0,enumerable:!0,...u,get:o?function(){return Pe(this,r,c)(),o.call(this)}:function(){return Pe(this,r,c)()},set:s?function(e){s.call(this,e),Pe(this,r)(e),this.__propsSetAtLeastOnce__||(this.__propsSetAtLeastOnce__=new Set),this.__propsSetAtLeastOnce__.add(n)}:function(e){Pe(this,r)(e),this.__propsSetAtLeastOnce__||(this.__propsSetAtLeastOnce__=new Set),this.__propsSetAtLeastOnce__.add(n)}},t.__reactifiedProps__||(t.__reactifiedProps__=new Set),t.__reactifiedProps__.add(n),Object.defineProperty(t,n,u)}function Pe(e,t,n=void 0){let r=e[t];return r||(e[t]=r=we(n),r)}function Oe(e,t){if(function(e){return"function"==typeof e}(t)){const n=t.reactiveProperties;Array.isArray(n)&&me(e,n)}else me(e,t);return e}function me(e,t){var n;for(const r of t){if(null===(n=e.__reactifiedProps__)||void 0===n?void 0:n.has(r))continue;const t=e[r];ve(e,r),e[r]=t}}function Se(e,t,n,r){let o=!0;const s=he((()=>{const t=e();o&&!(o=!1)?r(t):o=!0})),c=he((()=>{const e=n();o&&!(o=!1)?t(e):o=!0}));return function(){s(),c()}}Symbol("fallback"),function(e){const t=Symbol("context");fe(t)}();const Te="0.9.0"})();var __webpack_export_target__=LUME="undefined"==typeof LUME?{}:LUME;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); //# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/dist/global.js.map b/dist/global.js.map index 2545bda..b72e3b5 100644 --- a/dist/global.js.map +++ b/dist/global.js.map @@ -1 +1 @@ -{"version":3,"file":"global.js","mappings":"oMAyBA,2BAAe,KAEXA,eAAiBC,kBAAkB,mBACnCC,cAAgBD,kBAAkB,iBAClCE,kBAAoBF,kBAAkB,cAGtCG,iBAAmBC,OAASA,OAAO,mBAAqB,6BAExDC,aACHC,OAAOC,gBACP,SAAwBC,EAAQC,GAC/BD,EAAOE,UAAYD,CACpB,EAGGE,UACFC,SAAWA,QAAQD,WACpB,WACC,GAAIV,cACH,OAAOY,SACN,4BACA,49BAoBCd,eACG,sGAKA,uqCAqDL,IAAIe,EAAe,WAAa,EAChC,OAAO,SAAmBC,EAAkBC,EAAWC,GACtD,GAAyB,IAArBC,UAAUC,QAAkC,mBAAXF,EACpC,MAAM,IAAIG,UAAUH,EAAS,yBAC9BH,EAAaO,WAAaJ,GAAUF,GAAaM,UACjD,IAAIC,EAAW,IAAIR,EACfS,EAAQR,EAAYS,MAAMF,EAAUN,GACxC,MAAqB,iBAAVO,GAAsBA,GAEhCA,EAAMb,WAAaO,GAAUF,GAAaM,UACnCE,GAEDD,CACR,CAED,CAlGD,GAqGGG,gBAAuC,KAC3C,SAASC,eAAeC,EAAaC,GACpC,GAAItB,OAAOuB,qBAAuBvB,OA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qS,GAIf,OAAOrS,CACR,CAOA,SAASuS,GAAwBvS,EAA6B4B,G,MAC7D,IAAK,MAAMC,KAAQD,EAAO,CACzB,GAA2B,QAAvB,EAAA5B,EAAIoS,2BAAmB,eAAE7S,IAAIsC,GAAO,SAExC,MAAMkQ,EAAe/R,EAAI6B,GACzB8P,GAAU3R,EAAK6B,GACf7B,EAAI6B,GAAQkQ,C,CAEd,CASO,SAASS,GACfC,EACAC,EACAC,EACAC,GAEA,IAAIC,GAAU,EAEd,MAAMC,EAAQzC,IAAQ,KACrB,MAAMvB,EAAI2D,IACNI,KAAaA,GAAU,GAAQD,EAAU9D,GACxC+D,GAAU,CAAI,IAGdE,EAAQ1C,IAAQ,KACrB,MAAMvB,EAAI6D,IACNE,KAAaA,GAAU,GAAQH,EAAS5D,GACvC+D,GAAU,CAAI,IAGpB,OAAO,WACNC,IACAC,GACD,CACD,CDqmBiB1X,OAAO,YArcxB,SAAuB2X,GACrB,MAAMjD,EAAK1U,OAAO,WAGNyU,GAAeC,EAG7B,CA2zB4BkD,GCh+BrB,MAAM,GAAU,O","sources":["webpack://LUME/./node_modules/lowclass/src/native.ts","webpack://LUME/./node_modules/lowclass/src/utils.ts","webpack://LUME/webpack/bootstrap","webpack://LUME/webpack/runtime/define property getters","webpack://LUME/webpack/runtime/hasOwnProperty shorthand","webpack://LUME/webpack/runtime/make namespace object","webpack://LUME/./node_modules/lowclass/src/Class.ts","webpack://LUME/./node_modules/lowclass/src/multiple.ts","webpack://LUME/../../node_modules/solid-js/dist/solid.js","webpack://LUME/./src/index.ts"],"sourcesContent":["// borrowed from (and slightly modified) https://github.com/Mr0grog/newless\n// The newless license is BSD 3:\n\n// TODO no any types\n\n/*\n * Copyright (c) 2013-2016, Rob Brackett\n * Copyright (c) 2018, Joseph Orbegoso Pea\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport {getFunctionBody, setDescriptor, Constructor} from './utils.js'\n\nexport {newless as native}\n\nexport default newless\n\nvar supportsSpread = isSyntaxSupported('Object(...[{}])')\nvar supportsClass = isSyntaxSupported('class Test {}')\nvar supportsNewTarget = isSyntaxSupported('new.target')\n\n// Used to track the original wrapped constructor on a newless instance\nvar TRUE_CONSTRUCTOR = Symbol ? Symbol('trueConstructor') : '__newlessTrueConstructor__'\n\nvar setPrototype =\n\tObject.setPrototypeOf ||\n\tfunction setPrototypeOf(object, newPrototype) {\n\t\tobject.__proto__ = newPrototype\n\t}\n\n// Polyfill for Reflect.construct\nvar construct =\n\t(Reflect && Reflect.construct) ||\n\t(function () {\n\t\tif (supportsClass) {\n\t\t\treturn Function(\n\t\t\t\t'constructor, args, target',\n\t\t\t\t`\n 'use strict';\n\n if (arguments.length === 3 && typeof target !== 'function')\n throw new TypeError(target + ' is not a constructor');\n\n target = target || constructor;\n\n // extend target so the right prototype is constructed (or nearly the\n // right one; ideally we'd do instantiator.prototype = target.prototype,\n // but a class's prototype property is not writable)\n class instantiator extends target {};\n // but ensure the *logic* is 'constructor' for ES2015-compliant engines\n Object.setPrototypeOf(instantiator, constructor);\n // ...and for Safari 9\n instantiator.prototype.constructor = constructor;\n\n // The spread operator is *dramatically faster, so use it if we can:\n // http://jsperf.com/new-via-spread-vs-dynamic-function/4\n ${\n\t\t\t\t\tsupportsSpread\n\t\t\t\t\t\t? `\n\n var value = new instantiator(...([].slice.call(args)));\n\n `\n\t\t\t\t\t\t: `\n\n // otherwise, create a dynamic function in order to use 'new'\n // Note using 'function.bind' would be simpler, but is much slower:\n // http://jsperf.com/new-operator-with-dynamic-function-vs-bind\n var argList = '';\n for (var i = 0, len = args.length; i < len; i++) {\n if (i > 0) argList += ',';\n argList += 'args[' + i + ']';\n }\n var constructCall = Function('constructor, args',\n 'return new constructor( ' + argList + ' );'\n );\n var value = constructCall(constructor, args);\n\n args = Array.prototype.slice.call(args);\n args = [null].concat(args);\n var value = new constructor.bind.apply(constructor, args);\n\n `\n\t\t\t\t}\n\n // fix up the prototype so it matches the intended one, not one who's\n // prototype is the intended one :P\n Object.setPrototypeOf(value, target.prototype);\n return value;\n `,\n\t\t\t)\n\n\t\t\t//return Function(\"constructor, args, newTarget\", `\n\t\t\t// 'use strict';\n\n\t\t\t// if (arguments.length === 3 && typeof newTarget === undefined)\n\t\t\t// throw new TypeError('undefined is not a constructor');\n\n\t\t\t// newTarget = newTarget || constructor;\n\n\t\t\t// ${ supportsSpread ? `\n\n\t\t\t// var value = new constructor(...([].slice.call(args)));\n\n\t\t\t// `:`\n\n\t\t\t// args = Array.prototype.slice.call(args);\n\t\t\t// args = [null].concat(args);\n\t\t\t// var value = new constructor.bind.apply(constructor, args);\n\n\t\t\t// `}\n\n\t\t\t// Object.setPrototypeOf(value, newTarget.prototype);\n\t\t\t// return value;\n\t\t\t//`);\n\t\t} else {\n\t\t\tvar instantiator = function () {} as any\n\t\t\treturn function construct(constructor: any, args: any, target: any) {\n\t\t\t\tif (arguments.length === 3 && typeof target !== 'function')\n\t\t\t\t\tthrow new TypeError(target + ' is not a constructor')\n\t\t\t\tinstantiator.prototype = (target || constructor).prototype\n\t\t\t\tvar instance = new instantiator()\n\t\t\t\tvar value = constructor.apply(instance, args)\n\t\t\t\tif (typeof value === 'object' && value) {\n\t\t\t\t\t// we can do better if __proto__ is available (in some ES5 environments)\n\t\t\t\t\tvalue.__proto__ = (target || constructor).prototype\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn instance\n\t\t\t}\n\t\t}\n\t})()\n\n// ES2015 class methods are non-enumerable; we need a helper for copying them.\nvar SKIP_PROPERTIES: (string | symbol)[] = ['arguments', 'caller', 'length', 'name', 'prototype']\nfunction copyProperties(source: any, destination: any) {\n\tif (Object.getOwnPropertyNames && Object.defineProperty) {\n\t\tvar properties: (string | symbol)[] = Object.getOwnPropertyNames(source)\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tproperties = properties.concat(Object.getOwnPropertySymbols(source))\n\t\t}\n\t\tfor (var i = properties.length - 1; i >= 0; i--) {\n\t\t\tif (SKIP_PROPERTIES.indexOf(properties[i]) === -1) {\n\t\t\t\tObject.defineProperty(\n\t\t\t\t\tdestination,\n\t\t\t\t\tproperties[i],\n\t\t\t\t\tObject.getOwnPropertyDescriptor(source, properties[i])!,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var property in source) {\n\t\t\tdestination[property] = source[property]\n\t\t}\n\t}\n}\n\ntype FuncLikeCtor = {\n\t(): T\n\tnew (): T\n} & S\n\nfunction newless(constructor: T): FuncLikeCtor, T> {\n\tvar name = constructor.name\n\n\t// V8 and newer versions of JSCore return the full class declaration from\n\t// `toString()`, which lets us be a little smarter and more performant\n\t// about what to do, since we know we are dealing with a \"class\". Note,\n\t// however, not all engines do this. This could be false and the constructor\n\t// might still use class syntax.\n\tvar usesClassSyntax = constructor.toString().substr(0, 5) === 'class'\n\n\tvar requiresNew = usesClassSyntax ? true : null\n\n\tvar newlessConstructor = (() =>\n\t\tfunction (this: any) {\n\t\t\t// If called with an already valid 'this', preserve that 'this' value\n\t\t\t// in the super-type's constructor whenever possible. With function\n\t\t\t// constructors (as opposed to class constructors), it's possible to\n\t\t\t// alter the instance before calling the super constructor--so it's\n\t\t\t// important to preserve that instance if at all possible.\n\t\t\tif (!requiresNew && this instanceof newlessConstructor) {\n\t\t\t\t// requiresNew = 'false' indicates we know the 'new' operator isn't\n\t\t\t\t// necessary for this constructor, but 'null' indicates uncertainty,\n\t\t\t\t// so the call needs to handle potential errors the first time in\n\t\t\t\t// order to determine whether 'new' is definitely required.\n\t\t\t\tif (requiresNew === false) {\n\t\t\t\t\tconst returnValue = constructor.apply(this, arguments as any)\n\t\t\t\t\treturn (typeof returnValue === 'object' && returnValue) || this\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\trequiresNew = false\n\t\t\t\t\tconst returnValue = constructor.apply(this, arguments as any)\n\t\t\t\t\treturn (typeof returnValue === 'object' && returnValue) || this\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Do our best to only capture errors triggred by class syntax.\n\t\t\t\t\t// Unfortunately, there's no special error type for this and the\n\t\t\t\t\t// message is non-standard, so this is the best check we can do.\n\t\t\t\t\tif (\n\t\t\t\t\t\terror instanceof TypeError &&\n\t\t\t\t\t\t(/class constructor/i.test(error.message) || /use the 'new' operator/i.test(error.message)) // Custom Elements in Chrome\n\t\t\t\t\t\t// TODO: there might be other error messages we need to catch,\n\t\t\t\t\t\t// depending on engine and use case. We need to test in all browsers\n\t\t\t\t\t) {\n\t\t\t\t\t\t// mark this constructor as requiring 'new' for next time\n\t\t\t\t\t\trequiresNew = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\terror instanceof Error &&\n\t\t\t\t\t\t\t/Illegal constructor/i.test(error.message) &&\n\t\t\t\t\t\t\tObject.create(constructor.prototype) instanceof Node\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`The following error can happen if a Custom Element is called\nwith 'new' before being defined. The constructor was ${constructor.name}: `,\n\t\t\t\t\t\t\t\tconstructor,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// make a reasonably good replacement for 'new.target' which is a\n\t\t\t// syntax error in older engines\n\t\t\tvar newTarget\n\t\t\tvar hasNewTarget = false\n\t\t\tif (supportsNewTarget) {\n\t\t\t\teval('newTarget = new.target')\n\t\t\t\tif (newTarget) hasNewTarget = true\n\t\t\t}\n\t\t\tif (!supportsNewTarget || !hasNewTarget) {\n\t\t\t\tnewTarget = this instanceof newlessConstructor ? this.constructor : constructor\n\t\t\t}\n\t\t\tconst returnValue = construct(constructor, arguments, newTarget)\n\t\t\t// best effort to make things easy for functions inheriting from classes\n\t\t\tif (this instanceof newlessConstructor) {\n\t\t\t\tsetPrototype(this, returnValue)\n\t\t\t}\n\t\t\treturn returnValue\n\t\t})()\n\n\tif (name) {\n\t\tconst code = getFunctionBody(newlessConstructor)\n\n\t\tnewlessConstructor = Function(\n\t\t\t'constructor, construct, setPrototype, requiresNew, supportsNewTarget',\n\t\t\t`\n var newlessConstructor = function ${name}() { ${code} };\n return newlessConstructor\n `,\n\t\t)(constructor, construct, setPrototype, requiresNew, supportsNewTarget)\n\t}\n\n\t// copy the `.length` value to the newless constructor\n\tif (constructor.length) {\n\t\t// length is not writable, only configurable, therefore the value\n\t\t// has to be set with a descriptor update\n\t\tsetDescriptor(newlessConstructor, 'length', {\n\t\t\tvalue: constructor.length,\n\t\t})\n\t}\n\n\tnewlessConstructor.prototype = Object.create(constructor.prototype)\n\tnewlessConstructor.prototype.constructor = newlessConstructor\n\n\t// NOTE: *usually* the below will already be true, but we ensure it here.\n\t// Safari 9 requires this for the 'super' keyword to work. Newer versions\n\t// of WebKit and other engines do not. Instead, they use the constructor's\n\t// prototype chain (which is correct by ES2015 spec) (see below).\n\tconstructor.prototype.constructor = constructor\n\n\t// for ES2015 classes, we need to make sure the constructor's prototype\n\t// is the super class's constructor. Further, optimize performance by\n\t// pointing at the actual constructor implementation instead of the\n\t// newless wrapper (in the case that it is wrapped by newless).\n\t;(newlessConstructor as any)[TRUE_CONSTRUCTOR] = constructor\n\n\tcopyProperties(constructor, newlessConstructor)\n\tsetPrototype(newlessConstructor, constructor)\n\n\treturn newlessConstructor as FuncLikeCtor, T>\n}\n\n// Test whether a given syntax is supported\nfunction isSyntaxSupported(example: string, useStrict = true): boolean {\n\ttry {\n\t\treturn !!Function('', (useStrict ? \"'use strict';\" : '') + example)\n\t} catch (error) {\n\t\treturn false\n\t}\n}\n","// TODO no any\n\nexport class WeakTwoWayMap {\n\tm = new WeakMap()\n\tset(a: Object, b: Object) {\n\t\tthis.m.set(a, b)\n\t\tthis.m.set(b, a)\n\t}\n\tget(item: Object) {\n\t\treturn this.m.get(item)\n\t}\n\thas(item: Object) {\n\t\treturn this.m.has(item)\n\t}\n}\n\n// assumes the function opening, body, and closing are on separate lines\nexport function getFunctionBody(fn: Function): string {\n\tconst code = fn.toString().split('\\n')\n\tcode.shift() // remove opening line (function() {)\n\tcode.pop() // remove closing line (})\n\treturn code.join('\\n')\n}\n\nconst descriptorDefaults = {\n\tenumerable: true,\n\tconfigurable: true,\n}\n\n// makes it easier and less verbose to work with descriptors\nexport function setDescriptor(obj: Object, key: string, newDescriptor: PropertyDescriptor, inherited = false): void {\n\tlet currentDescriptor = inherited ? getInheritedDescriptor(obj, key) : Object.getOwnPropertyDescriptor(obj, key)\n\n\tnewDescriptor = overrideDescriptor(currentDescriptor, newDescriptor)\n\tObject.defineProperty(obj, key, newDescriptor)\n}\n\nexport function setDescriptors(obj: Object, newDescriptors: Record): void {\n\tlet newDescriptor\n\tlet currentDescriptor\n\tconst currentDescriptors = Object.getOwnPropertyDescriptors(obj)\n\n\tfor (const key in newDescriptors) {\n\t\tnewDescriptor = newDescriptors[key]\n\t\tcurrentDescriptor = currentDescriptors[key]\n\t\tnewDescriptors[key] = overrideDescriptor(currentDescriptor, newDescriptor)\n\t}\n\n\tObject.defineProperties(obj, newDescriptors)\n}\n\nfunction overrideDescriptor(\n\toldDescriptor: PropertyDescriptor | undefined,\n\tnewDescriptor: PropertyDescriptor,\n): PropertyDescriptor {\n\tif (\n\t\t('get' in newDescriptor || 'set' in newDescriptor) &&\n\t\t('value' in newDescriptor || 'writable' in newDescriptor)\n\t) {\n\t\tthrow new TypeError('cannot specify both accessors and a value or writable attribute')\n\t}\n\n\tif (oldDescriptor) {\n\t\tif ('get' in newDescriptor || 'set' in newDescriptor) {\n\t\t\tdelete oldDescriptor.value\n\t\t\tdelete oldDescriptor.writable\n\t\t} else if ('value' in newDescriptor || 'writable' in newDescriptor) {\n\t\t\tdelete oldDescriptor.get\n\t\t\tdelete oldDescriptor.set\n\t\t}\n\t}\n\n\treturn {...descriptorDefaults, ...oldDescriptor, ...newDescriptor}\n}\n\n// TODO use signature override\nexport function propertyIsAccessor(obj: Object | PropertyDescriptor, key?: string, inherited = true): boolean {\n\tlet result = false\n\tlet descriptor: PropertyDescriptor | undefined\n\n\tif (arguments.length === 1) {\n\t\tdescriptor = obj\n\t} else {\n\t\tdescriptor = inherited ? getInheritedDescriptor(obj, key!) : Object.getOwnPropertyDescriptor(obj, key!)\n\t}\n\n\tif (descriptor && (descriptor.get || descriptor.set)) result = true\n\n\treturn result\n}\n\ninterface DescriptorWithOwner extends PropertyDescriptor {\n\towner: object\n}\n\nexport function getInheritedDescriptor(obj: object, key: string): DescriptorWithOwner | undefined {\n\tlet currentProto = obj\n\tlet descriptor\n\n\twhile (currentProto) {\n\t\tdescriptor = Object.getOwnPropertyDescriptor(currentProto, key)\n\n\t\tif (descriptor) {\n\t\t\t;(descriptor as DescriptorWithOwner).owner = currentProto\n\t\t\treturn descriptor as DescriptorWithOwner\n\t\t}\n\n\t\tcurrentProto = (currentProto as any).__proto__\n\t}\n\n\treturn void 0\n}\n\nexport function getInheritedPropertyNames(obj: Object): string[] {\n\tlet currentProto = obj\n\tlet keys: string[] = []\n\n\twhile (currentProto) {\n\t\tkeys = keys.concat(Object.getOwnPropertyNames(currentProto))\n\t\tcurrentProto = (currentProto as any).__proto__\n\t}\n\n\t// remove duplicates\n\tkeys = Array.from(new Set(keys))\n\n\treturn keys\n}\n\nexport type Constructor = (new (...a: A) => T) & Static\n\n// this is used for type casting in special cases, see the declaration file\nexport function Constructor(Ctor: Constructor): Constructor & Static {\n\treturn Ctor as unknown as Constructor & Static\n}\n\n// check if an object has the given prototype in its chain\nexport function hasPrototype(obj: any, proto: any) {\n\tlet currentProto = obj.__proto__\n\n\tdo {\n\t\tif (proto === currentProto) return true\n\t\tcurrentProto = currentProto.__proto__\n\t} while (currentProto)\n\n\treturn false\n}\n\n// copy all properties (as descriptors) from source to destination\nexport function copyDescriptors(source: Object, destination: Object, mod?: any) {\n\tconst props = Object.getOwnPropertyNames(source)\n\tlet i = props.length\n\twhile (i--) {\n\t\tconst prop = props[i]\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(source, prop)\n\t\tif (mod) mod(descriptor)\n\t\tObject.defineProperty(destination, prop, descriptor!)\n\t}\n}\n\nexport function setDefaultPrototypeDescriptors(\n\tprototype: Object,\n\t{defaultClassDescriptor: {writable, enumerable, configurable}}: any,\n) {\n\tconst descriptors = Object.getOwnPropertyDescriptors(prototype)\n\tlet descriptor\n\n\tfor (const key in descriptors) {\n\t\tdescriptor = descriptors[key]\n\n\t\t// regular value\n\t\tif ('value' in descriptor || 'writable' in descriptor) {\n\t\t\tdescriptor.writable = writable\n\t\t}\n\n\t\t// accessor or regular value\n\t\tdescriptor.enumerable = enumerable\n\t\tdescriptor.configurable = configurable\n\t}\n\n\tsetDescriptors(prototype, descriptors)\n}\n\nexport function setDefaultStaticDescriptors(\n\tCtor: any,\n\t{defaultClassDescriptor: {writable, enumerable, configurable}}: any,\n\tstaticBlacklist?: (string | symbol)[],\n) {\n\tconst descriptors = Object.getOwnPropertyDescriptors(Ctor)\n\tlet descriptor\n\n\tfor (const key in descriptors) {\n\t\tif (staticBlacklist && staticBlacklist.includes(key)) {\n\t\t\tdelete descriptors[key]\n\t\t\tcontinue\n\t\t}\n\n\t\tdescriptor = descriptors[key]\n\n\t\t// regular value\n\t\tif ('value' in descriptor || 'writable' in descriptor) {\n\t\t\tdescriptor.writable = writable\n\t\t}\n\n\t\t// accessor or regular value\n\t\tdescriptor.enumerable = enumerable\n\t\tdescriptor.configurable = configurable\n\t}\n\n\tsetDescriptors(Ctor, descriptors)\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// TODO\n// [x] remove the now-unnecessary modes (leave just what was 'es5' mode)\n// [x] link helpers to each other, making it possible to destructure the arguments to definer functions\n// [x] let access helper prototype objects extend from Object, otherwise common tools are not available.\n// [x] accept a function as return value of function definer, to be treated as a class to derive the definition from, so that it can have access to Protected and Private helpers\n// [x] let the returned class define protected and private getters which return the protected and private definitions.\n// [ ] protected and private static members\n// [ ] no `any` types\n// [ ] other TODOs in the code\n\nimport {\n\tConstructor,\n\tcopyDescriptors,\n\tsetDefaultStaticDescriptors,\n\tsetDefaultPrototypeDescriptors,\n\thasPrototype,\n} from './utils.js'\n\nimport type {Id} from './types.js'\n\ntype ImplementationKeys = 'static' | 'private' | 'protected'\n\ntype FunctionToConstructor = T extends (...a: infer A) => void ? new (...a: A) => TReturn : never\n\n// Note, void also works the same in place of unknown\ntype ReplaceCtorReturn = T extends new (...a: infer A) => unknown ? new (...a: A) => TReturn : never\n\ntype ConstructorOrDefault = T extends {constructor: infer TCtor} ? TCtor : () => void\n\n// Although the SuperType type definiton already checks that T extends from\n// Constructor, the additional check in the generic paramters is useful so\n// that we don't get an error about \"never\" which is hard to track down. The\n// generic paramter will cause a more helpful and understandable error.\n// TODO ensure that T is InstanceType of TBase\n// prettier-ignore\ntype SuperType<_T, TSuper extends Constructor> = TSuper extends Constructor\n ? {constructor: (...a: A) => I} & InstanceType\n : never\n// type SuperType<\n// T extends InstanceType,\n// TSuper extends Constructor\n// > = TSuper extends Constructor\n// ? T extends InstanceType\n// ? {constructor: (...a: A) => I} & Id>\n// : never\n// : never\n\ntype SuperHelper = (self: T) => SuperType\ntype PrivateHelper = (self: T) => T extends {__: {private: infer TPrivate}} ? TPrivate : never\ntype PublicHelper = (self: T) => Omit // TODO validate instance is public?\ntype ProtectedHelper = (self: T) => T extends {__: {protected: infer TProtected}} ? TProtected : never\n// type ProtectedHelper = (self: T) => T extends {protected: infer TProtected} ? TProtected : never\ntype Statics = T extends {static: infer TStatic} ? TStatic : {}\ntype SaveInheritedProtected = T extends {protected: infer TProtected} ? TProtected : {}\n\n// there's a missing link here: if the super class of T is a native class\n// that extends from a lowclass class, then we don't inherit those protected\n// members. Any ideas?\ntype StaticsAndProtected = Id & {__: {protected: SaveInheritedProtected}}>\n\ntype ExtractInheritedProtected = T extends {__: infer TProtected} ? TProtected : {}\ntype PickImplementationKeys = Pick> // similar to Pick, but not quite\n\n// this moves the implementation keys off the constructor return type and\n// onto a fake __ property, so that we can reference the __ type within the\n// implementatin code, but so that the outside (public) doesn't see the fake\n// __ property.\ntype LowClassThis = Id & {__: PickImplementationKeys}>\n\ntype OmitImplementationKeys = Omit\n\nimport {\n\tgetFunctionBody,\n\tsetDescriptor,\n\tpropertyIsAccessor,\n\tgetInheritedDescriptor,\n\tgetInheritedPropertyNames,\n\tWeakTwoWayMap,\n} from './utils.js'\n\nexport const staticBlacklist = ['subclass', 'extends', ...Object.getOwnPropertyNames(new Function())]\n\nconst publicProtoToProtectedProto = new WeakMap()\nconst publicProtoToPrivateProto = new WeakMap()\n\n// A two-way map to associate public instances with protected instances.\n// There is one protected instance per public instance\nconst publicToProtected = new WeakTwoWayMap()\n\n// so we can get the class scope associated with a private instance\nconst privateInstanceToClassScope = new WeakMap()\n\nconst brandToPublicPrototypes = new WeakMap()\nconst brandToProtectedPrototypes = new WeakMap()\nconst brandToPrivatePrototypes = new WeakMap()\nconst brandToPublicsPrivates = new WeakMap()\n\nconst defaultOptions = {\n\t// es5 class inheritance is simple, nice, easy, and robust\n\t// There was another mode, but it has been removed\n\tmode: 'es5',\n\n\t// false is better for performance, but true will use Function (similar to\n\t// eval) to name your class functions in the most accurate way.\n\tnativeNaming: false,\n\n\t// similar to ES6 classes:\n\tprototypeWritable: false,\n\tdefaultClassDescriptor: {\n\t\twritable: true,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t},\n\tsetClassDescriptors: true,\n}\n\nexport class InvalidSuperAccessError extends Error {}\nexport class InvalidAccessError extends Error {}\n\nexport const Class = createClassHelper()\n\nexport function createClassHelper(options?: any) {\n\toptions = options ? {...defaultOptions, ...options} : defaultOptions\n\n\toptions.defaultClassDescriptor = {\n\t\t...defaultOptions.defaultClassDescriptor,\n\t\t...options.defaultClassDescriptor,\n\t}\n\n\tconst {mode, prototypeWritable, setClassDescriptors, nativeNaming} = options\n\n\t/*\n\t * this is just the public interface adapter for createClass(). Depending\n\t * on how you call this interface, you can do various things like:\n\t *\n\t * - anonymous empty class\n\t *\n\t * Class()\n\t *\n\t * - named empty class\n\t *\n\t * Class('Foo')\n\t *\n\t * - base class named Foo\n\t *\n\t * Class('Foo', (Public, Protected, Private) => {\n\t * someMethod() { ... },\n\t * })\n\t *\n\t * - anonymous base class\n\t *\n\t * Class((Public, Protected, Private) => {\n\t * someMethod() { ... },\n\t * })\n\t *\n\t * Class('Foo').extends(OtherClass, (Public, Protected, Private) => ({\n\t * someMethod() { ... },\n\t * }))\n\t *\n\t * OtherClass.subclass = Class\n\t * const Bar = OtherClass.subclass((Public, Protected, Private) => {\n\t * ...\n\t * })\n\t *\n\t * - any class made with lowclass has a static subclass if you prefer using\n\t * that:\n\t *\n\t * Bar.subclass('Baz', (Public, Protected, Private) => {...})\n\t *\n\t * - but you could as well do\n\t *\n\t * Class('Baz').extends(Bar, (Public, Protected, Private) => {...})\n\t */\n\tfunction Class(): typeof Object\n\t// export function Class(\n\tfunction Class(name: string): {\n\t\textends(\n\t\t\tbase: TBase,\n\t\t\tmembers: (helpers: {\n\t\t\t\tSuper: SuperHelper\n\t\t\t\tPublic: PublicHelper\n\t\t\t\tProtected: ProtectedHelper\n\t\t\t\tPrivate: PrivateHelper\n\t\t\t}) => T &\n\t\t\t\tPartial> &\n\t\t\t\tThisType & ExtractInheritedProtected>>,\n\t\t\tbrand?: object,\n\t\t): T extends {constructor: infer _TCtor}\n\t\t\t? FunctionToConstructor, Id & OmitImplementationKeys>> &\n\t\t\t\t\tId & Pick>\n\t\t\t: ReplaceCtorReturn>> & Id & Pick>\n\t}\n\tfunction Class(\n\t\tname: string,\n\t\tmembers: (\n\t\t\thelpers: {\n\t\t\t\tPublic: PublicHelper\n\t\t\t\tProtected: ProtectedHelper\n\t\t\t\tPrivate: PrivateHelper\n\t\t\t\tSuper: never\n\t\t\t}, // TODO Super is actually Object\n\t\t) => T & ThisType>,\n\t\tbrand?: object,\n\t): FunctionToConstructor, Id>> & Id>\n\tfunction Class(\n\t\tname: string,\n\t\tmembers: T & ThisType>,\n\t\tbrand?: object,\n\t): FunctionToConstructor, Id>> & Id>\n\tfunction Class(this: any, ...args: any[]) {\n\t\tlet usingStaticSubclassMethod = false\n\n\t\t// if called as SomeConstructor.subclass, or bound to SomeConstructor\n\t\tif (typeof this === 'function') usingStaticSubclassMethod = true\n\n\t\t// f.e. `Class()`, `Class('Foo')`, `Class('Foo', {...})` , `Class('Foo',\n\t\t// {...}, Brand)`, similar to `class {}`, `class Foo {}`, class Foo\n\t\t// {...}, and class Foo {...} with branding (see comments on classBrand\n\t\t// below regarding positional privacy)\n\t\tif (args.length <= 3) {\n\t\t\tlet name = ''\n\t\t\tlet definer: any = null\n\t\t\tlet classBrand: any = null\n\n\t\t\t// f.e. `Class('Foo')`\n\t\t\tif (typeof args[0] === 'string') name = args[0]\n\t\t\t// f.e. `Class((pub, prot, priv) => ({ ... }))`\n\t\t\telse if (typeof args[0] === 'function' || typeof args[0] === 'object') {\n\t\t\t\tdefiner = args[0]\n\t\t\t\tclassBrand = args[1]\n\t\t\t}\n\n\t\t\t// f.e. `Class('Foo', (pub, prot, priv) => ({ ... }))`\n\t\t\tif (typeof args[1] === 'function' || typeof args[1] === 'object') {\n\t\t\t\tdefiner = args[1]\n\t\t\t\tclassBrand = args[2]\n\t\t\t}\n\n\t\t\t// Make a class in case we wanted to do just `Class()` or\n\t\t\t// `Class('Foo')`...\n\t\t\tconst Ctor = usingStaticSubclassMethod\n\t\t\t\t? createClass.call(this, name, definer, classBrand)\n\t\t\t\t: createClass(name, definer, classBrand)\n\n\t\t\t// ...but add the extends helper in case we wanted to do like:\n\t\t\t// Class().extends(OtherClass, (Public, Protected, Private) => ({\n\t\t\t// ...\n\t\t\t// }))\n\t\t\tCtor.extends = function (ParentClass: any, def: any, brand: any) {\n\t\t\t\tdef = def || definer\n\t\t\t\tbrand = brand || classBrand\n\t\t\t\treturn createClass.call(ParentClass, name, def, brand)\n\t\t\t}\n\n\t\t\treturn Ctor\n\t\t}\n\n\t\tthrow new TypeError('invalid args')\n\t}\n\n\treturn Class\n\n\t/**\n\t * @param {string} className The name that the class being defined should\n\t * have.\n\t * @param {Function} definer A function or object for defining the class.\n\t * If definer a function, it is passed the Public, Protected, Private, and\n\t * Super helpers. Methods and properties can be defined on the helpers\n\t * directly. An object containing methods and properties can also be\n\t * returned from the function. If definer is an object, the object should\n\t * be in the same format as the one returned if definer were a function.\n\t */\n\tfunction createClass(this: any, className: string, definer: (...args: any[]) => any, classBrand: object) {\n\t\t'use strict'\n\n\t\t// f.e. ParentClass.subclass((Public, Protected, Private) => {...})\n\t\tlet ParentClass = this\n\n\t\tif (typeof className !== 'string') {\n\t\t\tthrow new TypeError(`\n You must specify a string for the 'className' argument.\n `)\n\t\t}\n\n\t\tlet definition = null\n\n\t\t// f.e. Class('Foo', { ... })\n\t\tif (definer && typeof definer === 'object') {\n\t\t\tdefinition = definer\n\t\t}\n\n\t\t// Return early if there's no definition or parent class, just a simple\n\t\t// extension of Object. f.e. when doing just `Class()` or\n\t\t// `Class('Foo')`\n\t\telse if (!ParentClass && (!definer || (typeof definer !== 'function' && typeof definer !== 'object'))) {\n\t\t\tlet Ctor\n\n\t\t\tif (nativeNaming && className) Ctor = new Function(`return function ${className}() {}`)()\n\t\t\telse {\n\t\t\t\t// force anonymous even in ES6+\n\t\t\t\tCtor = (() => function () {})()\n\n\t\t\t\tif (className) setDescriptor(Ctor, 'name', {value: className})\n\t\t\t}\n\n\t\t\tCtor.prototype = {__proto__: Object.prototype, constructor: Ctor}\n\n\t\t\t// no static inheritance here, just like with `class Foo {}`\n\n\t\t\tsetDescriptor(Ctor, 'subclass', {\n\t\t\t\tvalue: Class,\n\t\t\t\twritable: true, // TODO maybe let's make this non writable\n\t\t\t\tenumerable: false,\n\t\t\t\tconfigurable: false,\n\t\t\t})\n\n\t\t\treturn Ctor\n\t\t}\n\n\t\t// A two-way map to associate public instances with private instances.\n\t\t// Unlike publicToProtected, this is inside here because there is one\n\t\t// private instance per class scope per instance (or to say it another\n\t\t// way, each instance has as many private instances as the number of\n\t\t// classes that the given instance has in its inheritance chain, one\n\t\t// private instance per class)\n\t\tconst scopedPublicsToPrivates = classBrand ? void undefined : new WeakTwoWayMap()\n\n\t\tif (classBrand) {\n\t\t\tif (!brandToPublicsPrivates.get(classBrand)) brandToPublicsPrivates.set(classBrand, new WeakTwoWayMap())\n\t\t}\n\n\t\t// if no brand provided, then we use the most fine-grained lexical\n\t\t// privacy. Lexical privacy is described at\n\t\t// https://github.com/tc39/proposal-class-fields/issues/60\n\t\t//\n\t\t// TODO make prototypes non-configurable so that the clasds-brand system\n\t\t// can't be tricked. For now, it's good enough, most people aren't going\n\t\t// to go out of their way to mangle with the prototypes in order to\n\t\t// force invalid private access.\n\t\tclassBrand = classBrand || {brand: 'lexical'}\n\n\t\t// the class \"scope\" that we will bind to the helper functions\n\t\tconst scope = {\n\t\t\tclassName, // convenient for debugging\n\n\t\t\tget publicToPrivate() {\n\t\t\t\treturn scopedPublicsToPrivates ? scopedPublicsToPrivates : brandToPublicsPrivates.get(classBrand)\n\t\t\t},\n\n\t\t\tclassBrand,\n\n\t\t\t// we use these to memoize the Public/Protected/Private access\n\t\t\t// helper results, to make subsequent accessses faster.\n\t\t\tcachedPublicAccesses: new WeakMap(),\n\t\t\tcachedProtectedAccesses: new WeakMap(),\n\t\t\tcachedPrivateAccesses: new WeakMap(),\n\t\t} as any\n\n\t\t// create the super helper for this class scope\n\t\tconst supers = new WeakMap()\n\t\tconst Super = superHelper.bind(null, supers, scope)\n\n\t\t// bind this class' scope to the helper functions\n\t\tconst Public = getPublicMembers.bind(null, scope) as any\n\t\tconst Protected = getProtectedMembers.bind(null, scope) as any\n\t\tconst Private = getPrivateMembers.bind(null, scope) as any\n\n\t\tPublic.prototype = {}\n\t\tProtected.prototype = {}\n\t\tPrivate.prototype = {}\n\n\t\t// alows the user to destructure arguments to definer functions\n\t\tPublic.Public = Public\n\t\tPublic.Protected = Protected\n\t\tPublic.Private = Private\n\t\tPublic.Super = Super\n\t\tProtected.Public = Public\n\t\tProtected.Protected = Protected\n\t\tProtected.Private = Private\n\t\tProtected.Super = Super\n\t\t// Private and Super are never passed as first argument\n\n\t\t// pass the helper functions to the user's class definition function\n\t\tdefinition = definition || (definer && definer(Public, Protected, Private, Super))\n\n\t\t// the user has the option of returning an object that defines which\n\t\t// properties are public/protected/private.\n\t\tif (definition && typeof definition !== 'object' && typeof definition !== 'function') {\n\t\t\tthrow new TypeError(`\n The return value of a class definer function, if any, should be\n an object, or a class constructor.\n `)\n\t\t}\n\n\t\t// if a function was returned, we assume it is a class from which we\n\t\t// get the public definition from.\n\t\tlet customClass = null\n\t\tif (typeof definition === 'function') {\n\t\t\tcustomClass = definition\n\t\t\tdefinition = definition.prototype\n\t\t\tParentClass = customClass.prototype.__proto__.constructor\n\t\t}\n\n\t\tlet staticMembers\n\n\t\t// if functions were provided for the public/protected/private\n\t\t// properties of the definition object, execute them with their\n\t\t// respective access helpers, and use the objects returned from them.\n\t\tif (definition) {\n\t\t\tstaticMembers = definition.static\n\t\t\tdelete definition.static\n\n\t\t\tif (typeof definition.public === 'function') {\n\t\t\t\tdefinition.public = definition.public(Protected, Private)\n\t\t\t}\n\n\t\t\tif (typeof definition.protected === 'function') {\n\t\t\t\tdefinition.protected = definition.protected(Public, Private)\n\t\t\t}\n\n\t\t\tif (typeof definition.private === 'function') {\n\t\t\t\tdefinition.private = definition.private(Public, Protected)\n\t\t\t}\n\t\t}\n\n\t\tParentClass = ParentClass || Object\n\n\t\t// extend the parent class\n\t\tconst parentPublicPrototype = ParentClass.prototype\n\t\tconst publicPrototype = (definition && definition.public) || definition || Object.create(parentPublicPrototype)\n\t\tif (publicPrototype.__proto__ !== parentPublicPrototype) publicPrototype.__proto__ = parentPublicPrototype\n\n\t\t// extend the parent protected prototype\n\t\tconst parentProtectedPrototype = getParentProtectedPrototype(parentPublicPrototype)\n\t\tconst protectedPrototype = (definition && definition.protected) || Object.create(parentProtectedPrototype)\n\t\tif (protectedPrototype.__proto__ !== parentProtectedPrototype)\n\t\t\tprotectedPrototype.__proto__ = parentProtectedPrototype\n\t\tpublicProtoToProtectedProto.set(publicPrototype, protectedPrototype)\n\n\t\t// private prototype inherits from parent, but each private instance is\n\t\t// private only for the class of this scope\n\t\tconst parentPrivatePrototype = getParentPrivatePrototype(parentPublicPrototype)\n\t\tconst privatePrototype = (definition && definition.private) || Object.create(parentPrivatePrototype)\n\t\tif (privatePrototype.__proto__ !== parentPrivatePrototype) privatePrototype.__proto__ = parentPrivatePrototype\n\t\tpublicProtoToPrivateProto.set(publicPrototype, privatePrototype)\n\n\t\tif (!brandToPublicPrototypes.get(classBrand)) brandToPublicPrototypes.set(classBrand, new Set())\n\t\tif (!brandToProtectedPrototypes.get(classBrand)) brandToProtectedPrototypes.set(classBrand, new Set())\n\t\tif (!brandToPrivatePrototypes.get(classBrand)) brandToPrivatePrototypes.set(classBrand, new Set())\n\n\t\tbrandToPublicPrototypes.get(classBrand).add(publicPrototype)\n\t\tbrandToProtectedPrototypes.get(classBrand).add(protectedPrototype)\n\t\tbrandToPrivatePrototypes.get(classBrand).add(privatePrototype)\n\n\t\tscope.publicPrototype = publicPrototype\n\t\tscope.privatePrototype = privatePrototype\n\t\tscope.protectedPrototype = protectedPrototype\n\t\tscope.parentPublicPrototype = parentPublicPrototype\n\t\tscope.parentProtectedPrototype = parentProtectedPrototype\n\t\tscope.parentPrivatePrototype = parentPrivatePrototype\n\n\t\t// the user has the option of assigning methods and properties to the\n\t\t// helpers that we passed in, to let us know which methods and\n\t\t// properties are public/protected/private so we can assign them onto\n\t\t// the respective prototypes.\n\t\tcopyDescriptors(Public.prototype, publicPrototype)\n\t\tcopyDescriptors(Protected.prototype, protectedPrototype)\n\t\tcopyDescriptors(Private.prototype, privatePrototype)\n\n\t\tif (definition) {\n\t\t\t// delete these so we don't expose them on the class' public\n\t\t\t// prototype\n\t\t\tdelete definition.public\n\t\t\tdelete definition.protected\n\t\t\tdelete definition.private\n\n\t\t\t// if a `public` object was also supplied, we treat that as the public\n\t\t\t// prototype instead of the base definition object, so we copy the\n\t\t\t// definition's props to the `public` object\n\t\t\t//\n\t\t\t// TODO For now we copy from the definition object to the 'public'\n\t\t\t// object (publicPrototype), but this won't work with native `super`.\n\t\t\t// Maybe later, we can use a Proxy to read props from both the root\n\t\t\t// object and the public object, so that `super` works from both.\n\t\t\t// Another option is to not allow a `public` object, only protected\n\t\t\t// and private\n\t\t\tif (definition !== publicPrototype) {\n\t\t\t\t// copy whatever remains\n\t\t\t\tcopyDescriptors(definition, publicPrototype)\n\t\t\t}\n\t\t}\n\n\t\tif (customClass) {\n\t\t\tif (staticMembers) copyDescriptors(staticMembers, customClass)\n\t\t\treturn customClass\n\t\t}\n\n\t\tconst userConstructor = publicPrototype.hasOwnProperty('constructor') ? publicPrototype.constructor : null\n\n\t\tlet NewClass = null\n\t\tlet newPrototype = null\n\n\t\t// ES5 version (which seems to be so much better)\n\t\tif (mode === 'es5') {\n\t\t\tNewClass = (() =>\n\t\t\t\tfunction (this: any) {\n\t\t\t\t\tlet ret = null\n\n\t\t\t\t\tlet constructor = null\n\n\t\t\t\t\tif (userConstructor) constructor = userConstructor\n\t\t\t\t\telse constructor = ParentClass\n\n\t\t\t\t\t// Object is a special case because otherwise\n\t\t\t\t\t// `Object.apply(this)` returns a different object and we don't\n\t\t\t\t\t// want to deal with return value in that case\n\t\t\t\t\tif (constructor !== Object) ret = constructor.apply(this, arguments)\n\n\t\t\t\t\tif (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n\t\t\t\t\t\t// XXX should we set ret.__proto__ = constructor.prototype\n\t\t\t\t\t\t// here? Or let the user deal with that?\n\t\t\t\t\t\treturn ret\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this\n\t\t\t\t})()\n\n\t\t\tnewPrototype = publicPrototype\n\t\t} else {\n\t\t\tthrow new TypeError(`\n The lowclass \"mode\" option can only be 'es5' for now.\n `)\n\t\t}\n\n\t\tif (className) {\n\t\t\tif (nativeNaming) {\n\t\t\t\tconst code = getFunctionBody(NewClass)\n\t\t\t\tconst proto = NewClass.prototype\n\n\t\t\t\tNewClass = new Function(\n\t\t\t\t\t` userConstructor, ParentClass `,\n\t\t\t\t\t`\n return function ${className}() { ${code} }\n `,\n\t\t\t\t)(userConstructor, ParentClass)\n\n\t\t\t\tNewClass.prototype = proto\n\t\t\t} else {\n\t\t\t\tsetDescriptor(NewClass, 'name', {value: className})\n\t\t\t}\n\t\t}\n\n\t\tif (userConstructor && userConstructor.length) {\n\t\t\t// length is not writable, only configurable, therefore the value\n\t\t\t// has to be set with a descriptor update\n\t\t\tsetDescriptor(NewClass, 'length', {\n\t\t\t\tvalue: userConstructor.length,\n\t\t\t})\n\t\t}\n\n\t\t// static stuff {\n\n\t\t// static inheritance\n\t\tNewClass.__proto__ = ParentClass\n\n\t\tif (staticMembers) copyDescriptors(staticMembers, NewClass)\n\n\t\t// allow users to make subclasses. When subclass is called on a\n\t\t// constructor, it defines `this` which is assigned to ParentClass\n\t\t// above.\n\t\tsetDescriptor(NewClass, 'subclass', {\n\t\t\tvalue: Class,\n\t\t\twritable: true,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false,\n\t\t})\n\n\t\t// }\n\n\t\t// prototype stuff {\n\n\t\tNewClass.prototype = newPrototype\n\n\t\tNewClass.prototype.constructor = NewClass\n\n\t\t// }\n\n\t\tif (setClassDescriptors) {\n\t\t\tsetDefaultStaticDescriptors(NewClass, options, staticBlacklist)\n\t\t\tsetDescriptor(NewClass, 'prototype', {writable: prototypeWritable})\n\t\t\tsetDefaultPrototypeDescriptors(NewClass.prototype, options)\n\t\t\tsetDefaultPrototypeDescriptors(protectedPrototype, options)\n\t\t\tsetDefaultPrototypeDescriptors(privatePrototype, options)\n\t\t}\n\n\t\tscope.constructor = NewClass // convenient for debugging\n\n\t\treturn NewClass\n\t}\n}\n\n// XXX PERFORMANCE: instead of doing multiple prototype traversals with\n// hasPrototype in the following access helpers, maybe we can do a single\n// traversal and check along the way?\n//\n// Worst case examples:\n//\n// currently:\n// If class hierarchy has 20 classes\n// If we detect which instance we have in order of public, protected, private\n// If the instance we're checking is the private instance of the middle class (f.e. class 10)\n// We'll traverse 20 public prototypes with 20 conditional checks\n// We'll traverse 20 protected prototypes with 20 conditional checks\n// And finally we'll traverse 10 private prototypes with 10 conditional checks\n// TOTAL: We traverse over 50 prototypes with 50 conditional checks\n//\n// proposed:\n// If class hierarchy has 20 classes\n// If we detect which instance we have in order of public, protected, private\n// If the instance we're checking is the private instance of the middle class (f.e. class 10)\n// We'll traverse 10 public prototypes with 3 conditional checks at each prototype\n// TOTAL: We traverse over 10 prototypes with 30 conditional checks\n// BUT: The conditional checking will involve reading WeakMaps instead of\n// checking just reference equality. If we can optimize how this part\n// works, it might be worth it.\n//\n// Can the tradeoff (less traversal and conditional checks) outweigh the\n// heavier conditional checks?\n//\n// XXX PERFORMANCE: We can also cache the access-helper results, which requires more memory,\n// but will make use of access helpers much faster, especially important for\n// animations.\n\nfunction getParentProtectedPrototype(parentPublicPrototype: any) {\n\t// look up the prototype chain until we find a parent protected prototype, if any.\n\n\tlet parentProtectedProto\n\tlet currentPublicProto = parentPublicPrototype\n\n\twhile (currentPublicProto && !parentProtectedProto) {\n\t\tparentProtectedProto = publicProtoToProtectedProto.get(currentPublicProto)\n\t\tcurrentPublicProto = currentPublicProto.__proto__\n\t}\n\n\t// TODO, now that we're finding the nearest parent protected proto,\n\t// we might not need to create an empty object for each class if we\n\t// don't find one, to avoid prototype lookup depth, as we'll connect\n\t// to the nearest one we find, if any.\n\treturn parentProtectedProto || {}\n}\n\nfunction getParentPrivatePrototype(parentPublicPrototype: any) {\n\t// look up the prototype chain until we find a parent protected prototype, if any.\n\n\tlet parentPrivateProto\n\tlet currentPublicProto = parentPublicPrototype\n\n\twhile (currentPublicProto && !parentPrivateProto) {\n\t\tparentPrivateProto = publicProtoToPrivateProto.get(currentPublicProto)\n\t\tcurrentPublicProto = currentPublicProto.__proto__\n\t}\n\n\t// TODO, now that we're finding the nearest parent protected proto,\n\t// we might not need to create an empty object for each class if we\n\t// don't find one, to avoid prototype lookup depth, as we'll connect\n\t// to the nearest one we find, if any.\n\treturn parentPrivateProto || {}\n}\n\nfunction getPublicMembers(scope: any, instance: any) {\n\tlet result = scope.cachedPublicAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check only for the private instance of this class scope\n\tif (isPrivateInstance(scope, instance))\n\t\tscope.cachedPublicAccesses.set(instance, (result = getSubclassScope(instance).publicToPrivate.get(instance)))\n\t// check for an instance of the class (or its subclasses) of this scope\n\telse if (isProtectedInstance(scope, instance))\n\t\tscope.cachedPublicAccesses.set(instance, (result = publicToProtected.get(instance)))\n\t// otherwise just return whatever was passed in, it's public already!\n\telse scope.cachedPublicAccesses.set(instance, (result = instance))\n\n\treturn result\n}\n\nfunction getProtectedMembers(scope: any, instance: any) {\n\tlet result = scope.cachedProtectedAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check for an instance of the class (or its subclasses) of this scope\n\t// This allows for example an instance of an Animal base class to access\n\t// protected members of an instance of a Dog child class.\n\tif (isPublicInstance(scope, instance))\n\t\tscope.cachedProtectedAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = publicToProtected.get(instance) || createProtectedInstance(instance)),\n\t\t)\n\t// check for a private instance inheriting from this class scope\n\telse if (isPrivateInstance(scope, instance)) {\n\t\tconst publicInstance = getSubclassScope(instance).publicToPrivate.get(instance)\n\t\tscope.cachedProtectedAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = publicToProtected.get(publicInstance) || createProtectedInstance(publicInstance)),\n\t\t)\n\t}\n\n\t// return the protected instance if it was passed in\n\telse if (isProtectedInstance(scope, instance)) scope.cachedProtectedAccesses.set(instance, (result = instance))\n\n\tif (!result) throw new InvalidAccessError('invalid access of protected member')\n\n\treturn result\n}\n\nfunction getSubclassScope(privateInstance: any) {\n\treturn privateInstanceToClassScope.get(privateInstance)\n}\n\nfunction createProtectedInstance(publicInstance: any) {\n\t// traverse instance proto chain, find first protected prototype\n\tconst protectedPrototype = findLeafmostProtectedPrototype(publicInstance)\n\n\t// make the protected instance from the found protected prototype\n\tconst protectedInstance = Object.create(protectedPrototype)\n\tpublicToProtected.set(publicInstance, protectedInstance)\n\treturn protectedInstance\n}\n\nfunction findLeafmostProtectedPrototype(publicInstance: any) {\n\tlet result = null\n\tlet currentProto = publicInstance.__proto__\n\n\twhile (currentProto) {\n\t\tresult = publicProtoToProtectedProto.get(currentProto)\n\t\tif (result) return result\n\t\tcurrentProto = currentProto.__proto__\n\t}\n\n\treturn result\n}\n\nfunction getPrivateMembers(scope: any, instance: any) {\n\tlet result = scope.cachedPrivateAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check for a public instance that is or inherits from this class\n\tif (isPublicInstance(scope, instance))\n\t\tscope.cachedPrivateAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = scope.publicToPrivate.get(instance) || createPrivateInstance(scope, instance)),\n\t\t)\n\t// check for a protected instance that is or inherits from this class'\n\t// protectedPrototype\n\telse if (isProtectedInstance(scope, instance)) {\n\t\tconst publicInstance = publicToProtected.get(instance)\n\t\tscope.cachedPrivateAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = scope.publicToPrivate.get(publicInstance) || createPrivateInstance(scope, publicInstance)),\n\t\t)\n\t}\n\n\t// return the private instance if it was passed in\n\telse if (isPrivateInstance(scope, instance)) scope.cachedPrivateAccesses.set(instance, (result = instance))\n\n\tif (!result) throw new InvalidAccessError('invalid access of private member')\n\n\treturn result\n}\n\nfunction createPrivateInstance(scope: any, publicInstance: any) {\n\tconst privateInstance = Object.create(scope.privatePrototype)\n\tscope.publicToPrivate.set(publicInstance, privateInstance)\n\tprivateInstanceToClassScope.set(privateInstance, scope) // TODO use WeakTwoWayMap\n\treturn privateInstance\n}\n\nfunction isPublicInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.publicPrototype)\n\n\tfor (const proto of Array.from(brandToPublicPrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction isProtectedInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.protectedPrototype)\n\n\tfor (const proto of Array.from(brandToProtectedPrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction isPrivateInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.privatePrototype)\n\n\tfor (const proto of Array.from(brandToPrivatePrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction superHelper(supers: any, scope: any, instance: any) {\n\tconst {parentPublicPrototype, parentProtectedPrototype, parentPrivatePrototype} = scope\n\n\tif (isPublicInstance(scope, instance, false)) return getSuperHelperObject(instance, parentPublicPrototype, supers)\n\n\tif (isProtectedInstance(scope, instance, false))\n\t\treturn getSuperHelperObject(instance, parentProtectedPrototype, supers)\n\n\tif (isPrivateInstance(scope, instance, false)) return getSuperHelperObject(instance, parentPrivatePrototype, supers)\n\n\tthrow new InvalidSuperAccessError('invalid super access')\n}\n\nfunction getSuperHelperObject(instance: any, parentPrototype: any, supers: any) {\n\tlet _super = supers.get(instance)\n\n\t// XXX PERFORMANCE: there's probably some ways to improve speed here using caching\n\tif (!_super) {\n\t\tsupers.set(instance, (_super = Object.create(parentPrototype)))\n\n\t\tconst keys = getInheritedPropertyNames(parentPrototype)\n\t\tlet i = keys.length\n\n\t\twhile (i--) {\n\t\t\tconst key = keys[i]\n\n\t\t\tsetDescriptor(\n\t\t\t\t_super,\n\t\t\t\tkey,\n\t\t\t\t{\n\t\t\t\t\tget: function () {\n\t\t\t\t\t\tlet value: any = void undefined\n\n\t\t\t\t\t\tconst descriptor = getInheritedDescriptor(parentPrototype, key)\n\n\t\t\t\t\t\tif (descriptor && propertyIsAccessor(descriptor)) {\n\t\t\t\t\t\t\tconst getter = descriptor.get\n\t\t\t\t\t\t\tif (getter) value = getter.call(instance)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = parentPrototype[key]\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (value && value.call && typeof value === 'function') {\n\t\t\t\t\t\t\tvalue = value.bind(instance)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\n\t\t\t\t\t// like native `super`, setting a super property does nothing.\n\t\t\t\t\tset: function (value) {\n\t\t\t\t\t\tconst descriptor = getInheritedDescriptor(parentPrototype, key)\n\n\t\t\t\t\t\tif (descriptor && propertyIsAccessor(descriptor)) {\n\t\t\t\t\t\t\tconst setter = descriptor.set\n\t\t\t\t\t\t\tif (setter) value = setter.call(instance, value)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// just like native `super`\n\t\t\t\t\t\t\tinstance[key] = value\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn _super\n}\n\nexport default Class\n","import type {Constructor} from './utils.js'\n\n// --- TODO handle static inheritance. Nothing has been implemented with regards to\n// static inheritance yet.\n\n// --- TODO allow the subclass (f.e. the `Foo` in `class Foo extends multiple(One,\n// Two, Three) {}`) to call each super constructor (One, Two, and Three)\n// individually with specific arguments.\n\n// --- TODO Prevent duplicate classes in the \"prototype tree\". F.e. if someone calls\n// `multiple(One, Two, Three)`, and `Three` already includes `Two`, we can\n// discard the `Two` argument and perform the combination as if `multiple(One,\n// Three)` had been called.\n\n// --- TODO cache the results, so more than one call to `multiple(One, Two, Three)`\n// returns the same class reference as the first call.\n\n// --- TODO, allow the user to handle the diamond problem in some way other than\n// (\"property or method from the first class in the list wins\"). Perhaps require\n// the user to specify which method to call. For now, it simply calls the first\n// method in the order in which the classes were passed into multiple(). Look\n// here for ideas based on how different languages handle it:\n// https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem\n\nenum ImplementationMethod {\n\tPROXIES_ON_INSTANCE_AND_PROTOTYPE = 'PROXIES_ON_INSTANCE_AND_PROTOTYPE',\n\tPROXIES_ON_PROTOTYPE = 'PROXIES_ON_PROTOTYPE',\n\n\t// TODO, This will be similar to PROXIES_ON_INSTANCE_AND_PROTOTYPE, but\n\t// instead of placing a proxy on the instance, place a Proxy as a direct\n\t// prototype of the instance. I think this should work with Custom Elements,\n\t// and unlike PROXIES_ON_PROTOTYPE, super calls won't access own properties\n\t// on the instance, but actually on the prototypes (test5 super access tests\n\t// fail with PROXIES_ON_PROTOTYPE method).\n\tPROXY_AFTER_INSTANCE_AND_PROTOTYPE = 'PROXY_AFTER_INSTANCE_AND_PROTOTYPE',\n}\n\ntype MultipleOptions = {\n\tmethod: ImplementationMethod\n}\n\nexport function makeMultipleHelper(options?: MultipleOptions) {\n\t/**\n\t * Mixes the given classes into a single class. This is useful for multiple\n\t * inheritance.\n\t *\n\t * @example\n\t * class Foo {}\n\t * class Bar {}\n\t * class Baz {}\n\t * class MyClass extends multiple(Foo, Bar, Baz) {}\n\t */\n\t// ------------ method 1, define the `multiple()` signature with overrides. The\n\t// upside is it is easy to understand, but the downside is that name collisions\n\t// in properties cause the collided property type to be `never`. This would make\n\t// it more difficult to provide solution for the diamond problem.\n\t// ----------------\n\t// function multiple(): typeof Object\n\t// function multiple(classes: T): T\n\t// function multiple(...classes: T): Constructor>\n\t// function multiple(...classes: any): any {\n\t//\n\t// ------------ method 2, define the signature of `multiple()` with a single\n\t// signature. The upside is this picks the type of the first property\n\t// encountered when property names collide amongst all the classes passed into\n\t// `multiple()`, but the downside is the inner implementation may require\n\t// casting, and this approach can also cause an infinite type recursion\n\t// depending on the types used inside the implementation.\n\t// ----------------\n\treturn function multiple(...classes: T): CombinedClasses {\n\t\tconst mode = (options && options.method) || ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE\n\n\t\tswitch (mode) {\n\t\t\tcase ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE: {\n\t\t\t\treturn (withProxiesOnThisAndPrototype as any)(...classes)\n\t\t\t}\n\t\t\tcase ImplementationMethod.PROXIES_ON_PROTOTYPE: {\n\t\t\t\treturn (withProxiesOnPrototype as any)(...classes)\n\t\t\t}\n\t\t\tcase ImplementationMethod.PROXY_AFTER_INSTANCE_AND_PROTOTYPE: {\n\t\t\t\tthrow new Error(' not implemented yet')\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Mixes the given classes into a single class. This is useful for multiple\n * inheritance.\n *\n * @example\n * class Foo {}\n * class Bar {}\n * class Baz {}\n * class MyClass extends multiple(Foo, Bar, Baz) {}\n */\nexport const multiple = makeMultipleHelper({method: ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE})\n// export const multiple = makeMultipleHelper({method: ImplementationMethod.PROXIES_ON_PROTOTYPE})\n\nfunction withProxiesOnThisAndPrototype(...classes: T): CombinedClasses {\n\t// avoid performance costs in special cases\n\tif (classes.length === 0) return Object as any\n\tif (classes.length === 1) return classes[0] as any\n\n\tconst FirstClass = classes.shift()!\n\n\t// inherit the first class normally. This allows for required native\n\t// inheritance in certain special cases (like inheriting from HTMLElement\n\t// when making Custom Elements).\n\tclass MultiClass extends FirstClass {\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\n\t\t\tconst instances: Object[] = []\n\n\t\t\t// make instances of the other classes to get/set properties on.\n\t\t\tlet Ctor: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tCtor = classes[i]\n\t\t\t\tconst instance = Reflect.construct(Ctor, args)\n\t\t\t\tinstances.push(instance)\n\t\t\t}\n\n\t\t\treturn new Proxy(this, {\n\t\t\t\t// No `set()` trap is needed in this Proxy handler, at least for\n\t\t\t\t// the tests so far. Methods automatically have the correct\n\t\t\t\t// receiver when the are gotten with the `get()` trap, so if any\n\t\t\t\t// methods set a property, the set happens on the expected\n\t\t\t\t// instance, just like regular [[Set]].\n\n\t\t\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\t\t\tif (Reflect.ownKeys(target).includes(key)) return Reflect.get(target, key, self)\n\n\t\t\t\t\tlet instance: Object\n\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tif (Reflect.ownKeys(instance).includes(key)) return Reflect.get(instance, key, self)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst proto = Object.getPrototypeOf(self)\n\t\t\t\t\tif (Reflect.has(proto, key)) return Reflect.get(proto, key, self)\n\n\t\t\t\t\treturn undefined\n\t\t\t\t},\n\n\t\t\t\townKeys(target) {\n\t\t\t\t\tlet keys = Reflect.ownKeys(target)\n\n\t\t\t\t\tlet instance: Object\n\t\t\t\t\tlet instanceKeys: (string | symbol)[]\n\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tinstanceKeys = Reflect.ownKeys(instance)\n\t\t\t\t\t\tfor (let j = 0, l = instanceKeys.length; j < l; j += 1) keys.push(instanceKeys[j])\n\t\t\t\t\t}\n\n\t\t\t\t\treturn keys\n\t\t\t\t},\n\n\t\t\t\t// This makes the `in` operator work, for example.\n\t\t\t\thas(target, key: string | symbol): boolean {\n\t\t\t\t\tif (Reflect.ownKeys(target).includes(key)) return true\n\n\t\t\t\t\tlet instance: Object\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tif (Reflect.ownKeys(instance).includes(key)) return true\n\t\t\t\t\t}\n\n\t\t\t\t\t// all instances share the same prototype, so just check it once\n\t\t\t\t\tconst proto = Object.getPrototypeOf(self)\n\t\t\t\t\tif (Reflect.has(proto, key)) return true\n\n\t\t\t\t\treturn false\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n\n\tconst newMultiClassPrototype = new Proxy(Object.create(FirstClass.prototype), {\n\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\tif (Reflect.has(target, key)) return Reflect.get(target, key, self)\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return Reflect.get(Class.prototype, key, self)\n\t\t\t}\n\t\t},\n\n\t\thas(target, key): boolean {\n\t\t\tif (Reflect.has(target, key)) return true\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return true\n\t\t\t}\n\n\t\t\treturn false\n\t\t},\n\t})\n\n\t// This is so that `super` calls will work. We can't replace\n\t// MultiClass.prototype with a Proxy because MultiClass.prototype is\n\t// non-configurable, so it is impossible to wrap it with a Proxy. Instead,\n\t// we stick our own custom Proxy-wrapped prototype object between\n\t// MultiClass.prototype and FirstClass.prototype.\n\tObject.setPrototypeOf(MultiClass.prototype, newMultiClassPrototype)\n\n\treturn MultiClass as unknown as CombinedClasses\n}\n\nlet currentSelf: Object[] = []\n\nconst __instances__ = new WeakMap()\nconst getInstances = (inst: object): Object[] => {\n\tlet result = __instances__.get(inst)\n\tif (!result) __instances__.set(inst, (result = []))\n\treturn result\n}\n\n// function hasKey(instance: object, key: string | number | symbol, traverse: boolean = true): boolean {\n// \tif (Reflect.ownKeys(instance).includes(key)) return true\n\n// \tif (!traverse) return false\n\n// \tconst instances = __instances__.get(instance)\n// \tif (!instances) return false\n\n// \tfor (const instance of instances) if (hasKey(instance, key, true)) return true\n\n// \treturn false\n// }\n\ntype GetResult = {has: boolean; value: any}\n\nconst getResult: GetResult = {has: false, value: undefined}\n\nfunction getFromInstance(instance: object, key: string | symbol, result: GetResult): void {\n\tresult.has = false\n\tresult.value = undefined\n\n\tif (Reflect.ownKeys(instance).includes(key)) {\n\t\tresult.has = true\n\t\tresult.value = Reflect.get(instance, key)\n\t\treturn\n\t}\n\n\tconst instances = __instances__.get(instance)\n\tif (!instances) return\n\n\tfor (const instance of instances) {\n\t\t// if (hasKey(instance, key, true)) {\n\t\t// getFromInstance(instance, key, result)\n\t\t// return\n\t\t// }\n\n\t\tgetFromInstance(instance, key, result)\n\t\tif (result.has) return\n\t}\n}\n\nlet shouldGetFromPrototype = false\nlet topLevelMultiClassPrototype: object | null = null\n\nfunction withProxiesOnPrototype(...classes: T): CombinedClasses {\n\t// avoid performance costs in special cases\n\tif (classes.length === 0) return Object as any\n\tif (classes.length === 1) return classes[0] as any\n\n\tconst FirstClass = classes.shift()!\n\n\t// inherit the first class normally. This allows for required native\n\t// inheritance in certain special cases (like inheriting from HTMLElement\n\t// when making Custom Elements).\n\tclass MultiClass extends FirstClass {\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\n\t\t\t// This assumes no super constructor returns a different this from\n\t\t\t// their constructor. Otherwise the getInstances call won't work as\n\t\t\t// expected.\n\t\t\tconst instances = getInstances(this)\n\n\t\t\t// make instances of the other classes to get/set properties on.\n\t\t\tfor (const Ctor of classes) {\n\t\t\t\tconst instance = Reflect.construct(Ctor, args)\n\t\t\t\tinstances.push(instance)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst newMultiClassPrototype = new Proxy(Object.create(FirstClass.prototype), {\n\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\tif (!topLevelMultiClassPrototype) topLevelMultiClassPrototype = target\n\n\t\t\tif (!shouldGetFromPrototype) {\n\t\t\t\tgetFromInstance(self, key, getResult)\n\n\t\t\t\tif (getResult.has) {\n\t\t\t\t\ttopLevelMultiClassPrototype = null\n\t\t\t\t\treturn getResult.value\n\t\t\t\t}\n\n\t\t\t\t// only the top level MultiClass subclass prototype will check\n\t\t\t\t// instances for a property. The superclass MultiClass\n\t\t\t\t// prototypes will do a regular prototype get.\n\t\t\t\tshouldGetFromPrototype = true\n\t\t\t}\n\n\t\t\t// TODO, I think instead of passing `self` we should be passing the\n\t\t\t// instances created from the classes? We need to write more tests,\n\t\t\t// especially ones that create new properties later and not at\n\t\t\t// construction time.\n\t\t\tif (shouldGetFromPrototype) {\n\t\t\t\tlet result: any = undefined\n\n\t\t\t\tif (Reflect.has(target, key)) result = Reflect.get(target, key, self)\n\n\t\t\t\tlet Class: Constructor\n\t\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\t\tClass = classes[i]\n\t\t\t\t\tif (Reflect.has(Class.prototype, key)) result = Reflect.get(Class.prototype, key, self)\n\t\t\t\t}\n\n\t\t\t\tif (topLevelMultiClassPrototype === target) {\n\t\t\t\t\ttopLevelMultiClassPrototype = null\n\t\t\t\t\tshouldGetFromPrototype = false\n\t\t\t\t}\n\n\t\t\t\treturn result\n\t\t\t}\n\n\t\t\t// currentSelf.push(self)\n\n\t\t\t// if (Reflect.ownKeys(self).includes(key)) {\n\t\t\t// \tcurrentSelf.pop()\n\t\t\t// \treturn Reflect.get(target, key, self)\n\t\t\t// }\n\n\t\t\t// currentSelf.pop()\n\n\t\t\t// for (const instance of getInstances(self)) {\n\t\t\t// \tcurrentSelf.push(instance)\n\n\t\t\t// \tif (Reflect.ownKeys(instance).includes(key)) {\n\t\t\t// \t\tcurrentSelf.pop()\n\t\t\t// \t\treturn Reflect.get(instance, key, instance)\n\t\t\t// \t}\n\n\t\t\t// \tcurrentSelf.pop()\n\t\t\t// }\n\n\t\t\t// return undefined\n\t\t},\n\n\t\tset(target, key: string | symbol, value: any, self): boolean {\n\t\t\tcurrentSelf.push(self)\n\n\t\t\t// If the key is in the current prototype chain, continue like normal...\n\t\t\tif (Reflect.has(target, key)) {\n\t\t\t\tcurrentSelf.pop()\n\t\t\t\treturn Reflect.set(target, key, value, self)\n\t\t\t}\n\n\t\t\tcurrentSelf.pop()\n\n\t\t\t// ...Otherwise if the key isn't, set it on one of the instances of the classes.\n\t\t\tfor (const instance of getInstances(self)) {\n\t\t\t\tcurrentSelf.push(instance)\n\n\t\t\t\tif (Reflect.has(instance, key)) {\n\t\t\t\t\tcurrentSelf.pop()\n\t\t\t\t\treturn Reflect.set(instance, key, value, instance)\n\t\t\t\t\t// return Reflect.set(instance, key, value, self)\n\t\t\t\t}\n\n\t\t\t\tcurrentSelf.pop()\n\t\t\t}\n\n\t\t\t// If the key is not found, set it like normal.\n\t\t\treturn Reflect.set(target, key, value, self)\n\t\t},\n\n\t\thas(target, key): boolean {\n\t\t\t// if (currentSelf.length) {\n\t\t\t// \tlet current = currentSelf[currentSelf.length - 1]\n\n\t\t\t// \twhile (current) {\n\t\t\t// \t\tif (Reflect.ownKeys(current).includes(key)) return true\n\t\t\t// \t\tcurrent = Reflect.getPrototypeOf(current) as MultiClass\n\t\t\t// \t}\n\n\t\t\t// \tfor (const instance of getInstances(current as MultiClass))\n\t\t\t// \t\tif (Reflect.has(instance, key)) return true\n\t\t\t// } else {\n\t\t\tif (Reflect.has(target, key)) return true\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return true\n\t\t\t}\n\t\t\t// }\n\n\t\t\treturn false\n\t\t},\n\t})\n\n\t// This is so that `super` calls will work. We can't replace\n\t// MultiClass.prototype with a Proxy because MultiClass.prototype is\n\t// non-configurable, so it is impossible to wrap it with a Proxy. Instead,\n\t// we stick our own custom Proxy-wrapped prototype object between\n\t// MultiClass.prototype and FirstClass.prototype.\n\tObject.setPrototypeOf(MultiClass.prototype, newMultiClassPrototype)\n\n\treturn MultiClass as unknown as CombinedClasses\n}\n\n// type ConstructorUnionToInstanceTypeUnion = (U extends Constructor\n// ? (k: InstanceType) => void\n// : never) extends (k: infer I) => void\n// ? I\n// : never\n\ntype Shift = ((...args: T) => any) extends (_: any, ...args: infer R) => any ? R : never\ntype MixedArray[]> = _MixedArray\ntype _MixedArray[], U> = {\n\t0: new () => U\n\t1: _MixedArray<\n\t\tShift,\n\t\t{\n\t\t\t[K in keyof InstanceType | keyof U]: K extends keyof U ? U[K] : InstanceType[K]\n\t\t}\n\t>\n}[T['length'] extends 0 ? 0 : 1]\n\ntype CombinedClasses = T extends [] | [undefined]\n\t? typeof Object\n\t: T extends Constructor[]\n\t? MixedArray\n\t: typeof Object\n","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return { ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst NOTPENDING = {};\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst [transPending, setTransPending] = /*@__PURE__*/createSignal(false);\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceFactory = null;\nlet Listener = null;\nlet Pending = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n root = unowned && !false ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: null,\n owner: detachedOwner || owner\n },\n updateFn = unowned ? fn : () => fn(() => cleanNode(root));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n pending: NOTPENDING,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.pending !== NOTPENDING ? s.pending : s.tValue);else value = value(s.pending !== NOTPENDING ? s.pending : s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && lookup(Owner, SuspenseContext.id);\n if (s) c.suspense = s;\n c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(() => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n }, undefined, false, 0),\n s = SuspenseContext && lookup(Owner, SuspenseContext.id);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.pending = NOTPENDING;\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction createResource(source, fetcher, options) {\n if (arguments.length === 2) {\n if (typeof fetcher === \"object\") {\n options = fetcher;\n fetcher = source;\n source = true;\n }\n } else if (arguments.length === 1) {\n fetcher = source;\n source = true;\n }\n options || (options = {});\n const contexts = new Set(),\n [value, setValue] = createSignal(options.initialValue),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [loading, setLoading] = createSignal(false),\n [error, setError] = createSignal();\n let err = undefined,\n pr = null,\n initP = null,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = (\"initialValue\" in options),\n dynamic = typeof source === \"function\" && createMemo(source);\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n if (sharedConfig.load) initP = sharedConfig.load(id);\n }\n function loadEnd(p, v, e, key) {\n if (pr === p) {\n pr = null;\n resolved = true;\n if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {\n value: v\n }));\n initP = null;\n setError(err = e);\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n if (!Transition.promises.size) {\n Effects.push.apply(Effects, Transition.effects);\n Transition.effects = [];\n }\n completeLoad(v);\n }, false);\n } else completeLoad(v);\n }\n return v;\n }\n function completeLoad(v) {\n batch(() => {\n setValue(() => v);\n setLoading(false);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n });\n }\n function read() {\n const c = SuspenseContext && lookup(Owner, SuspenseContext.id),\n v = value();\n if (err) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition) Transition.promises.add(pr);else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching && scheduled) return;\n scheduled = false;\n setError(err = undefined);\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p = initP || untrack(() => fetcher(lookup, {\n value: value(),\n refetching\n }));\n if (typeof p !== \"object\" || !(\"then\" in p)) {\n loadEnd(pr, p);\n return p;\n }\n pr = p;\n scheduled = true;\n queueMicrotask(() => scheduled = false);\n batch(() => {\n setLoading(true);\n trigger();\n });\n return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, e, e));\n }\n Object.defineProperties(read, {\n loading: {\n get() {\n return loading();\n }\n },\n error: {\n get() {\n return error();\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n if (err) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));else load(false);\n return [read, {\n refetch: load,\n mutate: setValue\n }];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(() => {\n if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {\n timeout\n } : undefined);\n return source();\n }, undefined, true);\n const [deferred, setDeferred] = createSignal(node.value, options);\n updateComputation(node);\n setDeferred(() => node.value);\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(p => {\n const v = source();\n for (const key of subs.keys()) if (fn(key, v) !== fn(key, p)) {\n const l = subs.get(key);\n for (const c of l.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);else Effects.push(c);\n }\n }\n return v;\n }, undefined, true, STALE);\n updateComputation(node);\n return key => {\n let listener;\n if (listener = Listener) {\n let l;\n if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n };\n}\nfunction batch(fn) {\n if (Pending) return fn();\n let result;\n const q = Pending = [];\n try {\n result = fn();\n } finally {\n Pending = null;\n }\n runUpdates(() => {\n for (let i = 0; i < q.length; i += 1) {\n const data = q[i];\n if (data.pending !== NOTPENDING) {\n const pending = data.pending;\n data.pending = NOTPENDING;\n writeSignal(data, pending);\n }\n }\n }, false);\n return result;\n}\nfunction untrack(fn) {\n let result,\n listener = Listener;\n Listener = null;\n result = fn();\n Listener = listener;\n return result;\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return undefined;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null) ;else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);\n return fn;\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null) ;else if (Owner.context === null) Owner.context = {\n [ERROR]: [fn]\n };else if (!Owner.context[ERROR]) Owner.context[ERROR] = [fn];else Owner.context[ERROR].push(fn);\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n Owner = o;\n try {\n return runUpdates(fn, true);\n } finally {\n Owner = prev;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t = Transition || (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => t.resolve = res));\n t.running = true;\n }\n batch(fn);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n let ctx;\n return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n return createMemo(() => resolveChildren(children()));\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext({}));\n}\nfunction enableExternalSource(factory) {\n if (ExternalSourceFactory) {\n const oldFactory = ExternalSourceFactory;\n ExternalSourceFactory = (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n };\n } else {\n ExternalSourceFactory = factory;\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (!runningTransition && this.state || runningTransition && this.tState)) {\n const updates = Updates;\n Updates = null;\n !runningTransition && this.state === STALE || runningTransition && this.tState === STALE ? updateComputation(this) : lookUpstream(this);\n Updates = updates;\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n if (Pending) {\n if (node.pending === NOTPENDING) Pending.push(node);\n node.pending = value;\n return value;\n }\n if (node.comparator) {\n if (Transition && Transition.running && Transition.sources.has(node)) {\n if (node.comparator(node.tValue, value)) return value;\n } else if (node.comparator(node.value, value)) return value;\n }\n let TransitionRunning = false;\n if (Transition) {\n TransitionRunning = Transition.running;\n if (TransitionRunning || !isComp && Transition.sources.has(node)) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {\n if (o.pure) Updates.push(o);else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (TransitionRunning) o.tState = STALE;else o.state = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false) ;\n throw new Error();\n }\n }, false);\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const owner = Owner,\n listener = Listener,\n time = ExecCount;\n Listener = Owner = node;\n runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n runComputation(node, node.tValue, time);\n }, false);\n });\n }\n Listener = listener;\n Owner = owner;\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n handleError(err);\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.observers && node.observers.length) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null) ;else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);\n }\n }\n if (ExternalSourceFactory) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceFactory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if (!runningTransition && node.state === 0 || runningTransition && node.tState === 0) return;\n if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (!runningTransition && node.state || runningTransition && node.tState) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if (!runningTransition && node.state === STALE || runningTransition && node.tState === STALE) {\n updateComputation(node);\n } else if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING) {\n const updates = Updates;\n Updates = null;\n lookUpstream(node, ancestors[0]);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!Updates) Effects = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition && Transition.running) {\n if (Transition.promises.size || Transition.queue.size) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n batch(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n });\n }\n if (Effects.length) batch(() => {\n runEffects(Effects);\n Effects = null;\n });else {\n Effects = null;\n }\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n if (!tasks.size) {\n Effects.push.apply(Effects, Transition.effects);\n Transition.effects = [];\n }\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);else queue[userLength++] = e;\n }\n if (sharedConfig.context) setHydrateContext();\n const resume = queue.length;\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n for (i = resume; i < queue.length; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {\n if (source !== ignore) runTop(source);\n } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!runningTransition && !o.state || runningTransition && !o.tState) {\n if (runningTransition) o.tState = PENDING;else o.state = PENDING;\n if (o.pure) Updates.push(o);else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = 0; i < node.tOwned.length; i++) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = 0; i < node.owned.length; i++) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = 0; i < node.cleanups.length; i++) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;else node.state = 0;\n node.context = null;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction handleError(err) {\n const fns = ERROR && lookup(Owner, ERROR);\n if (!fns) throw err;\n for (const f of fns) f(err);\n}\nfunction lookup(owner, key) {\n return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id) {\n return function provider(props) {\n let res;\n createComputed(() => res = untrack(() => {\n Owner.context = {\n [id]: props.value\n };\n return children(() => props.children);\n }));\n return res;\n };\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createComputed(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => \"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub());\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n }\n else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return mapped = mapped.slice(0, len);\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return (s = typeof s === \"function\" ? s() : s) == null ? {} : s;\n}\nfunction mergeProps(...sources) {\n return new Proxy({\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n }, propTraps);\n}\nfunction splitProps(props, ...keys) {\n const blocked = new Set(keys.flat());\n const descriptors = Object.getOwnPropertyDescriptors(props);\n const res = keys.map(k => {\n const clone = {};\n for (let i = 0; i < k.length; i++) {\n const key = k[i];\n Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : {\n get() {\n return props[key];\n },\n set() {\n return true;\n }\n });\n }\n return clone;\n });\n res.push(new Proxy({\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n }, propTraps));\n return res;\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n } else {\n const c = comp();\n if (c) return c(props);\n }\n let Comp;\n return createMemo(() => (Comp = comp()) && untrack(() => {\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n }));\n };\n wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback ? fallback : undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback ? fallback : undefined));\n}\nfunction Show(props) {\n let strictEqual = false;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => strictEqual ? a === b : !a === !b\n });\n return createMemo(() => {\n const c = condition();\n if (c) {\n const child = props.children;\n return (strictEqual = typeof child === \"function\" && child.length > 0) ? untrack(() => child(c)) : child;\n }\n return props.fallback;\n });\n}\nfunction Switch(props) {\n let strictEqual = false;\n const conditions = children(() => props.children),\n evalConditions = createMemo(() => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) return [i, c, conds[i]];\n }\n return [-1];\n }, undefined, {\n equals: (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2]\n });\n return createMemo(() => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n return (strictEqual = typeof c === \"function\" && c.length > 0) ? untrack(() => c(when)) : c;\n });\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nconst NoErrors = {};\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn(NoErrors));\n}\nfunction ErrorBoundary(props) {\n let err = NoErrors;\n if (sharedConfig.context && sharedConfig.load) {\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count) || NoErrors;\n }\n const [errored, setErrored] = createSignal(err);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(() => {\n let e;\n if ((e = errored()) !== NoErrors) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored(NoErrors))) : f;\n }\n onError(setErrored);\n return props.children;\n });\n}\n\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let suspenseSetter, showContent, showFallback;\n const listContext = useContext(SuspenseListContext);\n if (listContext) {\n const [inFallback, setFallback] = createSignal(false);\n suspenseSetter = setFallback;\n [showContent, showFallback] = listContext.register(inFallback);\n }\n const [registry, setRegistry] = createSignal([]),\n comp = createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n const [showingContent, showContent] = createSignal(false),\n [showingFallback, showFallback] = createSignal(false);\n setRegistry(registry => [...registry, {\n inFallback,\n showContent,\n showFallback\n }]);\n return [showingContent, showingFallback];\n }\n },\n get children() {\n return props.children;\n }\n });\n createComputed(() => {\n const reveal = props.revealOrder,\n tail = props.tail,\n visibleContent = showContent ? showContent() : true,\n visibleFallback = showFallback ? showFallback() : true,\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(i => !i.inFallback());\n suspenseSetter && suspenseSetter(!all);\n reg.forEach(i => {\n i.showContent(all && visibleContent);\n i.showFallback(visibleFallback);\n });\n return;\n }\n let stop = false;\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n].inFallback();\n if (!stop && !s) {\n reg[n].showContent(visibleContent);\n reg[n].showFallback(visibleFallback);\n } else {\n const next = !stop;\n if (next && suspenseSetter) suspenseSetter(true);\n if (!tail || next && tail === \"collapsed\") {\n reg[n].showFallback(visibleFallback);\n } else reg[n].showFallback(false);\n stop = true;\n reg[n].showContent(next);\n }\n }\n if (!stop && suspenseSetter) suspenseSetter(false);\n });\n return comp;\n}\nfunction Suspense(props) {\n let counter = 0,\n showContent,\n showFallback,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n p = sharedConfig.load(key);\n if (p) {\n if (typeof p !== \"object\" || !(\"then\" in p)) p = Promise.resolve(p);\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(err => {\n if ((error = err) || sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n });\n } else if (p === null) sharedConfig.gather(key);\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) [showContent, showFallback] = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return flicker = undefined;\n }\n if (ctx && p === undefined) setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(() => {\n const inFallback = store.inFallback(),\n visibleContent = showContent ? showContent() : true,\n visibleFallback = showFallback ? showFallback() : true;\n dispose && dispose();\n if ((!inFallback || p !== undefined) && visibleContent) {\n store.resolved = true;\n ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!visibleFallback) return;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nlet DEV;\n\nexport { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };\n","import {getInheritedDescriptor} from 'lowclass'\nimport {createSignal, createEffect, createRoot, untrack, getListener} from 'solid-js'\n\nexport interface VariableGetter {\n\t(): T\n}\n\nexport interface VariableSetter {\n\t(value: T): T\n}\n\n/** Represents a reactive variable. The value is set or gotten depending on passing an arg or no arg. */\nexport interface Variable extends Iterable | VariableSetter> {\n\t/** Gets the variable value. */\n\t(value?: undefined): T\n\t/** Sets the variable value. */\n\t(value: T): T\n\t(value?: T): void | T\n\n\tget: VariableGetter\n\tset: VariableSetter\n\n\t// For array destructuring convenience\n\t[0]: VariableGetter\n\t[1]: VariableSetter\n\t[Symbol.iterator](): IterableIterator | VariableSetter>\n}\n\nfunction readVariable(this: Variable): T {\n\treturn this()\n}\nfunction writeVariable(this: Variable, value: T): T {\n\treturn this(value)\n}\n\n/**\n * Create a reactive variable.\n *\n * @example\n * let count = variable(0) // count starts at 0\n * count(1) // set the value of count to 1\n * count(count() + 1) // add 1\n * let currentValue = count() // read the current value\n * console.log(currentValue) // logs \"2\" to console\n */\n// eslint-disable-next-line typescript/explicit-function-return-type\nexport function variable(value: T) {\n\tconst [get, set] = createSignal(value, {equals: false})\n\n\t// FIXME, read arguments.length instead of detecting undefined values, because currently undefined value trigger a read, which means decoraators built on this treat `this.foo = undefined` as a read instead of a write.\n\tconst variable = ((value?: T) => {\n\t\tif (typeof value === 'undefined') return get()\n\t\tset(() => value)\n\t\treturn value\n\t}) as Variable\n\n\t// WTF TypeScript, why do I need `any` here.\n\tconst getter = readVariable.bind(variable as any) as VariableGetter\n\tconst setter = writeVariable.bind(variable as any) as VariableSetter\n\n\t// For object destructuring convenience.\n\tvariable.get = getter\n\tvariable.set = setter\n\n\t// For array destructuring convenience.\n\tvariable[0] = getter\n\tvariable[1] = setter\n\tvariable[Symbol.iterator] = function* () {\n\t\tyield variable[0]\n\t\tyield variable[1]\n\t}\n\n\treturn variable as [VariableGetter, VariableSetter] & Variable\n}\n\nexport type Computation = (previousValue?: unknown) => unknown\nexport type StopFunction = () => void\n\n/**\n * Automatically run a \"computation\" when any reactive variable used inside the\n * computation has changed. The \"computation\" is a function passed into\n * autorun().\n *\n * @param {Computation} f - A \"computation\" to re-run when any of the reactive\n * variables used inside of it change.\n * @return {StopFunction} - Returns a function that can be called to explicitly\n * stop the computation from running, allowing it to be garbage collected.\n */\n// TODO Option for autorun() to batch updates into a single update in the next microtask.\n// TODO Option for autorun() to skip the first run.\n// TODO Option for autorun() to provide which properties caused the re-run.\nexport function autorun(f: Computation): StopFunction {\n\tlet stop: StopFunction\n\n\tcreateRoot(dispose => {\n\t\tstop = dispose\n\t\tcreateEffect(f)\n\t})\n\n\treturn stop!\n}\n\nexport function reactive(protoOrClassElement: any, propName?: string, _descriptor?: PropertyDescriptor): any {\n\t// If used as a newer Babel decorator\n\tconst isDecoratorV2 = arguments.length === 1 && 'kind' in protoOrClassElement\n\tif (isDecoratorV2) {\n\t\tconst classElement = protoOrClassElement\n\n\t\t// If used as a class decorator.\n\t\tif (classElement.kind === 'class') return {...classElement, finisher: reactiveClassFinisher}\n\n\t\t// If used as a property or accessor decorator (@reactive isn't intended for\n\t\t// methods).\n\t\treturn {\n\t\t\t...classElement,\n\t\t\tfinisher(Class: AnyClassWithReactiveProps) {\n\t\t\t\t_trackReactiveProperty(Class, classElement.key)\n\n\t\t\t\treturn classElement.finisher?.(Class) ?? Class\n\t\t\t},\n\t\t}\n\t}\n\n\t// Used as a v1 legacy decorator.\n\n\t// If used as a class decorator.\n\tif (arguments.length === 1 && typeof protoOrClassElement === 'function') {\n\t\tconst Class = protoOrClassElement\n\t\treturn reactiveClassFinisher(Class)\n\t}\n\n\t// If used as a property or accessor decorator (this isn't intended for\n\t// methods).\n\tconst Class = protoOrClassElement.constructor\n\t_trackReactiveProperty(Class, propName!)\n}\n\nexport function _trackReactiveProperty(Class: AnyClassWithReactiveProps, propName: string) {\n\tif (!Class.reactiveProperties || !Class.hasOwnProperty('reactiveProperties')) Class.reactiveProperties = []\n\tif (!Class.reactiveProperties.includes(propName)) Class.reactiveProperties.push(propName)\n}\n\nfunction reactiveClassFinisher(Class: AnyClassWithReactiveProps) {\n\tif (Class.hasOwnProperty('__isReactive__')) return Class\n\n\treturn class ReactiveDecoratorFinisher extends Class {\n\t\t// This is a flag that other decorators can check, f.e. lume/elements @element decorator.\n\t\tstatic __isReactive__: true = true\n\n\t\tconstructor(...args: any[]) {\n\t\t\tif (getListener()) {\n\t\t\t\treturn untrack(() => {\n\t\t\t\t\tconst self = Reflect.construct(Class, args, new.target) // super()\n\t\t\t\t\treactify(self, Class)\n\t\t\t\t\treturn self\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tsuper(...args)\n\t\t\treactify(this, Class)\n\t\t}\n\t}\n}\n\nfunction _reactive(obj: ObjWithReactifiedProps, propName: PropertyKey): void {\n\tif (typeof propName !== 'string') throw new Error('TODO: support for non-string fields with @reactive decorator')\n\n\tconst vName = 'v_' + propName\n\n\t// XXX If obj already has vName, skip making an accessor? I think perhaps\n\t// not, because a subclass might override a property so it is not reactive,\n\t// and a further subclass might want to make it reactive again in which\n\t// case returning early would cause the subclass subclass's property not to\n\t// be reactive.\n\t// if (obj[vName] !== undefined) return\n\n\tlet descriptor: PropertyDescriptor | undefined = getInheritedDescriptor(obj, propName)\n\n\tlet originalGet: (() => any) | undefined\n\tlet originalSet: ((v: any) => void) | undefined\n\tlet initialValue: unknown\n\n\t// TODO if there is an inherited accessor, we need to ensure we still call\n\t// it so that we're extending instead of overriding. Otherwise placing\n\t// @reactive on a property will break that functionality in those cases.\n\t//\n\t// Right now, originalGet will only be called if it is on the current\n\t// prototype, but we aren't checking for any accessor that may be inherited.\n\n\tif (descriptor) {\n\t\toriginalGet = descriptor.get\n\t\toriginalSet = descriptor.set\n\n\t\tif (originalGet || originalSet) {\n\t\t\t// reactivity requires both\n\t\t\tif (!originalGet || !originalSet) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The `@reactive` decorator was used on an accessor named \"' +\n\t\t\t\t\t\tpropName +\n\t\t\t\t\t\t'\" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. In this case the decorator does not do anything.',\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdelete descriptor.get\n\t\t\tdelete descriptor.set\n\t\t} else {\n\t\t\tinitialValue = descriptor.value\n\n\t\t\t// if it isn't writable, we don't need to make a reactive variable because\n\t\t\t// the value won't change\n\t\t\tif (!descriptor.writable) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The `@reactive` decorator was used on a property named ' +\n\t\t\t\t\t\tpropName +\n\t\t\t\t\t\t' that is not writable. Reactivity is not enabled for non-writable properties.',\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdelete descriptor.value\n\t\t\tdelete descriptor.writable\n\t\t}\n\t}\n\n\tdescriptor = {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\t...descriptor,\n\t\tget: originalGet\n\t\t\t? function (this: any): unknown {\n\t\t\t\t\t// track reactivity, but get the value from the original getter\n\n\t\t\t\t\t// XXX this causes initialValue to be held onto even if the original\n\t\t\t\t\t// prototype value has changed. In pratice the original prototype\n\t\t\t\t\t// values usually never change, and these days people don't normally\n\t\t\t\t\t// use prototype values to begin with.\n\t\t\t\t\tconst v = __getReactiveVar(this, vName, initialValue)\n\t\t\t\t\tv()\n\n\t\t\t\t\treturn originalGet!.call(this)\n\t\t\t }\n\t\t\t: function (this: any): unknown {\n\t\t\t\t\tconst v = __getReactiveVar(this, vName, initialValue)\n\t\t\t\t\treturn v()\n\t\t\t },\n\t\tset: originalSet\n\t\t\t? function (this: any, newValue: unknown) {\n\t\t\t\t\toriginalSet!.call(this, newValue)\n\n\t\t\t\t\tconst v = __getReactiveVar(this, vName)\n\t\t\t\t\tv(newValue)\n\n\t\t\t\t\t// __propsSetAtLeastOnce__ is a Set that tracks which reactive\n\t\t\t\t\t// properties have been set at least once. @lume/element uses this\n\t\t\t\t\t// to detect if a reactive prop has been set, and if so will not\n\t\t\t\t\t// overwrite the value with any value from custom element\n\t\t\t\t\t// pre-upgrade.\n\t\t\t\t\tif (!this.__propsSetAtLeastOnce__) this.__propsSetAtLeastOnce__ = new Set()\n\t\t\t\t\tthis.__propsSetAtLeastOnce__.add(propName)\n\t\t\t }\n\t\t\t: function (this: any, newValue: unknown) {\n\t\t\t\t\tconst v = __getReactiveVar(this, vName)\n\t\t\t\t\tv(newValue)\n\n\t\t\t\t\tif (!this.__propsSetAtLeastOnce__) this.__propsSetAtLeastOnce__ = new Set()\n\t\t\t\t\tthis.__propsSetAtLeastOnce__.add(propName)\n\t\t\t },\n\t}\n\n\tif (!obj.__reactifiedProps__) obj.__reactifiedProps__ = new Set()\n\tobj.__reactifiedProps__.add(propName)\n\n\tObject.defineProperty(obj, propName, descriptor)\n}\n\nfunction __getReactiveVar(instance: Obj>, vName: string, initialValue: T = undefined!): Variable {\n\t// NOTE alternatively, we could use a WeakMap instead of exposing the\n\t// variable on the instance. We could also use Symbols keys for\n\t// semi-privacy.\n\tlet v: Variable = instance[vName]\n\n\tif (v) return v\n\n\tinstance[vName] = v = variable(initialValue)\n\n\treturn v\n}\n\ntype AnyClass = new (...args: any[]) => object\ntype AnyClassWithReactiveProps = (new (...args: any[]) => object) & {\n\treactiveProperties?: string[]\n\t__isReactive__?: true\n}\n\n// Define (or unshadow) reactive accessors on obj, which is generally `this`\n// inside of a constructor (this is what the documentation prescribes).\nexport function reactify(obj: T, props: (keyof T)[]): typeof obj\nexport function reactify(obj: InstanceType, ctor: C): typeof obj\nexport function reactify(obj: Obj, propsOrClass: PropertyKey[] | AnyClassWithReactiveProps) {\n\tif (isClass(propsOrClass)) {\n\t\tconst Class = propsOrClass\n\n\t\t// let props = classReactiveProps.get(Class)\n\t\t// if (props) unshadowReactiveAccessors(obj, props)\n\t\t// props = Class.reactiveProperties\n\n\t\tconst props = Class.reactiveProperties\n\t\tif (Array.isArray(props)) createReactiveAccessors(obj, props)\n\t} else {\n\t\tconst props = propsOrClass\n\t\tcreateReactiveAccessors(obj, props)\n\t}\n\n\treturn obj\n}\n\nfunction isClass(obj: unknown): obj is AnyClass {\n\treturn typeof obj == 'function'\n}\n\n// Defines a reactive accessor on obj.\nfunction createReactiveAccessors(obj: ObjWithReactifiedProps, props: PropertyKey[]) {\n\tfor (const prop of props) {\n\t\tif (obj.__reactifiedProps__?.has(prop)) continue\n\n\t\tconst initialValue = obj[prop]\n\t\t_reactive(obj, prop)\n\t\tobj[prop] = initialValue\n\t}\n}\n\ntype Obj = Record & {constructor: AnyClass}\ntype ObjWithReactifiedProps = Obj & {__reactifiedProps__?: Set}\n\n/**\n * Allow two reactive variables to depend on each other's values, without\n * causing an infinite loop.\n */\nexport function circular(\n\tfirst: VariableGetter,\n\tsetFirst: (v: Type) => void,\n\tsecond: VariableGetter,\n\tsetSecond: (v: Type) => void,\n): StopFunction {\n\tlet initial = true\n\n\tconst stop1 = autorun(() => {\n\t\tconst v = first()\n\t\tif (initial && !(initial = false)) setSecond(v)\n\t\telse initial = true\n\t})\n\n\tconst stop2 = autorun(() => {\n\t\tconst v = second()\n\t\tif (initial && !(initial = false)) setFirst(v)\n\t\telse initial = true\n\t})\n\n\treturn function stop() {\n\t\tstop1()\n\t\tstop2()\n\t}\n}\n\nexport const version = '0.8.0'\n"],"names":["supportsSpread","isSyntaxSupported","supportsClass","supportsNewTarget","TRUE_CONSTRUCTOR","Symbol","setPrototype","Object","setPrototypeOf","object","newPrototype","__proto__","construct","Reflect","Function","instantiator","constructor","args","target","arguments","length","TypeError","prototype","instance","value","apply","SKIP_PROPERTIES","copyProperties","source","destination","getOwnPropertyNames","defineProperty","properties","getOwnPropertySymbols","concat","i","indexOf","getOwnPropertyDescriptor","property","newless","name","usesClassSyntax","toString","substr","requiresNew","newlessConstructor","this","returnValue","error","test","message","Error","create","Node","console","newTarget","hasNewTarget","eval","code","getFunctionBody","setDescriptor","example","useStrict","WeakTwoWayMap","m","WeakMap","set","a","b","get","item","has","fn","split","shift","pop","join","descriptorDefaults","enumerable","configurable","obj","key","newDescriptor","inherited","overrideDescriptor","getInheritedDescriptor","setDescriptors","newDescriptors","currentDescriptor","currentDescriptors","getOwnPropertyDescriptors","defineProperties","oldDescriptor","writable","propertyIsAccessor","descriptor","result","currentProto","owner","getInheritedPropertyNames","keys","Array","from","Set","hasPrototype","proto","copyDescriptors","mod","props","prop","setDefaultPrototypeDescriptors","defaultClassDescriptor","descriptors","setDefaultStaticDescriptors","Ctor","staticBlacklist","includes","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","o","hasOwnProperty","call","r","toStringTag","publicProtoToProtectedProto","publicProtoToPrivateProto","publicToProtected","privateInstanceToClassScope","brandToPublicPrototypes","brandToProtectedPrototypes","brandToPrivatePrototypes","brandToPublicsPrivates","defaultOptions","mode","nativeNaming","prototypeWritable","setClassDescriptors","InvalidSuperAccessError","InvalidAccessError","getPublicMembers","scope","cachedPublicAccesses","isPrivateInstance","getSubclassScope","publicToPrivate","isProtectedInstance","getProtectedMembers","cachedProtectedAccesses","isPublicInstance","createProtectedInstance","publicInstance","privateInstance","protectedPrototype","findLeafmostProtectedPrototype","protectedInstance","getPrivateMembers","cachedPrivateAccesses","createPrivateInstance","privatePrototype","brandedCheck","publicPrototype","classBrand","superHelper","supers","parentPublicPrototype","parentProtectedPrototype","parentPrivatePrototype","getSuperHelperObject","parentPrototype","_super","getter","bind","setter","ImplementationMethod","options","Class","usingStaticSubclassMethod","definer","createClass","extends","ParentClass","def","brand","className","scopedPublicsToPrivates","Super","Public","Protected","Private","staticMembers","customClass","static","public","protected","private","parentProtectedProto","currentPublicProto","getParentProtectedPrototype","parentPrivateProto","getParentPrivatePrototype","add","userConstructor","NewClass","ret","createClassHelper","PROXIES_ON_INSTANCE_AND_PROTOTYPE","sharedConfig","signalOptions","equals","ERROR","runEffects","runQueue","NOTPENDING","STALE","PENDING","UNOWNED","owned","cleanups","context","transPending","setTransPending","createSignal","Owner","SuspenseContext","Transition","Scheduler","ExternalSourceFactory","Listener","Pending","Updates","Effects","ExecCount","assign","s","observers","observerSlots","pending","comparator","readSignal","running","sources","tValue","writeSignal","createMemo","c","createComputation","tState","push","updateComputation","batch","q","runUpdates","data","untrack","listener","children","resolveChildren","runningTransition","state","updates","lookUpstream","sSlot","sourceSlots","node","isComp","TransitionRunning","disposed","pure","markDownstream","cleanNode","time","runComputation","queueMicrotask","nextValue","err","handleError","updatedAt","init","tOwned","track","trigger","ordinary","onCleanup","dispose","triggerInTransition","done","l","Promise","resolve","then","t","effects","promises","queue","res","startTransition","inTransition","x","runTop","suspense","inFallback","ancestors","top","prev","wait","tasks","delete","size","scheduleQueue","e","v","len","completeUpdates","runUserEffects","userLength","user","resume","ignore","index","obs","n","fns","lookup","f","isArray","results","createProvider","id","createComputed","readVariable","writeVariable","variable","iterator","autorun","stop","detachedOwner","unowned","root","updateFn","createRoot","createEffect","reactive","protoOrClassElement","propName","_descriptor","classElement","kind","finisher","reactiveClassFinisher","_trackReactiveProperty","reactiveProperties","self","reactify","super","__isReactive__","_reactive","vName","originalGet","originalSet","initialValue","warn","__getReactiveVar","newValue","__propsSetAtLeastOnce__","__reactifiedProps__","propsOrClass","isClass","createReactiveAccessors","circular","first","setFirst","second","setSecond","initial","stop1","stop2","defaultValue","createContext"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"global.js","mappings":"oMAyBA,2BAAe,KAEXA,eAAiBC,kBAAkB,mBACn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AO,YArcxB,SAAuB2X,GACrB,MAAMjD,EAAK1U,OAAO,WAGNyU,GAAeC,EAG7B,CA2zB4BkD,GCh+BrB,MAAM,GAAU,O","sources":["webpack://LUME/./node_modules/lowclass/src/native.ts","webpack://LUME/./node_modules/lowclass/src/utils.ts","webpack://LUME/webpack/bootstrap","webpack://LUME/webpack/runtime/define property getters","webpack://LUME/webpack/runtime/hasOwnProperty shorthand","webpack://LUME/webpack/runtime/make namespace object","webpack://LUME/./node_modules/lowclass/src/Class.ts","webpack://LUME/./node_modules/lowclass/src/multiple.ts","webpack://LUME/../../node_modules/solid-js/dist/solid.js","webpack://LUME/./src/index.ts"],"sourcesContent":["// borrowed from (and slightly modified) https://github.com/Mr0grog/newless\n// The newless license is BSD 3:\n\n// TODO no any types\n\n/*\n * Copyright (c) 2013-2016, Rob Brackett\n * Copyright (c) 2018, Joseph Orbegoso Pea\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport {getFunctionBody, setDescriptor, Constructor} from './utils.js'\n\nexport {newless as native}\n\nexport default newless\n\nvar supportsSpread = isSyntaxSupported('Object(...[{}])')\nvar supportsClass = isSyntaxSupported('class Test {}')\nvar supportsNewTarget = isSyntaxSupported('new.target')\n\n// Used to track the original wrapped constructor on a newless instance\nvar TRUE_CONSTRUCTOR = Symbol ? Symbol('trueConstructor') : '__newlessTrueConstructor__'\n\nvar setPrototype =\n\tObject.setPrototypeOf ||\n\tfunction setPrototypeOf(object, newPrototype) {\n\t\tobject.__proto__ = newPrototype\n\t}\n\n// Polyfill for Reflect.construct\nvar construct =\n\t(Reflect && Reflect.construct) ||\n\t(function () {\n\t\tif (supportsClass) {\n\t\t\treturn Function(\n\t\t\t\t'constructor, args, target',\n\t\t\t\t`\n 'use strict';\n\n if (arguments.length === 3 && typeof target !== 'function')\n throw new TypeError(target + ' is not a constructor');\n\n target = target || constructor;\n\n // extend target so the right prototype is constructed (or nearly the\n // right one; ideally we'd do instantiator.prototype = target.prototype,\n // but a class's prototype property is not writable)\n class instantiator extends target {};\n // but ensure the *logic* is 'constructor' for ES2015-compliant engines\n Object.setPrototypeOf(instantiator, constructor);\n // ...and for Safari 9\n instantiator.prototype.constructor = constructor;\n\n // The spread operator is *dramatically faster, so use it if we can:\n // http://jsperf.com/new-via-spread-vs-dynamic-function/4\n ${\n\t\t\t\t\tsupportsSpread\n\t\t\t\t\t\t? `\n\n var value = new instantiator(...([].slice.call(args)));\n\n `\n\t\t\t\t\t\t: `\n\n // otherwise, create a dynamic function in order to use 'new'\n // Note using 'function.bind' would be simpler, but is much slower:\n // http://jsperf.com/new-operator-with-dynamic-function-vs-bind\n var argList = '';\n for (var i = 0, len = args.length; i < len; i++) {\n if (i > 0) argList += ',';\n argList += 'args[' + i + ']';\n }\n var constructCall = Function('constructor, args',\n 'return new constructor( ' + argList + ' );'\n );\n var value = constructCall(constructor, args);\n\n args = Array.prototype.slice.call(args);\n args = [null].concat(args);\n var value = new constructor.bind.apply(constructor, args);\n\n `\n\t\t\t\t}\n\n // fix up the prototype so it matches the intended one, not one who's\n // prototype is the intended one :P\n Object.setPrototypeOf(value, target.prototype);\n return value;\n `,\n\t\t\t)\n\n\t\t\t//return Function(\"constructor, args, newTarget\", `\n\t\t\t// 'use strict';\n\n\t\t\t// if (arguments.length === 3 && typeof newTarget === undefined)\n\t\t\t// throw new TypeError('undefined is not a constructor');\n\n\t\t\t// newTarget = newTarget || constructor;\n\n\t\t\t// ${ supportsSpread ? `\n\n\t\t\t// var value = new constructor(...([].slice.call(args)));\n\n\t\t\t// `:`\n\n\t\t\t// args = Array.prototype.slice.call(args);\n\t\t\t// args = [null].concat(args);\n\t\t\t// var value = new constructor.bind.apply(constructor, args);\n\n\t\t\t// `}\n\n\t\t\t// Object.setPrototypeOf(value, newTarget.prototype);\n\t\t\t// return value;\n\t\t\t//`);\n\t\t} else {\n\t\t\tvar instantiator = function () {} as any\n\t\t\treturn function construct(constructor: any, args: any, target: any) {\n\t\t\t\tif (arguments.length === 3 && typeof target !== 'function')\n\t\t\t\t\tthrow new TypeError(target + ' is not a constructor')\n\t\t\t\tinstantiator.prototype = (target || constructor).prototype\n\t\t\t\tvar instance = new instantiator()\n\t\t\t\tvar value = constructor.apply(instance, args)\n\t\t\t\tif (typeof value === 'object' && value) {\n\t\t\t\t\t// we can do better if __proto__ is available (in some ES5 environments)\n\t\t\t\t\tvalue.__proto__ = (target || constructor).prototype\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn instance\n\t\t\t}\n\t\t}\n\t})()\n\n// ES2015 class methods are non-enumerable; we need a helper for copying them.\nvar SKIP_PROPERTIES: (string | symbol)[] = ['arguments', 'caller', 'length', 'name', 'prototype']\nfunction copyProperties(source: any, destination: any) {\n\tif (Object.getOwnPropertyNames && Object.defineProperty) {\n\t\tvar properties: (string | symbol)[] = Object.getOwnPropertyNames(source)\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tproperties = properties.concat(Object.getOwnPropertySymbols(source))\n\t\t}\n\t\tfor (var i = properties.length - 1; i >= 0; i--) {\n\t\t\tif (SKIP_PROPERTIES.indexOf(properties[i]) === -1) {\n\t\t\t\tObject.defineProperty(\n\t\t\t\t\tdestination,\n\t\t\t\t\tproperties[i],\n\t\t\t\t\tObject.getOwnPropertyDescriptor(source, properties[i])!,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var property in source) {\n\t\t\tdestination[property] = source[property]\n\t\t}\n\t}\n}\n\ntype FuncLikeCtor = {\n\t(): T\n\tnew (): T\n} & S\n\nfunction newless(constructor: T): FuncLikeCtor, T> {\n\tvar name = constructor.name\n\n\t// V8 and newer versions of JSCore return the full class declaration from\n\t// `toString()`, which lets us be a little smarter and more performant\n\t// about what to do, since we know we are dealing with a \"class\". Note,\n\t// however, not all engines do this. This could be false and the constructor\n\t// might still use class syntax.\n\tvar usesClassSyntax = constructor.toString().substr(0, 5) === 'class'\n\n\tvar requiresNew = usesClassSyntax ? true : null\n\n\tvar newlessConstructor = (() =>\n\t\tfunction (this: any) {\n\t\t\t// If called with an already valid 'this', preserve that 'this' value\n\t\t\t// in the super-type's constructor whenever possible. With function\n\t\t\t// constructors (as opposed to class constructors), it's possible to\n\t\t\t// alter the instance before calling the super constructor--so it's\n\t\t\t// important to preserve that instance if at all possible.\n\t\t\tif (!requiresNew && this instanceof newlessConstructor) {\n\t\t\t\t// requiresNew = 'false' indicates we know the 'new' operator isn't\n\t\t\t\t// necessary for this constructor, but 'null' indicates uncertainty,\n\t\t\t\t// so the call needs to handle potential errors the first time in\n\t\t\t\t// order to determine whether 'new' is definitely required.\n\t\t\t\tif (requiresNew === false) {\n\t\t\t\t\tconst returnValue = constructor.apply(this, arguments as any)\n\t\t\t\t\treturn (typeof returnValue === 'object' && returnValue) || this\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\trequiresNew = false\n\t\t\t\t\tconst returnValue = constructor.apply(this, arguments as any)\n\t\t\t\t\treturn (typeof returnValue === 'object' && returnValue) || this\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Do our best to only capture errors triggred by class syntax.\n\t\t\t\t\t// Unfortunately, there's no special error type for this and the\n\t\t\t\t\t// message is non-standard, so this is the best check we can do.\n\t\t\t\t\tif (\n\t\t\t\t\t\terror instanceof TypeError &&\n\t\t\t\t\t\t(/class constructor/i.test(error.message) || /use the 'new' operator/i.test(error.message)) // Custom Elements in Chrome\n\t\t\t\t\t\t// TODO: there might be other error messages we need to catch,\n\t\t\t\t\t\t// depending on engine and use case. We need to test in all browsers\n\t\t\t\t\t) {\n\t\t\t\t\t\t// mark this constructor as requiring 'new' for next time\n\t\t\t\t\t\trequiresNew = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\terror instanceof Error &&\n\t\t\t\t\t\t\t/Illegal constructor/i.test(error.message) &&\n\t\t\t\t\t\t\tObject.create(constructor.prototype) instanceof Node\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`The following error can happen if a Custom Element is called\nwith 'new' before being defined. The constructor was ${constructor.name}: `,\n\t\t\t\t\t\t\t\tconstructor,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// make a reasonably good replacement for 'new.target' which is a\n\t\t\t// syntax error in older engines\n\t\t\tvar newTarget\n\t\t\tvar hasNewTarget = false\n\t\t\tif (supportsNewTarget) {\n\t\t\t\teval('newTarget = new.target')\n\t\t\t\tif (newTarget) hasNewTarget = true\n\t\t\t}\n\t\t\tif (!supportsNewTarget || !hasNewTarget) {\n\t\t\t\tnewTarget = this instanceof newlessConstructor ? this.constructor : constructor\n\t\t\t}\n\t\t\tconst returnValue = construct(constructor, arguments, newTarget)\n\t\t\t// best effort to make things easy for functions inheriting from classes\n\t\t\tif (this instanceof newlessConstructor) {\n\t\t\t\tsetPrototype(this, returnValue)\n\t\t\t}\n\t\t\treturn returnValue\n\t\t})()\n\n\tif (name) {\n\t\tconst code = getFunctionBody(newlessConstructor)\n\n\t\tnewlessConstructor = Function(\n\t\t\t'constructor, construct, setPrototype, requiresNew, supportsNewTarget',\n\t\t\t`\n var newlessConstructor = function ${name}() { ${code} };\n return newlessConstructor\n `,\n\t\t)(constructor, construct, setPrototype, requiresNew, supportsNewTarget)\n\t}\n\n\t// copy the `.length` value to the newless constructor\n\tif (constructor.length) {\n\t\t// length is not writable, only configurable, therefore the value\n\t\t// has to be set with a descriptor update\n\t\tsetDescriptor(newlessConstructor, 'length', {\n\t\t\tvalue: constructor.length,\n\t\t})\n\t}\n\n\tnewlessConstructor.prototype = Object.create(constructor.prototype)\n\tnewlessConstructor.prototype.constructor = newlessConstructor\n\n\t// NOTE: *usually* the below will already be true, but we ensure it here.\n\t// Safari 9 requires this for the 'super' keyword to work. Newer versions\n\t// of WebKit and other engines do not. Instead, they use the constructor's\n\t// prototype chain (which is correct by ES2015 spec) (see below).\n\tconstructor.prototype.constructor = constructor\n\n\t// for ES2015 classes, we need to make sure the constructor's prototype\n\t// is the super class's constructor. Further, optimize performance by\n\t// pointing at the actual constructor implementation instead of the\n\t// newless wrapper (in the case that it is wrapped by newless).\n\t;(newlessConstructor as any)[TRUE_CONSTRUCTOR] = constructor\n\n\tcopyProperties(constructor, newlessConstructor)\n\tsetPrototype(newlessConstructor, constructor)\n\n\treturn newlessConstructor as FuncLikeCtor, T>\n}\n\n// Test whether a given syntax is supported\nfunction isSyntaxSupported(example: string, useStrict = true): boolean {\n\ttry {\n\t\treturn !!Function('', (useStrict ? \"'use strict';\" : '') + example)\n\t} catch (error) {\n\t\treturn false\n\t}\n}\n","// TODO no any\n\nexport class WeakTwoWayMap {\n\tm = new WeakMap()\n\tset(a: Object, b: Object) {\n\t\tthis.m.set(a, b)\n\t\tthis.m.set(b, a)\n\t}\n\tget(item: Object) {\n\t\treturn this.m.get(item)\n\t}\n\thas(item: Object) {\n\t\treturn this.m.has(item)\n\t}\n}\n\n// assumes the function opening, body, and closing are on separate lines\nexport function getFunctionBody(fn: Function): string {\n\tconst code = fn.toString().split('\\n')\n\tcode.shift() // remove opening line (function() {)\n\tcode.pop() // remove closing line (})\n\treturn code.join('\\n')\n}\n\nconst descriptorDefaults = {\n\tenumerable: true,\n\tconfigurable: true,\n}\n\n// makes it easier and less verbose to work with descriptors\nexport function setDescriptor(obj: Object, key: string, newDescriptor: PropertyDescriptor, inherited = false): void {\n\tlet currentDescriptor = inherited ? getInheritedDescriptor(obj, key) : Object.getOwnPropertyDescriptor(obj, key)\n\n\tnewDescriptor = overrideDescriptor(currentDescriptor, newDescriptor)\n\tObject.defineProperty(obj, key, newDescriptor)\n}\n\nexport function setDescriptors(obj: Object, newDescriptors: Record): void {\n\tlet newDescriptor\n\tlet currentDescriptor\n\tconst currentDescriptors = Object.getOwnPropertyDescriptors(obj)\n\n\tfor (const key in newDescriptors) {\n\t\tnewDescriptor = newDescriptors[key]\n\t\tcurrentDescriptor = currentDescriptors[key]\n\t\tnewDescriptors[key] = overrideDescriptor(currentDescriptor, newDescriptor)\n\t}\n\n\tObject.defineProperties(obj, newDescriptors)\n}\n\nfunction overrideDescriptor(\n\toldDescriptor: PropertyDescriptor | undefined,\n\tnewDescriptor: PropertyDescriptor,\n): PropertyDescriptor {\n\tif (\n\t\t('get' in newDescriptor || 'set' in newDescriptor) &&\n\t\t('value' in newDescriptor || 'writable' in newDescriptor)\n\t) {\n\t\tthrow new TypeError('cannot specify both accessors and a value or writable attribute')\n\t}\n\n\tif (oldDescriptor) {\n\t\tif ('get' in newDescriptor || 'set' in newDescriptor) {\n\t\t\tdelete oldDescriptor.value\n\t\t\tdelete oldDescriptor.writable\n\t\t} else if ('value' in newDescriptor || 'writable' in newDescriptor) {\n\t\t\tdelete oldDescriptor.get\n\t\t\tdelete oldDescriptor.set\n\t\t}\n\t}\n\n\treturn {...descriptorDefaults, ...oldDescriptor, ...newDescriptor}\n}\n\n// TODO use signature override\nexport function propertyIsAccessor(obj: Object | PropertyDescriptor, key?: string, inherited = true): boolean {\n\tlet result = false\n\tlet descriptor: PropertyDescriptor | undefined\n\n\tif (arguments.length === 1) {\n\t\tdescriptor = obj\n\t} else {\n\t\tdescriptor = inherited ? getInheritedDescriptor(obj, key!) : Object.getOwnPropertyDescriptor(obj, key!)\n\t}\n\n\tif (descriptor && (descriptor.get || descriptor.set)) result = true\n\n\treturn result\n}\n\ninterface DescriptorWithOwner extends PropertyDescriptor {\n\towner: object\n}\n\nexport function getInheritedDescriptor(obj: object, key: string): DescriptorWithOwner | undefined {\n\tlet currentProto = obj\n\tlet descriptor\n\n\twhile (currentProto) {\n\t\tdescriptor = Object.getOwnPropertyDescriptor(currentProto, key)\n\n\t\tif (descriptor) {\n\t\t\t;(descriptor as DescriptorWithOwner).owner = currentProto\n\t\t\treturn descriptor as DescriptorWithOwner\n\t\t}\n\n\t\tcurrentProto = (currentProto as any).__proto__\n\t}\n\n\treturn void 0\n}\n\nexport function getInheritedPropertyNames(obj: Object): string[] {\n\tlet currentProto = obj\n\tlet keys: string[] = []\n\n\twhile (currentProto) {\n\t\tkeys = keys.concat(Object.getOwnPropertyNames(currentProto))\n\t\tcurrentProto = (currentProto as any).__proto__\n\t}\n\n\t// remove duplicates\n\tkeys = Array.from(new Set(keys))\n\n\treturn keys\n}\n\nexport type Constructor = (new (...a: A) => T) & Static\n\n// this is used for type casting in special cases, see the declaration file\nexport function Constructor(Ctor: Constructor): Constructor & Static {\n\treturn Ctor as unknown as Constructor & Static\n}\n\n// check if an object has the given prototype in its chain\nexport function hasPrototype(obj: any, proto: any) {\n\tlet currentProto = obj.__proto__\n\n\tdo {\n\t\tif (proto === currentProto) return true\n\t\tcurrentProto = currentProto.__proto__\n\t} while (currentProto)\n\n\treturn false\n}\n\n// copy all properties (as descriptors) from source to destination\nexport function copyDescriptors(source: Object, destination: Object, mod?: any) {\n\tconst props = Object.getOwnPropertyNames(source)\n\tlet i = props.length\n\twhile (i--) {\n\t\tconst prop = props[i]\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(source, prop)\n\t\tif (mod) mod(descriptor)\n\t\tObject.defineProperty(destination, prop, descriptor!)\n\t}\n}\n\nexport function setDefaultPrototypeDescriptors(\n\tprototype: Object,\n\t{defaultClassDescriptor: {writable, enumerable, configurable}}: any,\n) {\n\tconst descriptors = Object.getOwnPropertyDescriptors(prototype)\n\tlet descriptor\n\n\tfor (const key in descriptors) {\n\t\tdescriptor = descriptors[key]\n\n\t\t// regular value\n\t\tif ('value' in descriptor || 'writable' in descriptor) {\n\t\t\tdescriptor.writable = writable\n\t\t}\n\n\t\t// accessor or regular value\n\t\tdescriptor.enumerable = enumerable\n\t\tdescriptor.configurable = configurable\n\t}\n\n\tsetDescriptors(prototype, descriptors)\n}\n\nexport function setDefaultStaticDescriptors(\n\tCtor: any,\n\t{defaultClassDescriptor: {writable, enumerable, configurable}}: any,\n\tstaticBlacklist?: (string | symbol)[],\n) {\n\tconst descriptors = Object.getOwnPropertyDescriptors(Ctor)\n\tlet descriptor\n\n\tfor (const key in descriptors) {\n\t\tif (staticBlacklist && staticBlacklist.includes(key)) {\n\t\t\tdelete descriptors[key]\n\t\t\tcontinue\n\t\t}\n\n\t\tdescriptor = descriptors[key]\n\n\t\t// regular value\n\t\tif ('value' in descriptor || 'writable' in descriptor) {\n\t\t\tdescriptor.writable = writable\n\t\t}\n\n\t\t// accessor or regular value\n\t\tdescriptor.enumerable = enumerable\n\t\tdescriptor.configurable = configurable\n\t}\n\n\tsetDescriptors(Ctor, descriptors)\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// TODO\n// [x] remove the now-unnecessary modes (leave just what was 'es5' mode)\n// [x] link helpers to each other, making it possible to destructure the arguments to definer functions\n// [x] let access helper prototype objects extend from Object, otherwise common tools are not available.\n// [x] accept a function as return value of function definer, to be treated as a class to derive the definition from, so that it can have access to Protected and Private helpers\n// [x] let the returned class define protected and private getters which return the protected and private definitions.\n// [ ] protected and private static members\n// [ ] no `any` types\n// [ ] other TODOs in the code\n\nimport {\n\tConstructor,\n\tcopyDescriptors,\n\tsetDefaultStaticDescriptors,\n\tsetDefaultPrototypeDescriptors,\n\thasPrototype,\n} from './utils.js'\n\nimport type {Id} from './types.js'\n\ntype ImplementationKeys = 'static' | 'private' | 'protected'\n\ntype FunctionToConstructor = T extends (...a: infer A) => void ? new (...a: A) => TReturn : never\n\n// Note, void also works the same in place of unknown\ntype ReplaceCtorReturn = T extends new (...a: infer A) => unknown ? new (...a: A) => TReturn : never\n\ntype ConstructorOrDefault = T extends {constructor: infer TCtor} ? TCtor : () => void\n\n// Although the SuperType type definiton already checks that T extends from\n// Constructor, the additional check in the generic paramters is useful so\n// that we don't get an error about \"never\" which is hard to track down. The\n// generic paramter will cause a more helpful and understandable error.\n// TODO ensure that T is InstanceType of TBase\n// prettier-ignore\ntype SuperType<_T, TSuper extends Constructor> = TSuper extends Constructor\n ? {constructor: (...a: A) => I} & InstanceType\n : never\n// type SuperType<\n// T extends InstanceType,\n// TSuper extends Constructor\n// > = TSuper extends Constructor\n// ? T extends InstanceType\n// ? {constructor: (...a: A) => I} & Id>\n// : never\n// : never\n\ntype SuperHelper = (self: T) => SuperType\ntype PrivateHelper = (self: T) => T extends {__: {private: infer TPrivate}} ? TPrivate : never\ntype PublicHelper = (self: T) => Omit // TODO validate instance is public?\ntype ProtectedHelper = (self: T) => T extends {__: {protected: infer TProtected}} ? TProtected : never\n// type ProtectedHelper = (self: T) => T extends {protected: infer TProtected} ? TProtected : never\ntype Statics = T extends {static: infer TStatic} ? TStatic : {}\ntype SaveInheritedProtected = T extends {protected: infer TProtected} ? TProtected : {}\n\n// there's a missing link here: if the super class of T is a native class\n// that extends from a lowclass class, then we don't inherit those protected\n// members. Any ideas?\ntype StaticsAndProtected = Id & {__: {protected: SaveInheritedProtected}}>\n\ntype ExtractInheritedProtected = T extends {__: infer TProtected} ? TProtected : {}\ntype PickImplementationKeys = Pick> // similar to Pick, but not quite\n\n// this moves the implementation keys off the constructor return type and\n// onto a fake __ property, so that we can reference the __ type within the\n// implementatin code, but so that the outside (public) doesn't see the fake\n// __ property.\ntype LowClassThis = Id & {__: PickImplementationKeys}>\n\ntype OmitImplementationKeys = Omit\n\nimport {\n\tgetFunctionBody,\n\tsetDescriptor,\n\tpropertyIsAccessor,\n\tgetInheritedDescriptor,\n\tgetInheritedPropertyNames,\n\tWeakTwoWayMap,\n} from './utils.js'\n\nexport const staticBlacklist = ['subclass', 'extends', ...Object.getOwnPropertyNames(new Function())]\n\nconst publicProtoToProtectedProto = new WeakMap()\nconst publicProtoToPrivateProto = new WeakMap()\n\n// A two-way map to associate public instances with protected instances.\n// There is one protected instance per public instance\nconst publicToProtected = new WeakTwoWayMap()\n\n// so we can get the class scope associated with a private instance\nconst privateInstanceToClassScope = new WeakMap()\n\nconst brandToPublicPrototypes = new WeakMap()\nconst brandToProtectedPrototypes = new WeakMap()\nconst brandToPrivatePrototypes = new WeakMap()\nconst brandToPublicsPrivates = new WeakMap()\n\nconst defaultOptions = {\n\t// es5 class inheritance is simple, nice, easy, and robust\n\t// There was another mode, but it has been removed\n\tmode: 'es5',\n\n\t// false is better for performance, but true will use Function (similar to\n\t// eval) to name your class functions in the most accurate way.\n\tnativeNaming: false,\n\n\t// similar to ES6 classes:\n\tprototypeWritable: false,\n\tdefaultClassDescriptor: {\n\t\twritable: true,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t},\n\tsetClassDescriptors: true,\n}\n\nexport class InvalidSuperAccessError extends Error {}\nexport class InvalidAccessError extends Error {}\n\nexport const Class = createClassHelper()\n\nexport function createClassHelper(options?: any) {\n\toptions = options ? {...defaultOptions, ...options} : defaultOptions\n\n\toptions.defaultClassDescriptor = {\n\t\t...defaultOptions.defaultClassDescriptor,\n\t\t...options.defaultClassDescriptor,\n\t}\n\n\tconst {mode, prototypeWritable, setClassDescriptors, nativeNaming} = options\n\n\t/*\n\t * this is just the public interface adapter for createClass(). Depending\n\t * on how you call this interface, you can do various things like:\n\t *\n\t * - anonymous empty class\n\t *\n\t * Class()\n\t *\n\t * - named empty class\n\t *\n\t * Class('Foo')\n\t *\n\t * - base class named Foo\n\t *\n\t * Class('Foo', (Public, Protected, Private) => {\n\t * someMethod() { ... },\n\t * })\n\t *\n\t * - anonymous base class\n\t *\n\t * Class((Public, Protected, Private) => {\n\t * someMethod() { ... },\n\t * })\n\t *\n\t * Class('Foo').extends(OtherClass, (Public, Protected, Private) => ({\n\t * someMethod() { ... },\n\t * }))\n\t *\n\t * OtherClass.subclass = Class\n\t * const Bar = OtherClass.subclass((Public, Protected, Private) => {\n\t * ...\n\t * })\n\t *\n\t * - any class made with lowclass has a static subclass if you prefer using\n\t * that:\n\t *\n\t * Bar.subclass('Baz', (Public, Protected, Private) => {...})\n\t *\n\t * - but you could as well do\n\t *\n\t * Class('Baz').extends(Bar, (Public, Protected, Private) => {...})\n\t */\n\tfunction Class(): typeof Object\n\t// export function Class(\n\tfunction Class(name: string): {\n\t\textends(\n\t\t\tbase: TBase,\n\t\t\tmembers: (helpers: {\n\t\t\t\tSuper: SuperHelper\n\t\t\t\tPublic: PublicHelper\n\t\t\t\tProtected: ProtectedHelper\n\t\t\t\tPrivate: PrivateHelper\n\t\t\t}) => T &\n\t\t\t\tPartial> &\n\t\t\t\tThisType & ExtractInheritedProtected>>,\n\t\t\tbrand?: object,\n\t\t): T extends {constructor: infer _TCtor}\n\t\t\t? FunctionToConstructor, Id & OmitImplementationKeys>> &\n\t\t\t\t\tId & Pick>\n\t\t\t: ReplaceCtorReturn>> & Id & Pick>\n\t}\n\tfunction Class(\n\t\tname: string,\n\t\tmembers: (\n\t\t\thelpers: {\n\t\t\t\tPublic: PublicHelper\n\t\t\t\tProtected: ProtectedHelper\n\t\t\t\tPrivate: PrivateHelper\n\t\t\t\tSuper: never\n\t\t\t}, // TODO Super is actually Object\n\t\t) => T & ThisType>,\n\t\tbrand?: object,\n\t): FunctionToConstructor, Id>> & Id>\n\tfunction Class(\n\t\tname: string,\n\t\tmembers: T & ThisType>,\n\t\tbrand?: object,\n\t): FunctionToConstructor, Id>> & Id>\n\tfunction Class(this: any, ...args: any[]) {\n\t\tlet usingStaticSubclassMethod = false\n\n\t\t// if called as SomeConstructor.subclass, or bound to SomeConstructor\n\t\tif (typeof this === 'function') usingStaticSubclassMethod = true\n\n\t\t// f.e. `Class()`, `Class('Foo')`, `Class('Foo', {...})` , `Class('Foo',\n\t\t// {...}, Brand)`, similar to `class {}`, `class Foo {}`, class Foo\n\t\t// {...}, and class Foo {...} with branding (see comments on classBrand\n\t\t// below regarding positional privacy)\n\t\tif (args.length <= 3) {\n\t\t\tlet name = ''\n\t\t\tlet definer: any = null\n\t\t\tlet classBrand: any = null\n\n\t\t\t// f.e. `Class('Foo')`\n\t\t\tif (typeof args[0] === 'string') name = args[0]\n\t\t\t// f.e. `Class((pub, prot, priv) => ({ ... }))`\n\t\t\telse if (typeof args[0] === 'function' || typeof args[0] === 'object') {\n\t\t\t\tdefiner = args[0]\n\t\t\t\tclassBrand = args[1]\n\t\t\t}\n\n\t\t\t// f.e. `Class('Foo', (pub, prot, priv) => ({ ... }))`\n\t\t\tif (typeof args[1] === 'function' || typeof args[1] === 'object') {\n\t\t\t\tdefiner = args[1]\n\t\t\t\tclassBrand = args[2]\n\t\t\t}\n\n\t\t\t// Make a class in case we wanted to do just `Class()` or\n\t\t\t// `Class('Foo')`...\n\t\t\tconst Ctor = usingStaticSubclassMethod\n\t\t\t\t? createClass.call(this, name, definer, classBrand)\n\t\t\t\t: createClass(name, definer, classBrand)\n\n\t\t\t// ...but add the extends helper in case we wanted to do like:\n\t\t\t// Class().extends(OtherClass, (Public, Protected, Private) => ({\n\t\t\t// ...\n\t\t\t// }))\n\t\t\tCtor.extends = function (ParentClass: any, def: any, brand: any) {\n\t\t\t\tdef = def || definer\n\t\t\t\tbrand = brand || classBrand\n\t\t\t\treturn createClass.call(ParentClass, name, def, brand)\n\t\t\t}\n\n\t\t\treturn Ctor\n\t\t}\n\n\t\tthrow new TypeError('invalid args')\n\t}\n\n\treturn Class\n\n\t/**\n\t * @param {string} className The name that the class being defined should\n\t * have.\n\t * @param {Function} definer A function or object for defining the class.\n\t * If definer a function, it is passed the Public, Protected, Private, and\n\t * Super helpers. Methods and properties can be defined on the helpers\n\t * directly. An object containing methods and properties can also be\n\t * returned from the function. If definer is an object, the object should\n\t * be in the same format as the one returned if definer were a function.\n\t */\n\tfunction createClass(this: any, className: string, definer: (...args: any[]) => any, classBrand: object) {\n\t\t'use strict'\n\n\t\t// f.e. ParentClass.subclass((Public, Protected, Private) => {...})\n\t\tlet ParentClass = this\n\n\t\tif (typeof className !== 'string') {\n\t\t\tthrow new TypeError(`\n You must specify a string for the 'className' argument.\n `)\n\t\t}\n\n\t\tlet definition = null\n\n\t\t// f.e. Class('Foo', { ... })\n\t\tif (definer && typeof definer === 'object') {\n\t\t\tdefinition = definer\n\t\t}\n\n\t\t// Return early if there's no definition or parent class, just a simple\n\t\t// extension of Object. f.e. when doing just `Class()` or\n\t\t// `Class('Foo')`\n\t\telse if (!ParentClass && (!definer || (typeof definer !== 'function' && typeof definer !== 'object'))) {\n\t\t\tlet Ctor\n\n\t\t\tif (nativeNaming && className) Ctor = new Function(`return function ${className}() {}`)()\n\t\t\telse {\n\t\t\t\t// force anonymous even in ES6+\n\t\t\t\tCtor = (() => function () {})()\n\n\t\t\t\tif (className) setDescriptor(Ctor, 'name', {value: className})\n\t\t\t}\n\n\t\t\tCtor.prototype = {__proto__: Object.prototype, constructor: Ctor}\n\n\t\t\t// no static inheritance here, just like with `class Foo {}`\n\n\t\t\tsetDescriptor(Ctor, 'subclass', {\n\t\t\t\tvalue: Class,\n\t\t\t\twritable: true, // TODO maybe let's make this non writable\n\t\t\t\tenumerable: false,\n\t\t\t\tconfigurable: false,\n\t\t\t})\n\n\t\t\treturn Ctor\n\t\t}\n\n\t\t// A two-way map to associate public instances with private instances.\n\t\t// Unlike publicToProtected, this is inside here because there is one\n\t\t// private instance per class scope per instance (or to say it another\n\t\t// way, each instance has as many private instances as the number of\n\t\t// classes that the given instance has in its inheritance chain, one\n\t\t// private instance per class)\n\t\tconst scopedPublicsToPrivates = classBrand ? void undefined : new WeakTwoWayMap()\n\n\t\tif (classBrand) {\n\t\t\tif (!brandToPublicsPrivates.get(classBrand)) brandToPublicsPrivates.set(classBrand, new WeakTwoWayMap())\n\t\t}\n\n\t\t// if no brand provided, then we use the most fine-grained lexical\n\t\t// privacy. Lexical privacy is described at\n\t\t// https://github.com/tc39/proposal-class-fields/issues/60\n\t\t//\n\t\t// TODO make prototypes non-configurable so that the clasds-brand system\n\t\t// can't be tricked. For now, it's good enough, most people aren't going\n\t\t// to go out of their way to mangle with the prototypes in order to\n\t\t// force invalid private access.\n\t\tclassBrand = classBrand || {brand: 'lexical'}\n\n\t\t// the class \"scope\" that we will bind to the helper functions\n\t\tconst scope = {\n\t\t\tclassName, // convenient for debugging\n\n\t\t\tget publicToPrivate() {\n\t\t\t\treturn scopedPublicsToPrivates ? scopedPublicsToPrivates : brandToPublicsPrivates.get(classBrand)\n\t\t\t},\n\n\t\t\tclassBrand,\n\n\t\t\t// we use these to memoize the Public/Protected/Private access\n\t\t\t// helper results, to make subsequent accessses faster.\n\t\t\tcachedPublicAccesses: new WeakMap(),\n\t\t\tcachedProtectedAccesses: new WeakMap(),\n\t\t\tcachedPrivateAccesses: new WeakMap(),\n\t\t} as any\n\n\t\t// create the super helper for this class scope\n\t\tconst supers = new WeakMap()\n\t\tconst Super = superHelper.bind(null, supers, scope)\n\n\t\t// bind this class' scope to the helper functions\n\t\tconst Public = getPublicMembers.bind(null, scope) as any\n\t\tconst Protected = getProtectedMembers.bind(null, scope) as any\n\t\tconst Private = getPrivateMembers.bind(null, scope) as any\n\n\t\tPublic.prototype = {}\n\t\tProtected.prototype = {}\n\t\tPrivate.prototype = {}\n\n\t\t// alows the user to destructure arguments to definer functions\n\t\tPublic.Public = Public\n\t\tPublic.Protected = Protected\n\t\tPublic.Private = Private\n\t\tPublic.Super = Super\n\t\tProtected.Public = Public\n\t\tProtected.Protected = Protected\n\t\tProtected.Private = Private\n\t\tProtected.Super = Super\n\t\t// Private and Super are never passed as first argument\n\n\t\t// pass the helper functions to the user's class definition function\n\t\tdefinition = definition || (definer && definer(Public, Protected, Private, Super))\n\n\t\t// the user has the option of returning an object that defines which\n\t\t// properties are public/protected/private.\n\t\tif (definition && typeof definition !== 'object' && typeof definition !== 'function') {\n\t\t\tthrow new TypeError(`\n The return value of a class definer function, if any, should be\n an object, or a class constructor.\n `)\n\t\t}\n\n\t\t// if a function was returned, we assume it is a class from which we\n\t\t// get the public definition from.\n\t\tlet customClass = null\n\t\tif (typeof definition === 'function') {\n\t\t\tcustomClass = definition\n\t\t\tdefinition = definition.prototype\n\t\t\tParentClass = customClass.prototype.__proto__.constructor\n\t\t}\n\n\t\tlet staticMembers\n\n\t\t// if functions were provided for the public/protected/private\n\t\t// properties of the definition object, execute them with their\n\t\t// respective access helpers, and use the objects returned from them.\n\t\tif (definition) {\n\t\t\tstaticMembers = definition.static\n\t\t\tdelete definition.static\n\n\t\t\tif (typeof definition.public === 'function') {\n\t\t\t\tdefinition.public = definition.public(Protected, Private)\n\t\t\t}\n\n\t\t\tif (typeof definition.protected === 'function') {\n\t\t\t\tdefinition.protected = definition.protected(Public, Private)\n\t\t\t}\n\n\t\t\tif (typeof definition.private === 'function') {\n\t\t\t\tdefinition.private = definition.private(Public, Protected)\n\t\t\t}\n\t\t}\n\n\t\tParentClass = ParentClass || Object\n\n\t\t// extend the parent class\n\t\tconst parentPublicPrototype = ParentClass.prototype\n\t\tconst publicPrototype = (definition && definition.public) || definition || Object.create(parentPublicPrototype)\n\t\tif (publicPrototype.__proto__ !== parentPublicPrototype) publicPrototype.__proto__ = parentPublicPrototype\n\n\t\t// extend the parent protected prototype\n\t\tconst parentProtectedPrototype = getParentProtectedPrototype(parentPublicPrototype)\n\t\tconst protectedPrototype = (definition && definition.protected) || Object.create(parentProtectedPrototype)\n\t\tif (protectedPrototype.__proto__ !== parentProtectedPrototype)\n\t\t\tprotectedPrototype.__proto__ = parentProtectedPrototype\n\t\tpublicProtoToProtectedProto.set(publicPrototype, protectedPrototype)\n\n\t\t// private prototype inherits from parent, but each private instance is\n\t\t// private only for the class of this scope\n\t\tconst parentPrivatePrototype = getParentPrivatePrototype(parentPublicPrototype)\n\t\tconst privatePrototype = (definition && definition.private) || Object.create(parentPrivatePrototype)\n\t\tif (privatePrototype.__proto__ !== parentPrivatePrototype) privatePrototype.__proto__ = parentPrivatePrototype\n\t\tpublicProtoToPrivateProto.set(publicPrototype, privatePrototype)\n\n\t\tif (!brandToPublicPrototypes.get(classBrand)) brandToPublicPrototypes.set(classBrand, new Set())\n\t\tif (!brandToProtectedPrototypes.get(classBrand)) brandToProtectedPrototypes.set(classBrand, new Set())\n\t\tif (!brandToPrivatePrototypes.get(classBrand)) brandToPrivatePrototypes.set(classBrand, new Set())\n\n\t\tbrandToPublicPrototypes.get(classBrand).add(publicPrototype)\n\t\tbrandToProtectedPrototypes.get(classBrand).add(protectedPrototype)\n\t\tbrandToPrivatePrototypes.get(classBrand).add(privatePrototype)\n\n\t\tscope.publicPrototype = publicPrototype\n\t\tscope.privatePrototype = privatePrototype\n\t\tscope.protectedPrototype = protectedPrototype\n\t\tscope.parentPublicPrototype = parentPublicPrototype\n\t\tscope.parentProtectedPrototype = parentProtectedPrototype\n\t\tscope.parentPrivatePrototype = parentPrivatePrototype\n\n\t\t// the user has the option of assigning methods and properties to the\n\t\t// helpers that we passed in, to let us know which methods and\n\t\t// properties are public/protected/private so we can assign them onto\n\t\t// the respective prototypes.\n\t\tcopyDescriptors(Public.prototype, publicPrototype)\n\t\tcopyDescriptors(Protected.prototype, protectedPrototype)\n\t\tcopyDescriptors(Private.prototype, privatePrototype)\n\n\t\tif (definition) {\n\t\t\t// delete these so we don't expose them on the class' public\n\t\t\t// prototype\n\t\t\tdelete definition.public\n\t\t\tdelete definition.protected\n\t\t\tdelete definition.private\n\n\t\t\t// if a `public` object was also supplied, we treat that as the public\n\t\t\t// prototype instead of the base definition object, so we copy the\n\t\t\t// definition's props to the `public` object\n\t\t\t//\n\t\t\t// TODO For now we copy from the definition object to the 'public'\n\t\t\t// object (publicPrototype), but this won't work with native `super`.\n\t\t\t// Maybe later, we can use a Proxy to read props from both the root\n\t\t\t// object and the public object, so that `super` works from both.\n\t\t\t// Another option is to not allow a `public` object, only protected\n\t\t\t// and private\n\t\t\tif (definition !== publicPrototype) {\n\t\t\t\t// copy whatever remains\n\t\t\t\tcopyDescriptors(definition, publicPrototype)\n\t\t\t}\n\t\t}\n\n\t\tif (customClass) {\n\t\t\tif (staticMembers) copyDescriptors(staticMembers, customClass)\n\t\t\treturn customClass\n\t\t}\n\n\t\tconst userConstructor = publicPrototype.hasOwnProperty('constructor') ? publicPrototype.constructor : null\n\n\t\tlet NewClass = null\n\t\tlet newPrototype = null\n\n\t\t// ES5 version (which seems to be so much better)\n\t\tif (mode === 'es5') {\n\t\t\tNewClass = (() =>\n\t\t\t\tfunction (this: any) {\n\t\t\t\t\tlet ret = null\n\n\t\t\t\t\tlet constructor = null\n\n\t\t\t\t\tif (userConstructor) constructor = userConstructor\n\t\t\t\t\telse constructor = ParentClass\n\n\t\t\t\t\t// Object is a special case because otherwise\n\t\t\t\t\t// `Object.apply(this)` returns a different object and we don't\n\t\t\t\t\t// want to deal with return value in that case\n\t\t\t\t\tif (constructor !== Object) ret = constructor.apply(this, arguments)\n\n\t\t\t\t\tif (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n\t\t\t\t\t\t// XXX should we set ret.__proto__ = constructor.prototype\n\t\t\t\t\t\t// here? Or let the user deal with that?\n\t\t\t\t\t\treturn ret\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this\n\t\t\t\t})()\n\n\t\t\tnewPrototype = publicPrototype\n\t\t} else {\n\t\t\tthrow new TypeError(`\n The lowclass \"mode\" option can only be 'es5' for now.\n `)\n\t\t}\n\n\t\tif (className) {\n\t\t\tif (nativeNaming) {\n\t\t\t\tconst code = getFunctionBody(NewClass)\n\t\t\t\tconst proto = NewClass.prototype\n\n\t\t\t\tNewClass = new Function(\n\t\t\t\t\t` userConstructor, ParentClass `,\n\t\t\t\t\t`\n return function ${className}() { ${code} }\n `,\n\t\t\t\t)(userConstructor, ParentClass)\n\n\t\t\t\tNewClass.prototype = proto\n\t\t\t} else {\n\t\t\t\tsetDescriptor(NewClass, 'name', {value: className})\n\t\t\t}\n\t\t}\n\n\t\tif (userConstructor && userConstructor.length) {\n\t\t\t// length is not writable, only configurable, therefore the value\n\t\t\t// has to be set with a descriptor update\n\t\t\tsetDescriptor(NewClass, 'length', {\n\t\t\t\tvalue: userConstructor.length,\n\t\t\t})\n\t\t}\n\n\t\t// static stuff {\n\n\t\t// static inheritance\n\t\tNewClass.__proto__ = ParentClass\n\n\t\tif (staticMembers) copyDescriptors(staticMembers, NewClass)\n\n\t\t// allow users to make subclasses. When subclass is called on a\n\t\t// constructor, it defines `this` which is assigned to ParentClass\n\t\t// above.\n\t\tsetDescriptor(NewClass, 'subclass', {\n\t\t\tvalue: Class,\n\t\t\twritable: true,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false,\n\t\t})\n\n\t\t// }\n\n\t\t// prototype stuff {\n\n\t\tNewClass.prototype = newPrototype\n\n\t\tNewClass.prototype.constructor = NewClass\n\n\t\t// }\n\n\t\tif (setClassDescriptors) {\n\t\t\tsetDefaultStaticDescriptors(NewClass, options, staticBlacklist)\n\t\t\tsetDescriptor(NewClass, 'prototype', {writable: prototypeWritable})\n\t\t\tsetDefaultPrototypeDescriptors(NewClass.prototype, options)\n\t\t\tsetDefaultPrototypeDescriptors(protectedPrototype, options)\n\t\t\tsetDefaultPrototypeDescriptors(privatePrototype, options)\n\t\t}\n\n\t\tscope.constructor = NewClass // convenient for debugging\n\n\t\treturn NewClass\n\t}\n}\n\n// XXX PERFORMANCE: instead of doing multiple prototype traversals with\n// hasPrototype in the following access helpers, maybe we can do a single\n// traversal and check along the way?\n//\n// Worst case examples:\n//\n// currently:\n// If class hierarchy has 20 classes\n// If we detect which instance we have in order of public, protected, private\n// If the instance we're checking is the private instance of the middle class (f.e. class 10)\n// We'll traverse 20 public prototypes with 20 conditional checks\n// We'll traverse 20 protected prototypes with 20 conditional checks\n// And finally we'll traverse 10 private prototypes with 10 conditional checks\n// TOTAL: We traverse over 50 prototypes with 50 conditional checks\n//\n// proposed:\n// If class hierarchy has 20 classes\n// If we detect which instance we have in order of public, protected, private\n// If the instance we're checking is the private instance of the middle class (f.e. class 10)\n// We'll traverse 10 public prototypes with 3 conditional checks at each prototype\n// TOTAL: We traverse over 10 prototypes with 30 conditional checks\n// BUT: The conditional checking will involve reading WeakMaps instead of\n// checking just reference equality. If we can optimize how this part\n// works, it might be worth it.\n//\n// Can the tradeoff (less traversal and conditional checks) outweigh the\n// heavier conditional checks?\n//\n// XXX PERFORMANCE: We can also cache the access-helper results, which requires more memory,\n// but will make use of access helpers much faster, especially important for\n// animations.\n\nfunction getParentProtectedPrototype(parentPublicPrototype: any) {\n\t// look up the prototype chain until we find a parent protected prototype, if any.\n\n\tlet parentProtectedProto\n\tlet currentPublicProto = parentPublicPrototype\n\n\twhile (currentPublicProto && !parentProtectedProto) {\n\t\tparentProtectedProto = publicProtoToProtectedProto.get(currentPublicProto)\n\t\tcurrentPublicProto = currentPublicProto.__proto__\n\t}\n\n\t// TODO, now that we're finding the nearest parent protected proto,\n\t// we might not need to create an empty object for each class if we\n\t// don't find one, to avoid prototype lookup depth, as we'll connect\n\t// to the nearest one we find, if any.\n\treturn parentProtectedProto || {}\n}\n\nfunction getParentPrivatePrototype(parentPublicPrototype: any) {\n\t// look up the prototype chain until we find a parent protected prototype, if any.\n\n\tlet parentPrivateProto\n\tlet currentPublicProto = parentPublicPrototype\n\n\twhile (currentPublicProto && !parentPrivateProto) {\n\t\tparentPrivateProto = publicProtoToPrivateProto.get(currentPublicProto)\n\t\tcurrentPublicProto = currentPublicProto.__proto__\n\t}\n\n\t// TODO, now that we're finding the nearest parent protected proto,\n\t// we might not need to create an empty object for each class if we\n\t// don't find one, to avoid prototype lookup depth, as we'll connect\n\t// to the nearest one we find, if any.\n\treturn parentPrivateProto || {}\n}\n\nfunction getPublicMembers(scope: any, instance: any) {\n\tlet result = scope.cachedPublicAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check only for the private instance of this class scope\n\tif (isPrivateInstance(scope, instance))\n\t\tscope.cachedPublicAccesses.set(instance, (result = getSubclassScope(instance).publicToPrivate.get(instance)))\n\t// check for an instance of the class (or its subclasses) of this scope\n\telse if (isProtectedInstance(scope, instance))\n\t\tscope.cachedPublicAccesses.set(instance, (result = publicToProtected.get(instance)))\n\t// otherwise just return whatever was passed in, it's public already!\n\telse scope.cachedPublicAccesses.set(instance, (result = instance))\n\n\treturn result\n}\n\nfunction getProtectedMembers(scope: any, instance: any) {\n\tlet result = scope.cachedProtectedAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check for an instance of the class (or its subclasses) of this scope\n\t// This allows for example an instance of an Animal base class to access\n\t// protected members of an instance of a Dog child class.\n\tif (isPublicInstance(scope, instance))\n\t\tscope.cachedProtectedAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = publicToProtected.get(instance) || createProtectedInstance(instance)),\n\t\t)\n\t// check for a private instance inheriting from this class scope\n\telse if (isPrivateInstance(scope, instance)) {\n\t\tconst publicInstance = getSubclassScope(instance).publicToPrivate.get(instance)\n\t\tscope.cachedProtectedAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = publicToProtected.get(publicInstance) || createProtectedInstance(publicInstance)),\n\t\t)\n\t}\n\n\t// return the protected instance if it was passed in\n\telse if (isProtectedInstance(scope, instance)) scope.cachedProtectedAccesses.set(instance, (result = instance))\n\n\tif (!result) throw new InvalidAccessError('invalid access of protected member')\n\n\treturn result\n}\n\nfunction getSubclassScope(privateInstance: any) {\n\treturn privateInstanceToClassScope.get(privateInstance)\n}\n\nfunction createProtectedInstance(publicInstance: any) {\n\t// traverse instance proto chain, find first protected prototype\n\tconst protectedPrototype = findLeafmostProtectedPrototype(publicInstance)\n\n\t// make the protected instance from the found protected prototype\n\tconst protectedInstance = Object.create(protectedPrototype)\n\tpublicToProtected.set(publicInstance, protectedInstance)\n\treturn protectedInstance\n}\n\nfunction findLeafmostProtectedPrototype(publicInstance: any) {\n\tlet result = null\n\tlet currentProto = publicInstance.__proto__\n\n\twhile (currentProto) {\n\t\tresult = publicProtoToProtectedProto.get(currentProto)\n\t\tif (result) return result\n\t\tcurrentProto = currentProto.__proto__\n\t}\n\n\treturn result\n}\n\nfunction getPrivateMembers(scope: any, instance: any) {\n\tlet result = scope.cachedPrivateAccesses.get(instance)\n\n\tif (result) return result\n\n\t// check for a public instance that is or inherits from this class\n\tif (isPublicInstance(scope, instance))\n\t\tscope.cachedPrivateAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = scope.publicToPrivate.get(instance) || createPrivateInstance(scope, instance)),\n\t\t)\n\t// check for a protected instance that is or inherits from this class'\n\t// protectedPrototype\n\telse if (isProtectedInstance(scope, instance)) {\n\t\tconst publicInstance = publicToProtected.get(instance)\n\t\tscope.cachedPrivateAccesses.set(\n\t\t\tinstance,\n\t\t\t(result = scope.publicToPrivate.get(publicInstance) || createPrivateInstance(scope, publicInstance)),\n\t\t)\n\t}\n\n\t// return the private instance if it was passed in\n\telse if (isPrivateInstance(scope, instance)) scope.cachedPrivateAccesses.set(instance, (result = instance))\n\n\tif (!result) throw new InvalidAccessError('invalid access of private member')\n\n\treturn result\n}\n\nfunction createPrivateInstance(scope: any, publicInstance: any) {\n\tconst privateInstance = Object.create(scope.privatePrototype)\n\tscope.publicToPrivate.set(publicInstance, privateInstance)\n\tprivateInstanceToClassScope.set(privateInstance, scope) // TODO use WeakTwoWayMap\n\treturn privateInstance\n}\n\nfunction isPublicInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.publicPrototype)\n\n\tfor (const proto of Array.from(brandToPublicPrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction isProtectedInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.protectedPrototype)\n\n\tfor (const proto of Array.from(brandToProtectedPrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction isPrivateInstance(scope: any, instance: any, brandedCheck = true) {\n\tif (!brandedCheck) return hasPrototype(instance, scope.privatePrototype)\n\n\tfor (const proto of Array.from(brandToPrivatePrototypes.get(scope.classBrand))) {\n\t\tif (hasPrototype(instance, proto)) return true\n\t}\n\n\treturn false\n}\n\nfunction superHelper(supers: any, scope: any, instance: any) {\n\tconst {parentPublicPrototype, parentProtectedPrototype, parentPrivatePrototype} = scope\n\n\tif (isPublicInstance(scope, instance, false)) return getSuperHelperObject(instance, parentPublicPrototype, supers)\n\n\tif (isProtectedInstance(scope, instance, false))\n\t\treturn getSuperHelperObject(instance, parentProtectedPrototype, supers)\n\n\tif (isPrivateInstance(scope, instance, false)) return getSuperHelperObject(instance, parentPrivatePrototype, supers)\n\n\tthrow new InvalidSuperAccessError('invalid super access')\n}\n\nfunction getSuperHelperObject(instance: any, parentPrototype: any, supers: any) {\n\tlet _super = supers.get(instance)\n\n\t// XXX PERFORMANCE: there's probably some ways to improve speed here using caching\n\tif (!_super) {\n\t\tsupers.set(instance, (_super = Object.create(parentPrototype)))\n\n\t\tconst keys = getInheritedPropertyNames(parentPrototype)\n\t\tlet i = keys.length\n\n\t\twhile (i--) {\n\t\t\tconst key = keys[i]\n\n\t\t\tsetDescriptor(\n\t\t\t\t_super,\n\t\t\t\tkey,\n\t\t\t\t{\n\t\t\t\t\tget: function () {\n\t\t\t\t\t\tlet value: any = void undefined\n\n\t\t\t\t\t\tconst descriptor = getInheritedDescriptor(parentPrototype, key)\n\n\t\t\t\t\t\tif (descriptor && propertyIsAccessor(descriptor)) {\n\t\t\t\t\t\t\tconst getter = descriptor.get\n\t\t\t\t\t\t\tif (getter) value = getter.call(instance)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = parentPrototype[key]\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (value && value.call && typeof value === 'function') {\n\t\t\t\t\t\t\tvalue = value.bind(instance)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\n\t\t\t\t\t// like native `super`, setting a super property does nothing.\n\t\t\t\t\tset: function (value) {\n\t\t\t\t\t\tconst descriptor = getInheritedDescriptor(parentPrototype, key)\n\n\t\t\t\t\t\tif (descriptor && propertyIsAccessor(descriptor)) {\n\t\t\t\t\t\t\tconst setter = descriptor.set\n\t\t\t\t\t\t\tif (setter) value = setter.call(instance, value)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// just like native `super`\n\t\t\t\t\t\t\tinstance[key] = value\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn _super\n}\n\nexport default Class\n","import type {Constructor} from './utils.js'\n\n// --- TODO handle static inheritance. Nothing has been implemented with regards to\n// static inheritance yet.\n\n// --- TODO allow the subclass (f.e. the `Foo` in `class Foo extends multiple(One,\n// Two, Three) {}`) to call each super constructor (One, Two, and Three)\n// individually with specific arguments.\n\n// --- TODO Prevent duplicate classes in the \"prototype tree\". F.e. if someone calls\n// `multiple(One, Two, Three)`, and `Three` already includes `Two`, we can\n// discard the `Two` argument and perform the combination as if `multiple(One,\n// Three)` had been called.\n\n// --- TODO cache the results, so more than one call to `multiple(One, Two, Three)`\n// returns the same class reference as the first call.\n\n// --- TODO, allow the user to handle the diamond problem in some way other than\n// (\"property or method from the first class in the list wins\"). Perhaps require\n// the user to specify which method to call. For now, it simply calls the first\n// method in the order in which the classes were passed into multiple(). Look\n// here for ideas based on how different languages handle it:\n// https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem\n\nenum ImplementationMethod {\n\tPROXIES_ON_INSTANCE_AND_PROTOTYPE = 'PROXIES_ON_INSTANCE_AND_PROTOTYPE',\n\tPROXIES_ON_PROTOTYPE = 'PROXIES_ON_PROTOTYPE',\n\n\t// TODO, This will be similar to PROXIES_ON_INSTANCE_AND_PROTOTYPE, but\n\t// instead of placing a proxy on the instance, place a Proxy as a direct\n\t// prototype of the instance. I think this should work with Custom Elements,\n\t// and unlike PROXIES_ON_PROTOTYPE, super calls won't access own properties\n\t// on the instance, but actually on the prototypes (test5 super access tests\n\t// fail with PROXIES_ON_PROTOTYPE method).\n\tPROXY_AFTER_INSTANCE_AND_PROTOTYPE = 'PROXY_AFTER_INSTANCE_AND_PROTOTYPE',\n}\n\ntype MultipleOptions = {\n\tmethod: ImplementationMethod\n}\n\nexport function makeMultipleHelper(options?: MultipleOptions) {\n\t/**\n\t * Mixes the given classes into a single class. This is useful for multiple\n\t * inheritance.\n\t *\n\t * @example\n\t * class Foo {}\n\t * class Bar {}\n\t * class Baz {}\n\t * class MyClass extends multiple(Foo, Bar, Baz) {}\n\t */\n\t// ------------ method 1, define the `multiple()` signature with overrides. The\n\t// upside is it is easy to understand, but the downside is that name collisions\n\t// in properties cause the collided property type to be `never`. This would make\n\t// it more difficult to provide solution for the diamond problem.\n\t// ----------------\n\t// function multiple(): typeof Object\n\t// function multiple(classes: T): T\n\t// function multiple(...classes: T): Constructor>\n\t// function multiple(...classes: any): any {\n\t//\n\t// ------------ method 2, define the signature of `multiple()` with a single\n\t// signature. The upside is this picks the type of the first property\n\t// encountered when property names collide amongst all the classes passed into\n\t// `multiple()`, but the downside is the inner implementation may require\n\t// casting, and this approach can also cause an infinite type recursion\n\t// depending on the types used inside the implementation.\n\t// ----------------\n\treturn function multiple(...classes: T): CombinedClasses {\n\t\tconst mode = (options && options.method) || ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE\n\n\t\tswitch (mode) {\n\t\t\tcase ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE: {\n\t\t\t\treturn (withProxiesOnThisAndPrototype as any)(...classes)\n\t\t\t}\n\t\t\tcase ImplementationMethod.PROXIES_ON_PROTOTYPE: {\n\t\t\t\treturn (withProxiesOnPrototype as any)(...classes)\n\t\t\t}\n\t\t\tcase ImplementationMethod.PROXY_AFTER_INSTANCE_AND_PROTOTYPE: {\n\t\t\t\tthrow new Error(' not implemented yet')\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Mixes the given classes into a single class. This is useful for multiple\n * inheritance.\n *\n * @example\n * class Foo {}\n * class Bar {}\n * class Baz {}\n * class MyClass extends multiple(Foo, Bar, Baz) {}\n */\nexport const multiple = makeMultipleHelper({method: ImplementationMethod.PROXIES_ON_INSTANCE_AND_PROTOTYPE})\n// export const multiple = makeMultipleHelper({method: ImplementationMethod.PROXIES_ON_PROTOTYPE})\n\nfunction withProxiesOnThisAndPrototype(...classes: T): CombinedClasses {\n\t// avoid performance costs in special cases\n\tif (classes.length === 0) return Object as any\n\tif (classes.length === 1) return classes[0] as any\n\n\tconst FirstClass = classes.shift()!\n\n\t// inherit the first class normally. This allows for required native\n\t// inheritance in certain special cases (like inheriting from HTMLElement\n\t// when making Custom Elements).\n\tclass MultiClass extends FirstClass {\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\n\t\t\tconst instances: Object[] = []\n\n\t\t\t// make instances of the other classes to get/set properties on.\n\t\t\tlet Ctor: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tCtor = classes[i]\n\t\t\t\tconst instance = Reflect.construct(Ctor, args)\n\t\t\t\tinstances.push(instance)\n\t\t\t}\n\n\t\t\treturn new Proxy(this, {\n\t\t\t\t// No `set()` trap is needed in this Proxy handler, at least for\n\t\t\t\t// the tests so far. Methods automatically have the correct\n\t\t\t\t// receiver when the are gotten with the `get()` trap, so if any\n\t\t\t\t// methods set a property, the set happens on the expected\n\t\t\t\t// instance, just like regular [[Set]].\n\n\t\t\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\t\t\tif (Reflect.ownKeys(target).includes(key)) return Reflect.get(target, key, self)\n\n\t\t\t\t\tlet instance: Object\n\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tif (Reflect.ownKeys(instance).includes(key)) return Reflect.get(instance, key, self)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst proto = Object.getPrototypeOf(self)\n\t\t\t\t\tif (Reflect.has(proto, key)) return Reflect.get(proto, key, self)\n\n\t\t\t\t\treturn undefined\n\t\t\t\t},\n\n\t\t\t\townKeys(target) {\n\t\t\t\t\tlet keys = Reflect.ownKeys(target)\n\n\t\t\t\t\tlet instance: Object\n\t\t\t\t\tlet instanceKeys: (string | symbol)[]\n\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tinstanceKeys = Reflect.ownKeys(instance)\n\t\t\t\t\t\tfor (let j = 0, l = instanceKeys.length; j < l; j += 1) keys.push(instanceKeys[j])\n\t\t\t\t\t}\n\n\t\t\t\t\treturn keys\n\t\t\t\t},\n\n\t\t\t\t// This makes the `in` operator work, for example.\n\t\t\t\thas(target, key: string | symbol): boolean {\n\t\t\t\t\tif (Reflect.ownKeys(target).includes(key)) return true\n\n\t\t\t\t\tlet instance: Object\n\t\t\t\t\tfor (let i = 0, l = instances.length; i < l; i += 1) {\n\t\t\t\t\t\tinstance = instances[i]\n\t\t\t\t\t\tif (Reflect.ownKeys(instance).includes(key)) return true\n\t\t\t\t\t}\n\n\t\t\t\t\t// all instances share the same prototype, so just check it once\n\t\t\t\t\tconst proto = Object.getPrototypeOf(self)\n\t\t\t\t\tif (Reflect.has(proto, key)) return true\n\n\t\t\t\t\treturn false\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n\n\tconst newMultiClassPrototype = new Proxy(Object.create(FirstClass.prototype), {\n\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\tif (Reflect.has(target, key)) return Reflect.get(target, key, self)\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return Reflect.get(Class.prototype, key, self)\n\t\t\t}\n\t\t},\n\n\t\thas(target, key): boolean {\n\t\t\tif (Reflect.has(target, key)) return true\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return true\n\t\t\t}\n\n\t\t\treturn false\n\t\t},\n\t})\n\n\t// This is so that `super` calls will work. We can't replace\n\t// MultiClass.prototype with a Proxy because MultiClass.prototype is\n\t// non-configurable, so it is impossible to wrap it with a Proxy. Instead,\n\t// we stick our own custom Proxy-wrapped prototype object between\n\t// MultiClass.prototype and FirstClass.prototype.\n\tObject.setPrototypeOf(MultiClass.prototype, newMultiClassPrototype)\n\n\treturn MultiClass as unknown as CombinedClasses\n}\n\nlet currentSelf: Object[] = []\n\nconst __instances__ = new WeakMap()\nconst getInstances = (inst: object): Object[] => {\n\tlet result = __instances__.get(inst)\n\tif (!result) __instances__.set(inst, (result = []))\n\treturn result\n}\n\n// function hasKey(instance: object, key: string | number | symbol, traverse: boolean = true): boolean {\n// \tif (Reflect.ownKeys(instance).includes(key)) return true\n\n// \tif (!traverse) return false\n\n// \tconst instances = __instances__.get(instance)\n// \tif (!instances) return false\n\n// \tfor (const instance of instances) if (hasKey(instance, key, true)) return true\n\n// \treturn false\n// }\n\ntype GetResult = {has: boolean; value: any}\n\nconst getResult: GetResult = {has: false, value: undefined}\n\nfunction getFromInstance(instance: object, key: string | symbol, result: GetResult): void {\n\tresult.has = false\n\tresult.value = undefined\n\n\tif (Reflect.ownKeys(instance).includes(key)) {\n\t\tresult.has = true\n\t\tresult.value = Reflect.get(instance, key)\n\t\treturn\n\t}\n\n\tconst instances = __instances__.get(instance)\n\tif (!instances) return\n\n\tfor (const instance of instances) {\n\t\t// if (hasKey(instance, key, true)) {\n\t\t// getFromInstance(instance, key, result)\n\t\t// return\n\t\t// }\n\n\t\tgetFromInstance(instance, key, result)\n\t\tif (result.has) return\n\t}\n}\n\nlet shouldGetFromPrototype = false\nlet topLevelMultiClassPrototype: object | null = null\n\nfunction withProxiesOnPrototype(...classes: T): CombinedClasses {\n\t// avoid performance costs in special cases\n\tif (classes.length === 0) return Object as any\n\tif (classes.length === 1) return classes[0] as any\n\n\tconst FirstClass = classes.shift()!\n\n\t// inherit the first class normally. This allows for required native\n\t// inheritance in certain special cases (like inheriting from HTMLElement\n\t// when making Custom Elements).\n\tclass MultiClass extends FirstClass {\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\n\t\t\t// This assumes no super constructor returns a different this from\n\t\t\t// their constructor. Otherwise the getInstances call won't work as\n\t\t\t// expected.\n\t\t\tconst instances = getInstances(this)\n\n\t\t\t// make instances of the other classes to get/set properties on.\n\t\t\tfor (const Ctor of classes) {\n\t\t\t\tconst instance = Reflect.construct(Ctor, args)\n\t\t\t\tinstances.push(instance)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst newMultiClassPrototype = new Proxy(Object.create(FirstClass.prototype), {\n\t\tget(target, key: string | symbol, self: MultiClass): any {\n\t\t\tif (!topLevelMultiClassPrototype) topLevelMultiClassPrototype = target\n\n\t\t\tif (!shouldGetFromPrototype) {\n\t\t\t\tgetFromInstance(self, key, getResult)\n\n\t\t\t\tif (getResult.has) {\n\t\t\t\t\ttopLevelMultiClassPrototype = null\n\t\t\t\t\treturn getResult.value\n\t\t\t\t}\n\n\t\t\t\t// only the top level MultiClass subclass prototype will check\n\t\t\t\t// instances for a property. The superclass MultiClass\n\t\t\t\t// prototypes will do a regular prototype get.\n\t\t\t\tshouldGetFromPrototype = true\n\t\t\t}\n\n\t\t\t// TODO, I think instead of passing `self` we should be passing the\n\t\t\t// instances created from the classes? We need to write more tests,\n\t\t\t// especially ones that create new properties later and not at\n\t\t\t// construction time.\n\t\t\tif (shouldGetFromPrototype) {\n\t\t\t\tlet result: any = undefined\n\n\t\t\t\tif (Reflect.has(target, key)) result = Reflect.get(target, key, self)\n\n\t\t\t\tlet Class: Constructor\n\t\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\t\tClass = classes[i]\n\t\t\t\t\tif (Reflect.has(Class.prototype, key)) result = Reflect.get(Class.prototype, key, self)\n\t\t\t\t}\n\n\t\t\t\tif (topLevelMultiClassPrototype === target) {\n\t\t\t\t\ttopLevelMultiClassPrototype = null\n\t\t\t\t\tshouldGetFromPrototype = false\n\t\t\t\t}\n\n\t\t\t\treturn result\n\t\t\t}\n\n\t\t\t// currentSelf.push(self)\n\n\t\t\t// if (Reflect.ownKeys(self).includes(key)) {\n\t\t\t// \tcurrentSelf.pop()\n\t\t\t// \treturn Reflect.get(target, key, self)\n\t\t\t// }\n\n\t\t\t// currentSelf.pop()\n\n\t\t\t// for (const instance of getInstances(self)) {\n\t\t\t// \tcurrentSelf.push(instance)\n\n\t\t\t// \tif (Reflect.ownKeys(instance).includes(key)) {\n\t\t\t// \t\tcurrentSelf.pop()\n\t\t\t// \t\treturn Reflect.get(instance, key, instance)\n\t\t\t// \t}\n\n\t\t\t// \tcurrentSelf.pop()\n\t\t\t// }\n\n\t\t\t// return undefined\n\t\t},\n\n\t\tset(target, key: string | symbol, value: any, self): boolean {\n\t\t\tcurrentSelf.push(self)\n\n\t\t\t// If the key is in the current prototype chain, continue like normal...\n\t\t\tif (Reflect.has(target, key)) {\n\t\t\t\tcurrentSelf.pop()\n\t\t\t\treturn Reflect.set(target, key, value, self)\n\t\t\t}\n\n\t\t\tcurrentSelf.pop()\n\n\t\t\t// ...Otherwise if the key isn't, set it on one of the instances of the classes.\n\t\t\tfor (const instance of getInstances(self)) {\n\t\t\t\tcurrentSelf.push(instance)\n\n\t\t\t\tif (Reflect.has(instance, key)) {\n\t\t\t\t\tcurrentSelf.pop()\n\t\t\t\t\treturn Reflect.set(instance, key, value, instance)\n\t\t\t\t\t// return Reflect.set(instance, key, value, self)\n\t\t\t\t}\n\n\t\t\t\tcurrentSelf.pop()\n\t\t\t}\n\n\t\t\t// If the key is not found, set it like normal.\n\t\t\treturn Reflect.set(target, key, value, self)\n\t\t},\n\n\t\thas(target, key): boolean {\n\t\t\t// if (currentSelf.length) {\n\t\t\t// \tlet current = currentSelf[currentSelf.length - 1]\n\n\t\t\t// \twhile (current) {\n\t\t\t// \t\tif (Reflect.ownKeys(current).includes(key)) return true\n\t\t\t// \t\tcurrent = Reflect.getPrototypeOf(current) as MultiClass\n\t\t\t// \t}\n\n\t\t\t// \tfor (const instance of getInstances(current as MultiClass))\n\t\t\t// \t\tif (Reflect.has(instance, key)) return true\n\t\t\t// } else {\n\t\t\tif (Reflect.has(target, key)) return true\n\n\t\t\tlet Class: Constructor\n\t\t\tfor (let i = 0, l = classes.length; i < l; i += 1) {\n\t\t\t\tClass = classes[i]\n\t\t\t\tif (Reflect.has(Class.prototype, key)) return true\n\t\t\t}\n\t\t\t// }\n\n\t\t\treturn false\n\t\t},\n\t})\n\n\t// This is so that `super` calls will work. We can't replace\n\t// MultiClass.prototype with a Proxy because MultiClass.prototype is\n\t// non-configurable, so it is impossible to wrap it with a Proxy. Instead,\n\t// we stick our own custom Proxy-wrapped prototype object between\n\t// MultiClass.prototype and FirstClass.prototype.\n\tObject.setPrototypeOf(MultiClass.prototype, newMultiClassPrototype)\n\n\treturn MultiClass as unknown as CombinedClasses\n}\n\n// type ConstructorUnionToInstanceTypeUnion = (U extends Constructor\n// ? (k: InstanceType) => void\n// : never) extends (k: infer I) => void\n// ? I\n// : never\n\ntype Shift = ((...args: T) => any) extends (_: any, ...args: infer R) => any ? R : never\ntype MixedArray[]> = _MixedArray\ntype _MixedArray[], U> = {\n\t0: new () => U\n\t1: _MixedArray<\n\t\tShift,\n\t\t{\n\t\t\t[K in keyof InstanceType | keyof U]: K extends keyof U ? U[K] : InstanceType[K]\n\t\t}\n\t>\n}[T['length'] extends 0 ? 0 : 1]\n\ntype CombinedClasses = T extends [] | [undefined]\n\t? typeof Object\n\t: T extends Constructor[]\n\t? MixedArray\n\t: typeof Object\n","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return { ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst NOTPENDING = {};\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst [transPending, setTransPending] = /*@__PURE__*/createSignal(false);\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceFactory = null;\nlet Listener = null;\nlet Pending = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n root = unowned && !false ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: null,\n owner: detachedOwner || owner\n },\n updateFn = unowned ? fn : () => fn(() => cleanNode(root));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n pending: NOTPENDING,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.pending !== NOTPENDING ? s.pending : s.tValue);else value = value(s.pending !== NOTPENDING ? s.pending : s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && lookup(Owner, SuspenseContext.id);\n if (s) c.suspense = s;\n c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(() => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n }, undefined, false, 0),\n s = SuspenseContext && lookup(Owner, SuspenseContext.id);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.pending = NOTPENDING;\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction createResource(source, fetcher, options) {\n if (arguments.length === 2) {\n if (typeof fetcher === \"object\") {\n options = fetcher;\n fetcher = source;\n source = true;\n }\n } else if (arguments.length === 1) {\n fetcher = source;\n source = true;\n }\n options || (options = {});\n const contexts = new Set(),\n [value, setValue] = createSignal(options.initialValue),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [loading, setLoading] = createSignal(false),\n [error, setError] = createSignal();\n let err = undefined,\n pr = null,\n initP = null,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = (\"initialValue\" in options),\n dynamic = typeof source === \"function\" && createMemo(source);\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n if (sharedConfig.load) initP = sharedConfig.load(id);\n }\n function loadEnd(p, v, e, key) {\n if (pr === p) {\n pr = null;\n resolved = true;\n if (initP && (p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {\n value: v\n }));\n initP = null;\n setError(err = e);\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n if (!Transition.promises.size) {\n Effects.push.apply(Effects, Transition.effects);\n Transition.effects = [];\n }\n completeLoad(v);\n }, false);\n } else completeLoad(v);\n }\n return v;\n }\n function completeLoad(v) {\n batch(() => {\n setValue(() => v);\n setLoading(false);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n });\n }\n function read() {\n const c = SuspenseContext && lookup(Owner, SuspenseContext.id),\n v = value();\n if (err) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition) Transition.promises.add(pr);else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching && scheduled) return;\n scheduled = false;\n setError(err = undefined);\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p = initP || untrack(() => fetcher(lookup, {\n value: value(),\n refetching\n }));\n if (typeof p !== \"object\" || !(\"then\" in p)) {\n loadEnd(pr, p);\n return p;\n }\n pr = p;\n scheduled = true;\n queueMicrotask(() => scheduled = false);\n batch(() => {\n setLoading(true);\n trigger();\n });\n return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, e, e));\n }\n Object.defineProperties(read, {\n loading: {\n get() {\n return loading();\n }\n },\n error: {\n get() {\n return error();\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n if (err) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));else load(false);\n return [read, {\n refetch: load,\n mutate: setValue\n }];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(() => {\n if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {\n timeout\n } : undefined);\n return source();\n }, undefined, true);\n const [deferred, setDeferred] = createSignal(node.value, options);\n updateComputation(node);\n setDeferred(() => node.value);\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(p => {\n const v = source();\n for (const key of subs.keys()) if (fn(key, v) !== fn(key, p)) {\n const l = subs.get(key);\n for (const c of l.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);else Effects.push(c);\n }\n }\n return v;\n }, undefined, true, STALE);\n updateComputation(node);\n return key => {\n let listener;\n if (listener = Listener) {\n let l;\n if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n };\n}\nfunction batch(fn) {\n if (Pending) return fn();\n let result;\n const q = Pending = [];\n try {\n result = fn();\n } finally {\n Pending = null;\n }\n runUpdates(() => {\n for (let i = 0; i < q.length; i += 1) {\n const data = q[i];\n if (data.pending !== NOTPENDING) {\n const pending = data.pending;\n data.pending = NOTPENDING;\n writeSignal(data, pending);\n }\n }\n }, false);\n return result;\n}\nfunction untrack(fn) {\n let result,\n listener = Listener;\n Listener = null;\n result = fn();\n Listener = listener;\n return result;\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return undefined;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null) ;else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);\n return fn;\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null) ;else if (Owner.context === null) Owner.context = {\n [ERROR]: [fn]\n };else if (!Owner.context[ERROR]) Owner.context[ERROR] = [fn];else Owner.context[ERROR].push(fn);\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n Owner = o;\n try {\n return runUpdates(fn, true);\n } finally {\n Owner = prev;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t = Transition || (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => t.resolve = res));\n t.running = true;\n }\n batch(fn);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n let ctx;\n return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n return createMemo(() => resolveChildren(children()));\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext({}));\n}\nfunction enableExternalSource(factory) {\n if (ExternalSourceFactory) {\n const oldFactory = ExternalSourceFactory;\n ExternalSourceFactory = (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n };\n } else {\n ExternalSourceFactory = factory;\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (!runningTransition && this.state || runningTransition && this.tState)) {\n const updates = Updates;\n Updates = null;\n !runningTransition && this.state === STALE || runningTransition && this.tState === STALE ? updateComputation(this) : lookUpstream(this);\n Updates = updates;\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n if (Pending) {\n if (node.pending === NOTPENDING) Pending.push(node);\n node.pending = value;\n return value;\n }\n if (node.comparator) {\n if (Transition && Transition.running && Transition.sources.has(node)) {\n if (node.comparator(node.tValue, value)) return value;\n } else if (node.comparator(node.value, value)) return value;\n }\n let TransitionRunning = false;\n if (Transition) {\n TransitionRunning = Transition.running;\n if (TransitionRunning || !isComp && Transition.sources.has(node)) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {\n if (o.pure) Updates.push(o);else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (TransitionRunning) o.tState = STALE;else o.state = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false) ;\n throw new Error();\n }\n }, false);\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const owner = Owner,\n listener = Listener,\n time = ExecCount;\n Listener = Owner = node;\n runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n runComputation(node, node.tValue, time);\n }, false);\n });\n }\n Listener = listener;\n Owner = owner;\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n handleError(err);\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.observers && node.observers.length) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null) ;else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);\n }\n }\n if (ExternalSourceFactory) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceFactory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if (!runningTransition && node.state === 0 || runningTransition && node.tState === 0) return;\n if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (!runningTransition && node.state || runningTransition && node.tState) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if (!runningTransition && node.state === STALE || runningTransition && node.tState === STALE) {\n updateComputation(node);\n } else if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING) {\n const updates = Updates;\n Updates = null;\n lookUpstream(node, ancestors[0]);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!Updates) Effects = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition && Transition.running) {\n if (Transition.promises.size || Transition.queue.size) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n batch(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n });\n }\n if (Effects.length) batch(() => {\n runEffects(Effects);\n Effects = null;\n });else {\n Effects = null;\n }\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n if (!tasks.size) {\n Effects.push.apply(Effects, Transition.effects);\n Transition.effects = [];\n }\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);else queue[userLength++] = e;\n }\n if (sharedConfig.context) setHydrateContext();\n const resume = queue.length;\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n for (i = resume; i < queue.length; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {\n if (source !== ignore) runTop(source);\n } else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!runningTransition && !o.state || runningTransition && !o.tState) {\n if (runningTransition) o.tState = PENDING;else o.state = PENDING;\n if (o.pure) Updates.push(o);else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = 0; i < node.tOwned.length; i++) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = 0; i < node.owned.length; i++) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = 0; i < node.cleanups.length; i++) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;else node.state = 0;\n node.context = null;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction handleError(err) {\n const fns = ERROR && lookup(Owner, ERROR);\n if (!fns) throw err;\n for (const f of fns) f(err);\n}\nfunction lookup(owner, key) {\n return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id) {\n return function provider(props) {\n let res;\n createComputed(() => res = untrack(() => {\n Owner.context = {\n [id]: props.value\n };\n return children(() => props.children);\n }));\n return res;\n };\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createComputed(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => \"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub());\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n }\n else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return mapped = mapped.slice(0, len);\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return (s = typeof s === \"function\" ? s() : s) == null ? {} : s;\n}\nfunction mergeProps(...sources) {\n return new Proxy({\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n }, propTraps);\n}\nfunction splitProps(props, ...keys) {\n const blocked = new Set(keys.flat());\n const descriptors = Object.getOwnPropertyDescriptors(props);\n const res = keys.map(k => {\n const clone = {};\n for (let i = 0; i < k.length; i++) {\n const key = k[i];\n Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : {\n get() {\n return props[key];\n },\n set() {\n return true;\n }\n });\n }\n return clone;\n });\n res.push(new Proxy({\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n }, propTraps));\n return res;\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n } else {\n const c = comp();\n if (c) return c(props);\n }\n let Comp;\n return createMemo(() => (Comp = comp()) && untrack(() => {\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n }));\n };\n wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback ? fallback : undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback ? fallback : undefined));\n}\nfunction Show(props) {\n let strictEqual = false;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => strictEqual ? a === b : !a === !b\n });\n return createMemo(() => {\n const c = condition();\n if (c) {\n const child = props.children;\n return (strictEqual = typeof child === \"function\" && child.length > 0) ? untrack(() => child(c)) : child;\n }\n return props.fallback;\n });\n}\nfunction Switch(props) {\n let strictEqual = false;\n const conditions = children(() => props.children),\n evalConditions = createMemo(() => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) return [i, c, conds[i]];\n }\n return [-1];\n }, undefined, {\n equals: (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2]\n });\n return createMemo(() => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n return (strictEqual = typeof c === \"function\" && c.length > 0) ? untrack(() => c(when)) : c;\n });\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nconst NoErrors = {};\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn(NoErrors));\n}\nfunction ErrorBoundary(props) {\n let err = NoErrors;\n if (sharedConfig.context && sharedConfig.load) {\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count) || NoErrors;\n }\n const [errored, setErrored] = createSignal(err);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(() => {\n let e;\n if ((e = errored()) !== NoErrors) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored(NoErrors))) : f;\n }\n onError(setErrored);\n return props.children;\n });\n}\n\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let suspenseSetter, showContent, showFallback;\n const listContext = useContext(SuspenseListContext);\n if (listContext) {\n const [inFallback, setFallback] = createSignal(false);\n suspenseSetter = setFallback;\n [showContent, showFallback] = listContext.register(inFallback);\n }\n const [registry, setRegistry] = createSignal([]),\n comp = createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n const [showingContent, showContent] = createSignal(false),\n [showingFallback, showFallback] = createSignal(false);\n setRegistry(registry => [...registry, {\n inFallback,\n showContent,\n showFallback\n }]);\n return [showingContent, showingFallback];\n }\n },\n get children() {\n return props.children;\n }\n });\n createComputed(() => {\n const reveal = props.revealOrder,\n tail = props.tail,\n visibleContent = showContent ? showContent() : true,\n visibleFallback = showFallback ? showFallback() : true,\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(i => !i.inFallback());\n suspenseSetter && suspenseSetter(!all);\n reg.forEach(i => {\n i.showContent(all && visibleContent);\n i.showFallback(visibleFallback);\n });\n return;\n }\n let stop = false;\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n].inFallback();\n if (!stop && !s) {\n reg[n].showContent(visibleContent);\n reg[n].showFallback(visibleFallback);\n } else {\n const next = !stop;\n if (next && suspenseSetter) suspenseSetter(true);\n if (!tail || next && tail === \"collapsed\") {\n reg[n].showFallback(visibleFallback);\n } else reg[n].showFallback(false);\n stop = true;\n reg[n].showContent(next);\n }\n }\n if (!stop && suspenseSetter) suspenseSetter(false);\n });\n return comp;\n}\nfunction Suspense(props) {\n let counter = 0,\n showContent,\n showFallback,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n p = sharedConfig.load(key);\n if (p) {\n if (typeof p !== \"object\" || !(\"then\" in p)) p = Promise.resolve(p);\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(err => {\n if ((error = err) || sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n });\n } else if (p === null) sharedConfig.gather(key);\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) [showContent, showFallback] = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return flicker = undefined;\n }\n if (ctx && p === undefined) setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(() => {\n const inFallback = store.inFallback(),\n visibleContent = showContent ? showContent() : true,\n visibleFallback = showFallback ? showFallback() : true;\n dispose && dispose();\n if ((!inFallback || p !== undefined) && visibleContent) {\n store.resolved = true;\n ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!visibleFallback) return;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nlet DEV;\n\nexport { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };\n","import {getInheritedDescriptor} from 'lowclass'\nimport {createSignal, createEffect, createRoot, untrack, getListener} from 'solid-js'\n\nexport interface VariableGetter {\n\t(): T\n}\n\nexport interface VariableSetter {\n\t(value: T): T\n}\n\n/** Represents a reactive variable. The value is set or gotten depending on passing an arg or no arg. */\nexport interface Variable extends Iterable | VariableSetter> {\n\t/** Gets the variable value. */\n\t(value?: undefined): T\n\t/** Sets the variable value. */\n\t(value: T): T\n\t(value?: T): void | T\n\n\tget: VariableGetter\n\tset: VariableSetter\n\n\t// For array destructuring convenience\n\t[0]: VariableGetter\n\t[1]: VariableSetter\n\t[Symbol.iterator](): IterableIterator | VariableSetter>\n}\n\nfunction readVariable(this: Variable): T {\n\treturn this()\n}\nfunction writeVariable(this: Variable, value: T): T {\n\treturn this(value)\n}\n\n/**\n * Create a reactive variable.\n *\n * @example\n * let count = variable(0) // count starts at 0\n * count(1) // set the value of count to 1\n * count(count() + 1) // add 1\n * let currentValue = count() // read the current value\n * console.log(currentValue) // logs \"2\" to console\n */\n// eslint-disable-next-line typescript/explicit-function-return-type\nexport function variable(value: T) {\n\tconst [get, set] = createSignal(value, {equals: false})\n\n\t// FIXME, read arguments.length instead of detecting undefined values, because currently undefined value trigger a read, which means decoraators built on this treat `this.foo = undefined` as a read instead of a write.\n\tconst variable = ((value?: T) => {\n\t\tif (typeof value === 'undefined') return get()\n\t\tset(() => value)\n\t\treturn value\n\t}) as Variable\n\n\t// WTF TypeScript, why do I need `any` here.\n\tconst getter = readVariable.bind(variable as any) as VariableGetter\n\tconst setter = writeVariable.bind(variable as any) as VariableSetter\n\n\t// For object destructuring convenience.\n\tvariable.get = getter\n\tvariable.set = setter\n\n\t// For array destructuring convenience.\n\tvariable[0] = getter\n\tvariable[1] = setter\n\tvariable[Symbol.iterator] = function* () {\n\t\tyield variable[0]\n\t\tyield variable[1]\n\t}\n\n\treturn variable as [VariableGetter, VariableSetter] & Variable\n}\n\nexport type Computation = (previousValue?: unknown) => unknown\nexport type StopFunction = () => void\n\n/**\n * Automatically run a \"computation\" when any reactive variable used inside the\n * computation has changed. The \"computation\" is a function passed into\n * autorun().\n *\n * @param {Computation} f - A \"computation\" to re-run when any of the reactive\n * variables used inside of it change.\n * @return {StopFunction} - Returns a function that can be called to explicitly\n * stop the computation from running, allowing it to be garbage collected.\n */\n// TODO Option for autorun() to batch updates into a single update in the next microtask.\n// TODO Option for autorun() to skip the first run.\n// TODO Option for autorun() to provide which properties caused the re-run.\nexport function autorun(f: Computation): StopFunction {\n\tlet stop: StopFunction\n\n\tcreateRoot(dispose => {\n\t\tstop = dispose\n\t\tcreateEffect(f)\n\t})\n\n\treturn stop!\n}\n\nexport function reactive(protoOrClassElement: any, propName?: string, _descriptor?: PropertyDescriptor): any {\n\t// If used as a newer Babel decorator\n\tconst isDecoratorV2 = arguments.length === 1 && 'kind' in protoOrClassElement\n\tif (isDecoratorV2) {\n\t\tconst classElement = protoOrClassElement\n\n\t\t// If used as a class decorator.\n\t\tif (classElement.kind === 'class') return {...classElement, finisher: reactiveClassFinisher}\n\n\t\t// If used as a property or accessor decorator (@reactive isn't intended for\n\t\t// methods).\n\t\treturn {\n\t\t\t...classElement,\n\t\t\tfinisher(Class: AnyClassWithReactiveProps) {\n\t\t\t\t_trackReactiveProperty(Class, classElement.key)\n\n\t\t\t\treturn classElement.finisher?.(Class) ?? Class\n\t\t\t},\n\t\t}\n\t}\n\n\t// Used as a v1 legacy decorator.\n\n\t// If used as a class decorator.\n\tif (arguments.length === 1 && typeof protoOrClassElement === 'function') {\n\t\tconst Class = protoOrClassElement\n\t\treturn reactiveClassFinisher(Class)\n\t}\n\n\t// If used as a property or accessor decorator (this isn't intended for\n\t// methods).\n\tconst Class = protoOrClassElement.constructor\n\t_trackReactiveProperty(Class, propName!)\n}\n\nexport function _trackReactiveProperty(Class: AnyClassWithReactiveProps, propName: string) {\n\tif (!Class.reactiveProperties || !Class.hasOwnProperty('reactiveProperties')) Class.reactiveProperties = []\n\tif (!Class.reactiveProperties.includes(propName)) Class.reactiveProperties.push(propName)\n}\n\nfunction reactiveClassFinisher(Class: AnyClassWithReactiveProps) {\n\tif (Class.hasOwnProperty('__isReactive__')) return Class\n\n\treturn class ReactiveDecoratorFinisher extends Class {\n\t\t// This is a flag that other decorators can check, f.e. lume/elements @element decorator.\n\t\tstatic __isReactive__: true = true\n\n\t\tconstructor(...args: any[]) {\n\t\t\tif (getListener()) {\n\t\t\t\treturn untrack(() => {\n\t\t\t\t\tconst self = Reflect.construct(Class, args, new.target) // super()\n\t\t\t\t\treactify(self, Class)\n\t\t\t\t\treturn self\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tsuper(...args)\n\t\t\treactify(this, Class)\n\t\t}\n\t}\n}\n\nfunction _reactive(obj: ObjWithReactifiedProps, propName: PropertyKey): void {\n\tif (typeof propName !== 'string') throw new Error('TODO: support for non-string fields with @reactive decorator')\n\n\tconst vName = 'v_' + propName\n\n\t// XXX If obj already has vName, skip making an accessor? I think perhaps\n\t// not, because a subclass might override a property so it is not reactive,\n\t// and a further subclass might want to make it reactive again in which\n\t// case returning early would cause the subclass subclass's property not to\n\t// be reactive.\n\t// if (obj[vName] !== undefined) return\n\n\tlet descriptor: PropertyDescriptor | undefined = getInheritedDescriptor(obj, propName)\n\n\tlet originalGet: (() => any) | undefined\n\tlet originalSet: ((v: any) => void) | undefined\n\tlet initialValue: unknown\n\n\t// TODO if there is an inherited accessor, we need to ensure we still call\n\t// it so that we're extending instead of overriding. Otherwise placing\n\t// @reactive on a property will break that functionality in those cases.\n\t//\n\t// Right now, originalGet will only be called if it is on the current\n\t// prototype, but we aren't checking for any accessor that may be inherited.\n\n\tif (descriptor) {\n\t\toriginalGet = descriptor.get\n\t\toriginalSet = descriptor.set\n\n\t\tif (originalGet || originalSet) {\n\t\t\t// reactivity requires both\n\t\t\tif (!originalGet || !originalSet) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The `@reactive` decorator was used on an accessor named \"' +\n\t\t\t\t\t\tpropName +\n\t\t\t\t\t\t'\" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. In this case the decorator does not do anything.',\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdelete descriptor.get\n\t\t\tdelete descriptor.set\n\t\t} else {\n\t\t\tinitialValue = descriptor.value\n\n\t\t\t// if it isn't writable, we don't need to make a reactive variable because\n\t\t\t// the value won't change\n\t\t\tif (!descriptor.writable) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The `@reactive` decorator was used on a property named ' +\n\t\t\t\t\t\tpropName +\n\t\t\t\t\t\t' that is not writable. Reactivity is not enabled for non-writable properties.',\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdelete descriptor.value\n\t\t\tdelete descriptor.writable\n\t\t}\n\t}\n\n\tdescriptor = {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\t...descriptor,\n\t\tget: originalGet\n\t\t\t? function (this: any): unknown {\n\t\t\t\t\t// track reactivity, but get the value from the original getter\n\n\t\t\t\t\t// XXX this causes initialValue to be held onto even if the original\n\t\t\t\t\t// prototype value has changed. In pratice the original prototype\n\t\t\t\t\t// values usually never change, and these days people don't normally\n\t\t\t\t\t// use prototype values to begin with.\n\t\t\t\t\tconst v = __getReactiveVar(this, vName, initialValue)\n\t\t\t\t\tv()\n\n\t\t\t\t\treturn originalGet!.call(this)\n\t\t\t }\n\t\t\t: function (this: any): unknown {\n\t\t\t\t\tconst v = __getReactiveVar(this, vName, initialValue)\n\t\t\t\t\treturn v()\n\t\t\t },\n\t\tset: originalSet\n\t\t\t? function (this: any, newValue: unknown) {\n\t\t\t\t\toriginalSet!.call(this, newValue)\n\n\t\t\t\t\tconst v = __getReactiveVar(this, vName)\n\t\t\t\t\tv(newValue)\n\n\t\t\t\t\t// __propsSetAtLeastOnce__ is a Set that tracks which reactive\n\t\t\t\t\t// properties have been set at least once. @lume/element uses this\n\t\t\t\t\t// to detect if a reactive prop has been set, and if so will not\n\t\t\t\t\t// overwrite the value with any value from custom element\n\t\t\t\t\t// pre-upgrade.\n\t\t\t\t\tif (!this.__propsSetAtLeastOnce__) this.__propsSetAtLeastOnce__ = new Set()\n\t\t\t\t\tthis.__propsSetAtLeastOnce__.add(propName)\n\t\t\t }\n\t\t\t: function (this: any, newValue: unknown) {\n\t\t\t\t\tconst v = __getReactiveVar(this, vName)\n\t\t\t\t\tv(newValue)\n\n\t\t\t\t\tif (!this.__propsSetAtLeastOnce__) this.__propsSetAtLeastOnce__ = new Set()\n\t\t\t\t\tthis.__propsSetAtLeastOnce__.add(propName)\n\t\t\t },\n\t}\n\n\tif (!obj.__reactifiedProps__) obj.__reactifiedProps__ = new Set()\n\tobj.__reactifiedProps__.add(propName)\n\n\tObject.defineProperty(obj, propName, descriptor)\n}\n\nfunction __getReactiveVar(instance: Obj>, vName: string, initialValue: T = undefined!): Variable {\n\t// NOTE alternatively, we could use a WeakMap instead of exposing the\n\t// variable on the instance. We could also use Symbols keys for\n\t// semi-privacy.\n\tlet v: Variable = instance[vName]\n\n\tif (v) return v\n\n\tinstance[vName] = v = variable(initialValue)\n\n\treturn v\n}\n\ntype AnyClass = new (...args: any[]) => object\ntype AnyClassWithReactiveProps = (new (...args: any[]) => object) & {\n\treactiveProperties?: string[]\n\t__isReactive__?: true\n}\n\n// Define (or unshadow) reactive accessors on obj, which is generally `this`\n// inside of a constructor (this is what the documentation prescribes).\nexport function reactify(obj: T, props: (keyof T)[]): typeof obj\nexport function reactify(obj: InstanceType, ctor: C): typeof obj\nexport function reactify(obj: Obj, propsOrClass: PropertyKey[] | AnyClassWithReactiveProps) {\n\tif (isClass(propsOrClass)) {\n\t\tconst Class = propsOrClass\n\n\t\t// let props = classReactiveProps.get(Class)\n\t\t// if (props) unshadowReactiveAccessors(obj, props)\n\t\t// props = Class.reactiveProperties\n\n\t\tconst props = Class.reactiveProperties\n\t\tif (Array.isArray(props)) createReactiveAccessors(obj, props)\n\t} else {\n\t\tconst props = propsOrClass\n\t\tcreateReactiveAccessors(obj, props)\n\t}\n\n\treturn obj\n}\n\nfunction isClass(obj: unknown): obj is AnyClass {\n\treturn typeof obj == 'function'\n}\n\n// Defines a reactive accessor on obj.\nfunction createReactiveAccessors(obj: ObjWithReactifiedProps, props: PropertyKey[]) {\n\tfor (const prop of props) {\n\t\tif (obj.__reactifiedProps__?.has(prop)) continue\n\n\t\tconst initialValue = obj[prop]\n\t\t_reactive(obj, prop)\n\t\tobj[prop] = initialValue\n\t}\n}\n\ntype Obj = Record & {constructor: AnyClass}\ntype ObjWithReactifiedProps = Obj & {__reactifiedProps__?: Set}\n\n/**\n * Allow two reactive variables to depend on each other's values, without\n * causing an infinite loop.\n */\nexport function circular(\n\tfirst: VariableGetter,\n\tsetFirst: (v: Type) => void,\n\tsecond: VariableGetter,\n\tsetSecond: (v: Type) => void,\n): StopFunction {\n\tlet initial = true\n\n\tconst stop1 = autorun(() => {\n\t\tconst v = first()\n\t\tif (initial && !(initial = false)) setSecond(v)\n\t\telse initial = true\n\t})\n\n\tconst stop2 = autorun(() => {\n\t\tconst v = second()\n\t\tif (initial && !(initial = false)) setFirst(v)\n\t\telse initial = true\n\t})\n\n\treturn function stop() {\n\t\tstop1()\n\t\tstop2()\n\t}\n}\n\nexport const version = '0.9.0'\n"],"names":["supportsSpread","isSyntaxSupported","supportsClass","supportsNewTarget","TRUE_CONSTRUCTOR","Symbol","setPrototype","Object","setPrototypeOf","object","newPrototype","__proto__","construct","Reflect","Function","instantiator","constructor","args","target","arguments","length","TypeError","prototype","instance","value","apply","SKIP_PROPERTIES","copyProperties","source","destination","getOwnPropertyNames","defineProperty","properties","getOwnPropertySymbols","concat","i","indexOf","getOwnPropertyDescriptor","property","newless","name","usesClassSyntax","toString","substr","requiresNew","newlessConstructor","this","returnValue","error","test","message","Error","create","Node","console","newTarget","hasNewTarget","eval","code","getFunctionBody","setDescriptor","example","useStrict","WeakTwoWayMap","m","WeakMap","set","a","b","get","item","has","fn","split","shift","pop","join","descriptorDefaults","enumerable","configurable","obj","key","newDescriptor","inherited","overrideDescriptor","getInheritedDescriptor","setDescriptors","newDescriptors","currentDescriptor","currentDescriptors","getOwnPropertyDescriptors","defineProperties","oldDescriptor","writable","propertyIsAccessor","descriptor","result","currentProto","owner","getInheritedPropertyNames","keys","Array","from","Set","hasPrototype","proto","copyDescriptors","mod","props","prop","setDefaultPrototypeDescriptors","defaultClassDescriptor","descriptors","setDefaultStaticDescriptors","Ctor","staticBlacklist","includes","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","o","hasOwnProperty","call","r","toStringTag","publicProtoToProtectedProto","publicProtoToPrivateProto","publicToProtected","privateInstanceToClassScope","brandToPublicPrototypes","brandToProtectedPrototypes","brandToPrivatePrototypes","brandToPublicsPrivates","defaultOptions","mode","nativeNaming","prototypeWritable","setClassDescriptors","InvalidSuperAccessError","InvalidAccessError","getPublicMembers","scope","cachedPublicAccesses","isPrivateInstance","getSubclassScope","publicToPrivate","isProtectedInstance","getProtectedMembers","cachedProtectedAccesses","isPublicInstance","createProtectedInstance","publicInstance","privateInstance","protectedPrototype","findLeafmostProtectedPrototype","protectedInstance","getPrivateMembers","cachedPrivateAccesses","createPrivateInstance","privatePrototype","brandedCheck","publicPrototype","classBrand","superHelper","supers","parentPublicPrototype","parentProtectedPrototype","parentPrivatePrototype","getSuperHelperObject","parentPrototype","_super","getter","bind","setter","ImplementationMethod","options","Class","usingStaticSubclassMethod","definer","createClass","extends","ParentClass","def","brand","className","scopedPublicsToPrivates","Super","Public","Protected","Private","staticMembers","customClass","static","public","protected","private","parentProtectedProto","currentPublicProto","getParentProtectedPrototype","parentPrivateProto","getParentPrivatePrototype","add","userConstructor","NewClass","ret","createClassHelper","PROXIES_ON_INSTANCE_AND_PROTOTYPE","sharedConfig","signalOptions","equals","ERROR","runEffects","runQueue","NOTPENDING","STALE","PENDING","UNOWNED","owned","cleanups","context","transPending","setTransPending","createSignal","Owner","SuspenseContext","Transition","Scheduler","ExternalSourceFactory","Listener","Pending","Updates","Effects","ExecCount","assign","s","observers","observerSlots","pending","comparator","readSignal","running","sources","tValue","writeSignal","createMemo","c","createComputation","tState","push","updateComputation","batch","q","runUpdates","data","untrack","listener","children","resolveChildren","runningTransition","state","updates","lookUpstream","sSlot","sourceSlots","node","isComp","TransitionRunning","disposed","pure","markDownstream","cleanNode","time","runComputation","queueMicrotask","nextValue","err","handleError","updatedAt","init","tOwned","track","trigger","ordinary","onCleanup","dispose","triggerInTransition","done","l","Promise","resolve","then","t","effects","promises","queue","res","startTransition","inTransition","x","runTop","suspense","inFallback","ancestors","top","prev","wait","tasks","delete","size","scheduleQueue","e","v","len","completeUpdates","runUserEffects","userLength","user","resume","ignore","index","obs","n","fns","lookup","f","isArray","results","createProvider","id","createComputed","readVariable","writeVariable","variable","iterator","autorun","stop","detachedOwner","unowned","root","updateFn","createRoot","createEffect","reactive","protoOrClassElement","propName","_descriptor","classElement","kind","finisher","reactiveClassFinisher","_trackReactiveProperty","reactiveProperties","self","reactify","super","__isReactive__","_reactive","vName","originalGet","originalSet","initialValue","warn","__getReactiveVar","newValue","__propsSetAtLeastOnce__","__reactifiedProps__","propsOrClass","isClass","createReactiveAccessors","circular","first","setFirst","second","setSecond","initial","stop1","stop2","defaultValue","createContext"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index abb67ad..afc32af 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -28,6 +28,6 @@ declare type AnyClassWithReactiveProps = (new (...args: any[]) => object) & { export declare function reactify(obj: T, props: (keyof T)[]): typeof obj; export declare function reactify(obj: InstanceType, ctor: C): typeof obj; export declare function circular(first: VariableGetter, setFirst: (v: Type) => void, second: VariableGetter, setSecond: (v: Type) => void): StopFunction; -export declare const version = "0.8.0"; +export declare const version = "0.9.0"; export {}; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 41638de..4c462b6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -205,5 +205,5 @@ export function circular(first, setFirst, second, setSecond) { stop2(); }; } -export const version = '0.8.0'; +export const version = '0.9.0'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index 507465c..dfbc4ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lume/variable", - "version": "0.8.0", + "version": "0.9.0", "description": "Create reactive variables and react their changes.", "author": "Joe Pea ", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index d64c517..f3e7b97 100644 --- a/src/index.ts +++ b/src/index.ts @@ -363,4 +363,4 @@ export function circular( } } -export const version = '0.8.0' +export const version = '0.9.0'