rumious 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -225
- package/dist/index.cjs.min.js +1 -224
- package/dist/index.esm.js +1 -215
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -215
- package/dist/index.js +1 -230
- package/dist/index.min.js +1 -229
- package/package.json +5 -7
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.min.js
CHANGED
@@ -1,229 +1 @@
|
|
1
|
-
var Rumious = (function (exports) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
function _arrayLikeToArray(r, a) {
|
5
|
-
(null == a || a > r.length) && (a = r.length);
|
6
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
7
|
-
return n;
|
8
|
-
}
|
9
|
-
function _arrayWithHoles(r) {
|
10
|
-
if (Array.isArray(r)) return r;
|
11
|
-
}
|
12
|
-
function _assertThisInitialized(e) {
|
13
|
-
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
14
|
-
return e;
|
15
|
-
}
|
16
|
-
function _callSuper(t, o, e) {
|
17
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
18
|
-
}
|
19
|
-
function _classCallCheck(a, n) {
|
20
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
21
|
-
}
|
22
|
-
function _construct(t, e, r) {
|
23
|
-
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
24
|
-
var o = [null];
|
25
|
-
o.push.apply(o, e);
|
26
|
-
var p = new (t.bind.apply(t, o))();
|
27
|
-
return r && _setPrototypeOf(p, r.prototype), p;
|
28
|
-
}
|
29
|
-
function _defineProperties(e, r) {
|
30
|
-
for (var t = 0; t < r.length; t++) {
|
31
|
-
var o = r[t];
|
32
|
-
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
function _createClass(e, r, t) {
|
36
|
-
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
37
|
-
writable: false
|
38
|
-
}), e;
|
39
|
-
}
|
40
|
-
function _defineProperty(e, r, t) {
|
41
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
42
|
-
value: t,
|
43
|
-
enumerable: true,
|
44
|
-
configurable: true,
|
45
|
-
writable: true
|
46
|
-
}) : e[r] = t, e;
|
47
|
-
}
|
48
|
-
function _getPrototypeOf(t) {
|
49
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
50
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
51
|
-
}, _getPrototypeOf(t);
|
52
|
-
}
|
53
|
-
function _inherits(t, e) {
|
54
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
55
|
-
t.prototype = Object.create(e && e.prototype, {
|
56
|
-
constructor: {
|
57
|
-
value: t,
|
58
|
-
writable: true,
|
59
|
-
configurable: true
|
60
|
-
}
|
61
|
-
}), Object.defineProperty(t, "prototype", {
|
62
|
-
writable: false
|
63
|
-
}), e && _setPrototypeOf(t, e);
|
64
|
-
}
|
65
|
-
function _isNativeFunction(t) {
|
66
|
-
try {
|
67
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
68
|
-
} catch (n) {
|
69
|
-
return "function" == typeof t;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
function _isNativeReflectConstruct() {
|
73
|
-
try {
|
74
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
75
|
-
} catch (t) {}
|
76
|
-
return (_isNativeReflectConstruct = function () {
|
77
|
-
return !!t;
|
78
|
-
})();
|
79
|
-
}
|
80
|
-
function _iterableToArrayLimit(r, l) {
|
81
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
82
|
-
if (null != t) {
|
83
|
-
var e,
|
84
|
-
n,
|
85
|
-
i,
|
86
|
-
u,
|
87
|
-
a = [],
|
88
|
-
f = true,
|
89
|
-
o = false;
|
90
|
-
try {
|
91
|
-
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
92
|
-
} catch (r) {
|
93
|
-
o = true, n = r;
|
94
|
-
} finally {
|
95
|
-
try {
|
96
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
97
|
-
} finally {
|
98
|
-
if (o) throw n;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
return a;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
function _nonIterableRest() {
|
105
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
106
|
-
}
|
107
|
-
function ownKeys(e, r) {
|
108
|
-
var t = Object.keys(e);
|
109
|
-
if (Object.getOwnPropertySymbols) {
|
110
|
-
var o = Object.getOwnPropertySymbols(e);
|
111
|
-
r && (o = o.filter(function (r) {
|
112
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
113
|
-
})), t.push.apply(t, o);
|
114
|
-
}
|
115
|
-
return t;
|
116
|
-
}
|
117
|
-
function _objectSpread2(e) {
|
118
|
-
for (var r = 1; r < arguments.length; r++) {
|
119
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
120
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
121
|
-
_defineProperty(e, r, t[r]);
|
122
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
123
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
124
|
-
});
|
125
|
-
}
|
126
|
-
return e;
|
127
|
-
}
|
128
|
-
function _possibleConstructorReturn(t, e) {
|
129
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
130
|
-
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
131
|
-
return _assertThisInitialized(t);
|
132
|
-
}
|
133
|
-
function _setPrototypeOf(t, e) {
|
134
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
135
|
-
return t.__proto__ = e, t;
|
136
|
-
}, _setPrototypeOf(t, e);
|
137
|
-
}
|
138
|
-
function _slicedToArray(r, e) {
|
139
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
140
|
-
}
|
141
|
-
function _toPrimitive(t, r) {
|
142
|
-
if ("object" != typeof t || !t) return t;
|
143
|
-
var e = t[Symbol.toPrimitive];
|
144
|
-
if (undefined !== e) {
|
145
|
-
var i = e.call(t, r || "default");
|
146
|
-
if ("object" != typeof i) return i;
|
147
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
148
|
-
}
|
149
|
-
return ("string" === r ? String : Number)(t);
|
150
|
-
}
|
151
|
-
function _toPropertyKey(t) {
|
152
|
-
var i = _toPrimitive(t, "string");
|
153
|
-
return "symbol" == typeof i ? i : i + "";
|
154
|
-
}
|
155
|
-
function _typeof(o) {
|
156
|
-
"@babel/helpers - typeof";
|
157
|
-
|
158
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
159
|
-
return typeof o;
|
160
|
-
} : function (o) {
|
161
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
162
|
-
}, _typeof(o);
|
163
|
-
}
|
164
|
-
function _unsupportedIterableToArray(r, a) {
|
165
|
-
if (r) {
|
166
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
167
|
-
var t = {}.toString.call(r).slice(8, -1);
|
168
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
|
169
|
-
}
|
170
|
-
}
|
171
|
-
function _wrapNativeSuper(t) {
|
172
|
-
var r = "function" == typeof Map ? new Map() : undefined;
|
173
|
-
return _wrapNativeSuper = function (t) {
|
174
|
-
if (null === t || !_isNativeFunction(t)) return t;
|
175
|
-
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
176
|
-
if (undefined !== r) {
|
177
|
-
if (r.has(t)) return r.get(t);
|
178
|
-
r.set(t, Wrapper);
|
179
|
-
}
|
180
|
-
function Wrapper() {
|
181
|
-
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
182
|
-
}
|
183
|
-
return Wrapper.prototype = Object.create(t.prototype, {
|
184
|
-
constructor: {
|
185
|
-
value: Wrapper,
|
186
|
-
enumerable: false,
|
187
|
-
writable: true,
|
188
|
-
configurable: true
|
189
|
-
}
|
190
|
-
}), _setPrototypeOf(Wrapper, t);
|
191
|
-
}, _wrapNativeSuper(t);
|
192
|
-
}
|
193
|
-
|
194
|
-
var RumiousRenderContext=/*#__PURE__*/_createClass(function RumiousRenderContext(target){_classCallCheck(this,RumiousRenderContext);this.target=target;});
|
195
|
-
|
196
|
-
var RumiousComponent=/*#__PURE__*/function(){function RumiousComponent(){_classCallCheck(this,RumiousComponent);this.element=null;this.props={};this.renderContext=new RumiousRenderContext(this);this.renderer=null;this.wrapped=null;}return _createClass(RumiousComponent,[{key:"prepare",value:function prepare(element,props){var wrapped=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var renderer=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;this.element=element;this.props=props;this.renderer=renderer;this.wrapped=wrapped;}},{key:"template",value:function template(){return {}}},{key:"requestRender",value:function requestRender(){var template=this.template();var fragment=this.renderer(template,document.createDocumentFragment(),this.renderContext);this.element.appendChild(fragment);this.onRender();}},{key:"onCreate",value:function onCreate(){}},{key:"onRender",value:function onRender(){}},{key:"onUpdate",value:function onUpdate(){}},{key:"onDestroy",value:function onDestroy(){}}])}();function isComponent(constructor){return Object.getPrototypeOf(constructor)===RumiousComponent}
|
197
|
-
|
198
|
-
var RumiousElement=/*#__PURE__*/_createClass(function RumiousElement(type,props){var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];_classCallCheck(this,RumiousElement);this.type=type;this.props=props;this.children=children;});var RumiousElementList=/*#__PURE__*/function(){function RumiousElementList(list){_classCallCheck(this,RumiousElementList);this.type="ELEMENT_LIST";this.children=list;}return _createClass(RumiousElementList,[{key:"forEach",value:function forEach(callback){this.children.forEach(callback);}}])}();
|
199
|
-
|
200
|
-
function createElement(type,props){for(var _len=arguments.length,children=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){children[_key-2]=arguments[_key];}if(isComponent(type)){return createComponent(type,props,children)}if(type===createFragment){return createFragment.apply(undefined,children)}return new RumiousElement(type,props||{},normalizeChildren(children))}function createTextElement(text){return new RumiousElement("TEXT_ELEMENT",{nodeValue:text},[])}function createComponent(type,props,children){return new RumiousElement("COMPONENT",_objectSpread2({component:type},props),new RumiousElementList(normalizeChildren(children)))}function createFragment(){for(var _len2=arguments.length,children=new Array(_len2),_key2=0;_key2<_len2;_key2++){children[_key2]=arguments[_key2];}return new RumiousElement("FRAGMENT",{},normalizeChildren(children))}function normalizeChildren(children){return children.map(function(child){return _typeof(child)==="object"?child:createTextElement(child)})}window.RUMIOUS_JSX_SUPPORT={createElement:createElement,createFragment:createFragment};
|
201
|
-
|
202
|
-
function isCamelCase(str){var camelCaseRegex=/^[a-z]+([A-Z][a-z]*)*$/;return camelCaseRegex.test(str)}
|
203
|
-
|
204
|
-
var RumiousComponentElement=/*#__PURE__*/function(_HTMLElement){function RumiousComponentElement(){var _this;_classCallCheck(this,RumiousComponentElement);_this=_callSuper(this,RumiousComponentElement);_this.instance=null;return _this}_inherits(RumiousComponentElement,_HTMLElement);return _createClass(RumiousComponentElement,[{key:"init",value:function init(componentConstructor,props){var wrapped=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var renderer=arguments.length>3?arguments[3]:undefined;this.instance=new componentConstructor;this.instance.prepare(this,props,wrapped,renderer);}},{key:"connectedCallback",value:function connectedCallback(){this.instance.onCreate();this.instance.requestRender();}}])}(/*#__PURE__*/_wrapNativeSuper(HTMLElement));function createComponentElement(){return document.createElement("a-component")}window.customElements.define("a-component",RumiousComponentElement);
|
205
|
-
|
206
|
-
function renderComponent(componentConstructor,props,wrapped,renderer){var componentElement=createComponentElement();componentElement.init(componentConstructor,props,wrapped,renderer);return componentElement}
|
207
|
-
|
208
|
-
function render(element,container){var renderContext=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!element)return container;var dom;if(element.type==="COMPONENT"){dom=renderComponent(element.props.component,element.props,element.children,render);container.appendChild(dom);return container}if(element.type==="FRAGMENT"||element.type==="ELEMENT_LIST"){element.children.forEach(function(child){return render(child,container,renderContext)});return container}if(element.type==="TEXT_ELEMENT"){dom=document.createTextNode(element.props.nodeValue);}else {dom=document.createElement(element.type);}Object.entries(element.props||{}).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),name=_ref2[0],value=_ref2[1];if(name==="ref"){var _renderContext$addRef;(_renderContext$addRef=renderContext.addRef)===null||_renderContext$addRef===undefined||_renderContext$addRef.call(renderContext,value);}else if(name.startsWith("on")&&isCamelCase(name)){dom.addEventListener(name.substring(2).toLowerCase(),value);}else if(dom.nodeType===Node.TEXT_NODE){dom.nodeValue=value;}else {dom.setAttribute(name,value);}});element.children.forEach(function(child){return render(child,dom,renderContext)});container.appendChild(dom);return container}
|
209
|
-
|
210
|
-
var RumiousApp=/*#__PURE__*/function(){function RumiousApp(){var root=arguments.length>0&&arguments[0]!==undefined?arguments[0]:document.createElement("span");var configs=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,RumiousApp);this.root=root;this.configs=configs;this.renderContext=new RumiousRenderContext(this);}return _createClass(RumiousApp,[{key:"render",value:function render$1(element){render(element,this.root,this.renderContext);}}])}();
|
211
|
-
|
212
|
-
var RumiousReactor=/*#__PURE__*/function(){function RumiousReactor(){var target=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var bindings=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,RumiousReactor);this.target=target;this.bindings=bindings;}return _createClass(RumiousReactor,[{key:"react",value:function react(){this.bindings.forEach(function(callback){return callback()});}},{key:"addBinding",value:function addBinding(fn){this.bindings.push(fn);}}])}();
|
213
|
-
|
214
|
-
var RumiousState=/*#__PURE__*/function(){function RumiousState(target){var reactor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,RumiousState);this.target=target;this.reactor=reactor!==null&&reactor!==undefined?reactor:new RumiousReactor(this,[]);if(target&&_typeof(target)==="object"){this.wrapProxy(target);}else {this._value=target;}}return _createClass(RumiousState,[{key:"wrapProxy",value:function wrapProxy(target){var _this=this;this._value=new Proxy(target,{get:function get(target,prop){var value=target[prop];return value&&_typeof(value)==="object"?new RumiousState(value,_this.reactor).value:value},set:function set(target,prop,value){if(value&&_typeof(value)==="object"){value=new RumiousState(value,_this.reactor).proxy;}_this.reactor.react();target[prop]=value;return true}});}},{key:"value",get:function get(){return this._value},set:function set(val){if(val&&_typeof(val)==="object"){this.wrapProxy(val);}else {this._value=val;}this.reactor.react();}}])}();function createState(value){return new RumiousState(value)}
|
215
|
-
|
216
|
-
function watcher(state,callback){state.reactor.addBinding(callback);}
|
217
|
-
|
218
|
-
exports.RumiousApp = RumiousApp;
|
219
|
-
exports.RumiousComponent = RumiousComponent;
|
220
|
-
exports.RumiousComponentElement = RumiousComponentElement;
|
221
|
-
exports.RumiousState = RumiousState;
|
222
|
-
exports.createComponentElement = createComponentElement;
|
223
|
-
exports.createState = createState;
|
224
|
-
exports.isComponent = isComponent;
|
225
|
-
exports.watcher = watcher;
|
226
|
-
|
227
|
-
return exports;
|
228
|
-
|
229
|
-
})({});
|
1
|
+
var Rumious=function(e){"use strict";class t{constructor(e){this.target=e}find(e){return this.target[e]}get(e){return this.target[e]}}class n{constructor(){this.element=null,this.props={},this.renderContext=new t(this),this.renderer=null,this.wrapped=null}prepare(e,t,n={},r=null){this.element=e,this.props=t,this.renderer=r,this.wrapped=n}template(){return{}}requestRender(){let e=this.template(),t=this.renderer(e,document.createDocumentFragment(),this.renderContext);this.element.appendChild(t),this.onRender()}async requestCleanUp(){if(this.element){let e=this.element.cloneNode(!0);for(this.element.replaceWith(e),this.element=e;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}}onInit(){}onCreate(){}onRender(){}onUpdate(){}onDestroy(){}}function r(e){return Object.getPrototypeOf(e)===n}class o{constructor(e,t,n=[]){this.type=e,this.props=t,this.children=n}}class i{constructor(e){this.type="ELEMENT_LIST",this.children=e}forEach(e){this.children.forEach(e)}}function s(e){return"function"==typeof e}class a{constructor(e,t,n){this.type=e,this.name=t,this.value=n}init(){}}class l extends a{async init(e,t){let n=null;const r=e=>{if(!t.find(e))return null;const n=t.get(e);if(!s(n))throw`${e} is not a function!`;return n.bind(t.target)};if("string"===this.value.type)n=r(this.value.value);else if("expression"===this.value.type){if(n=this.value.value,!s(n))throw"Event handler requires a function!"}else"dynamic_value"===this.value.type&&(n=r(this.value.value.objectName));n&&e.addEventListener(this.name,n)}}class c extends a{async init(e,t){if("expression"===this.value.type){let t=this.value.value;if(!t)throw"Invalid props value: Directive bind: require a RumiousState Object !";t.reactor.addBinding((()=>{let n=t.get();this.bindAttr(e,n)})),this.bindAttr(e,t.get())}else if("dynamic_value"===this.value.type){let n=this.value.evaluator?.(t.target),r=t.find(this.value.value.objectName);if(!r)throw"Invalid props value: Directive bind: require a RumiousState Object !";r.reactor.addBinding((()=>{let n=this.value.evaluator?.(t.target);this.bindAttr(e,n)})),this.bindAttr(e,n)}}normalizeValue(e){return"object"==typeof e?e.toString?.()??"":e}async bindAttr(e,t){"html"===this.name&&(e.innerHTML=this.normalizeValue(t))}}class u extends a{async init(e,t){if("expression"===this.value.type){let t=this.value.value;if(!t)throw"Invalid props value: Directive ref: require a RumiousRef Object !";t.set(e)}else if("dynamic_value"===this.value.type){let n=this.value.evaluator?.(t.target);if(!n)throw"Invalid props value: Directive ref: require a RumiousRef Object !";n.set(e)}}}class p extends a{async init(e,t){if("expression"===this.value.type){let t=this.value.value;if(!t)throw"Invalid props value: Directive childsRef: require a RumiousChildRef Object !";t.set(e)}else if("dynamic_value"===this.value.type){let n=this.value.evaluator?.(t.target);if(!n)throw"Invalid props value: Directive childsRef: require a RumiousChildRef Object !";n.set(e)}}}const f={on:(e,t)=>new l("on",e,t),bind:(e,t)=>new c("bind",e,t),ref:(e,t,n="element")=>new u("ref",e,t),childsRef:(e,t)=>new p("childsRef",e,t)};function h(...e){return new o("FRAGMENT",{},d(e))}function d(e){return e.map((e=>"object"==typeof e?e:new o("TEXT_ELEMENT",{nodeValue:e},[])))}window.RUMIOUS_JSX_SUPPORT={createElement:function(e,t,...n){return r(e)?function(e,t,n){return new o("COMPONENT",{component:e,...t},new i(d(n)))}(e,t,n):e===h?h(...n):new o(e,t||{},d(n))},createFragment:h,createDirective:function(e,t,n){return function(e,t,n){return f[e]?.(t,n)}(e,t,n)}};class y extends HTMLElement{constructor(){super(),this.instance=null,this.ref=null}setRef(e){this.ref=e}init(e,t,n={},r){this.instance=new e,this.instance.prepare(this,t,n,r),this.instance.onInit()}connectedCallback(){this.instance.onCreate(),this.instance.requestRender(),this.instance.forwardRef=this.ref??{}}disconnectCallback(){this.instance.onDestroy(),this.instance.requestCleanUp()}}function g(){return document.createElement("a-component")}function v(e,t,n){t.init(e,n)}function m(e,t,n={}){if(!e)return t;let r;return"COMPONENT"===e.type?function(e,t,n,r){const o=function(e,t,n,r){const o=g();return o.init(e,t,n,r),o}(e.props.component,e.props,e.children,n);return Object.entries(e.props||{}).forEach((([e,t])=>{t instanceof a&&v(o,t,r)})),t.appendChild(o),t}(e,t,m,n):"FRAGMENT"===e.type||"ELEMENT_LIST"===e.type?function(e,t,n){return e.children.forEach((e=>m(e,t,n))),t}(e,t,n):(r="TEXT_ELEMENT"===e.type?function(e){return document.createTextNode(e.props.nodeValue)}(e):function(e,t){const n=document.createElement(e.type);return Object.entries(e.props||{}).forEach((([e,r])=>{e.startsWith("on")&&/^[a-zA-Z]+([A-Z][a-z]*)*$/.test(e)?n.addEventListener(e.substring(2).toLowerCase(),r):function(e,t,n,r){e.nodeType===Node.TEXT_NODE?e.nodeValue=n:n instanceof a?v(e,n,r):e.setAttribute(t,n)}(n,e,r,t)})),n}(e,n),e.children.forEach((e=>m(e,r,n))),t.appendChild(r),t)}window.customElements.define("a-component",y);class b{constructor(e=null,t=[]){this.target=e,this.bindings=t}react(){this.bindings.forEach((e=>e()))}addBinding(e){this.bindings.push(e)}}class w{constructor(e,t="",n){this.state=e,this.path=t,this.fn=n}trigger(...e){let t=this.fn(...e);this.state.set(this.path,t)}}const O="remove",M="replace",E="add",j=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),S=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),k=Symbol.iterator,R={mutable:"mutable",immutable:"immutable"},A={};function P(e,t){return e instanceof Map?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function x(e,t){if(t in e){let n=Reflect.getPrototypeOf(e);for(;n;){const e=Reflect.getOwnPropertyDescriptor(n,t);if(e)return e;n=Reflect.getPrototypeOf(n)}}}function C(e){return Object.getPrototypeOf(e)===Set.prototype}function z(e){return Object.getPrototypeOf(e)===Map.prototype}function D(e){var t;return null!==(t=e.copy)&&void 0!==t?t:e.original}function T(e){return!!_(e)}function _(e){return"object"!=typeof e?null:null==e?void 0:e[j]}function I(e){var t;const n=_(e);return n?null!==(t=n.copy)&&void 0!==t?t:n.original:e}function N(e,t){if(!e||"object"!=typeof e)return!1;let n;return Object.getPrototypeOf(e)===Object.prototype||Array.isArray(e)||e instanceof Map||e instanceof Set||!!(null==t?void 0:t.mark)&&((n=t.mark(e,R))===R.immutable||"function"==typeof n)}function F(e,t=[]){if(Object.hasOwnProperty.call(e,"key")){const n=e.parent.copy,r=_(L(n,e.key));if(null!==r&&(null==r?void 0:r.original)!==e.original)return null;const o=3===e.parent.type,i=o?Array.from(e.parent.setMap.keys()).indexOf(e.key):e.key;if(!(o&&n.size>i||P(n,i)))return null;t.push(i)}if(e.parent)return F(e.parent,t);t.reverse();try{!function(e,t){for(let n=0;n<t.length-1;n+=1){const r=t[n];if("object"!=typeof(e=L(3===V(e)?Array.from(e):e,r)))throw new Error(`Cannot resolve patch at '${t.join("/")}'.`)}}(e.copy,t)}catch(e){return null}return t}function V(e){return Array.isArray(e)?1:e instanceof Map?2:e instanceof Set?3:0}function L(e,t){return 2===V(e)?e.get(t):e[t]}function q(e,t,n){2===V(e)?e.set(t,n):e[t]=n}function U(e,t){const n=_(e);return(n?D(n):e)[t]}function $(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function W(e){if(e)for(;e.finalities.revoke.length>0;)e.finalities.revoke.pop()()}function B(e,t){return t?e:[""].concat(e).map((e=>{const t=`${e}`;return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")})).join("/")}const K=Object.prototype.propertyIsEnumerable;function X(e,t){let n;if(Array.isArray(e))return Array.prototype.concat.call(e);if(e instanceof Set)return C(e)?Set.prototype.difference?Set.prototype.difference.call(e,new Set):new Set(e.values()):new(0,Object.getPrototypeOf(e).constructor)(e.values());if(e instanceof Map)return z(e)?new Map(e):new(0,Object.getPrototypeOf(e).constructor)(e);if((null==t?void 0:t.mark)&&(n=t.mark(e,R),void 0!==n)&&n!==R.mutable){if(n===R.immutable)return function(e){const t=Object.create(Object.getPrototypeOf(e));return Reflect.ownKeys(e).forEach((n=>{let r=Reflect.getOwnPropertyDescriptor(e,n);r.enumerable&&r.configurable&&r.writable?t[n]=e[n]:(r.writable||(r.writable=!0,r.configurable=!0),(r.get||r.set)&&(r={configurable:!0,writable:!0,enumerable:r.enumerable,value:e[n]}),Reflect.defineProperty(t,n,r))})),t}(e);if("function"==typeof n){if(t.enablePatches||t.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return n()}throw new Error(`Unsupported mark result: ${n}`)}if("object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype){const t={};return Object.keys(e).forEach((n=>{t[n]=e[n]})),Object.getOwnPropertySymbols(e).forEach((n=>{K.call(e,n)&&(t[n]=e[n])})),t}throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function H(e){e.copy||(e.copy=X(e.original,e.options))}function Y(e){if(!N(e))return I(e);if(Array.isArray(e))return e.map(Y);if(e instanceof Map){const t=Array.from(e.entries()).map((([e,t])=>[e,Y(t)]));return z(e)?new Map(t):new(0,Object.getPrototypeOf(e).constructor)(t)}if(e instanceof Set){const t=Array.from(e).map(Y);return C(e)?new Set(t):new(0,Object.getPrototypeOf(e).constructor)(t)}const t=Object.create(Object.getPrototypeOf(e));for(const n in e)t[n]=Y(e[n]);return t}function G(e){return T(e)?Y(e):e}function Z(e){var t;e.assignedMap=null!==(t=e.assignedMap)&&void 0!==t?t:new Map,e.operated||(e.operated=!0,e.parent&&Z(e.parent))}function J(){throw new Error("Cannot modify frozen object")}function Q(e,t,n,r,o){{n=null!=n?n:new WeakMap,r=null!=r?r:[],o=null!=o?o:[];const i=n.has(e)?n.get(e):e;if(r.length>0){const e=r.indexOf(i);if(i&&"object"==typeof i&&-1!==e){if(r[0]===i)throw new Error("Forbids circular reference");throw new Error(`Forbids circular reference: ~/${o.slice(0,e).map(((e,t)=>{if("symbol"==typeof e)return`[${e.toString()}]`;const n=r[t];return"object"==typeof e&&(n instanceof Map||n instanceof Set)?Array.from(n.keys()).indexOf(e):e})).join("/")}`)}r.push(i),o.push(t)}else r.push(i)}if(Object.isFrozen(e)||T(e))return r.pop(),void o.pop();switch(V(e)){case 2:for(const[t,i]of e)Q(t,t,n,r,o),Q(i,t,n,r,o);e.set=e.clear=e.delete=J;break;case 3:for(const t of e)Q(t,t,n,r,o);e.add=e.clear=e.delete=J;break;case 1:Object.freeze(e);let t=0;for(const i of e)Q(i,t,n,r,o),t+=1;break;default:Object.freeze(e),Object.keys(e).forEach((t=>{Q(e[t],t,n,r,o)}))}r.pop(),o.pop()}function ee(e,t){const n=V(e);if(0===n)Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)}));else if(1===n){let n=0;for(const r of e)t(n,r,e),n+=1}else e.forEach(((n,r)=>t(r,n,e)))}function te(e,t,n){if(T(e)||!N(e,n)||t.has(e)||Object.isFrozen(e))return;const r=e instanceof Set,o=r?new Map:void 0;if(t.add(e),ee(e,((i,s)=>{var a;if(T(s)){const t=_(s);H(t);const n=(null===(a=t.assignedMap)||void 0===a?void 0:a.size)||t.operated?t.copy:t.original;q(r?o:e,i,n)}else te(s,t,n)})),o){const t=e,n=Array.from(t);t.clear(),n.forEach((e=>{t.add(o.has(e)?o.get(e):e)}))}}function ne(e,t){const n=3===e.type?e.setMap:e.copy;e.finalities.revoke.length>1&&e.assignedMap.get(t)&&n&&te(L(n,t),e.finalities.handledSet,e.options)}function re(e){3===e.type&&e.copy&&(e.copy.clear(),e.setMap.forEach((t=>{e.copy.add(I(t))})))}function oe(e,t,n,r){if(e.operated&&e.assignedMap&&e.assignedMap.size>0&&!e.finalized){if(n&&r){const o=F(e);o&&t(e,o,n,r)}e.finalized=!0}}function ie(e,t,n,r){const o=_(n);o&&(o.callbacks||(o.callbacks=[]),o.callbacks.push(((i,s)=>{var a;const l=3===e.type?e.setMap:e.copy;if($(L(l,t),n)){let n=o.original;o.copy&&(n=o.copy),re(e),oe(e,r,i,s),e.options.enableAutoFreeze&&(e.options.updatedValues=null!==(a=e.options.updatedValues)&&void 0!==a?a:new WeakMap,e.options.updatedValues.set(n,o.original)),q(l,t,n)}})),e.options.enableAutoFreeze&&o.finalities!==e.finalities&&(e.options.enableAutoFreeze=!1)),N(n,e.options)&&e.finalities.draft.push((()=>{$(L(3===e.type?e.setMap:e.copy,t),n)&&ne(e,t)}))}function se(e,t,n,r){const{pathAsArray:o=!0}=e.options.enablePatches;switch(e.type){case 0:case 2:return function({original:e,copy:t,assignedMap:n},r,o,i,s){n.forEach(((n,a)=>{const l=L(e,a),c=G(L(t,a)),u=n?P(e,a)?M:E:O;if($(l,c)&&u===M)return;const p=B(r.concat(a),s);o.push(u===O?{op:u,path:p}:{op:u,path:p,value:c}),i.push(u===E?{op:O,path:p}:u===O?{op:E,path:p,value:l}:{op:M,path:p,value:l})}))}(e,t,n,r,o);case 1:return function(e,t,n,r,o){let{original:i,assignedMap:s,options:a}=e,l=e.copy;l.length<i.length&&([i,l]=[l,i],[n,r]=[r,n]);for(let e=0;e<i.length;e+=1)if(s.get(e.toString())&&l[e]!==i[e]){const s=B(t.concat([e]),o);n.push({op:M,path:s,value:G(l[e])}),r.push({op:M,path:s,value:G(i[e])})}for(let e=i.length;e<l.length;e+=1){const r=B(t.concat([e]),o);n.push({op:E,path:r,value:G(l[e])})}if(i.length<l.length){const{arrayLengthAssignment:e=!0}=a.enablePatches;if(e){const e=B(t.concat(["length"]),o);r.push({op:M,path:e,value:i.length})}else for(let e=l.length;i.length<e;e-=1){const n=B(t.concat([e-1]),o);r.push({op:O,path:n})}}}(e,t,n,r,o);case 3:return function({original:e,copy:t},n,r,o,i){let s=0;e.forEach((e=>{if(!t.has(e)){const t=B(n.concat([s]),i);r.push({op:O,path:t,value:e}),o.unshift({op:E,path:t,value:e})}s+=1})),s=0,t.forEach((t=>{if(!e.has(t)){const e=B(n.concat([s]),i);r.push({op:E,path:e,value:t}),o.unshift({op:O,path:e,value:t})}s+=1}))}(e,t,n,r,o)}}const ae=(e,t,n=!1)=>{if("object"==typeof e&&null!==e&&(!N(e,t)||n))throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},le={get size(){return D(_(this)).size},has(e){return D(_(this)).has(e)},set(e,t){const n=_(this),r=D(n);return r.has(e)&&$(r.get(e),t)||(H(n),Z(n),n.assignedMap.set(e,!0),n.copy.set(e,t),ie(n,e,t,se)),this},delete(e){if(!this.has(e))return!1;const t=_(this);return H(t),Z(t),t.original.has(e)?t.assignedMap.set(e,!1):t.assignedMap.delete(e),t.copy.delete(e),!0},clear(){const e=_(this);if(this.size){H(e),Z(e),e.assignedMap=new Map;for(const[t]of e.original)e.assignedMap.set(t,!1);e.copy.clear()}},forEach(e,t){D(_(this)).forEach(((n,r)=>{e.call(t,this.get(r),r,this)}))},get(e){var t,n;const r=_(this),o=D(r).get(e),i=(null===(n=(t=r.options).mark)||void 0===n?void 0:n.call(t,o,R))===R.mutable;if(r.options.strict&&ae(o,r.options,i),i)return o;if(r.finalized||!N(o,r.options))return o;if(o!==r.original.get(e))return o;const s=A.createDraft({original:o,parentDraft:r,key:e,finalities:r.finalities,options:r.options});return H(r),r.copy.set(e,s),s},keys(){return D(_(this)).keys()},values(){const e=this.keys();return{[k]:()=>this.values(),next:()=>{const t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){const e=this.keys();return{[k]:()=>this.entries(),next:()=>{const t=e.next();if(t.done)return t;const n=this.get(t.value);return{done:!1,value:[t.value,n]}}}},[k](){return this.entries()}},ce=Reflect.ownKeys(le),ue=(e,t,{isValuesIterator:n})=>()=>{var r,o;const i=t.next();if(i.done)return i;const s=i.value;let a=e.setMap.get(s);const l=_(a),c=(null===(o=(r=e.options).mark)||void 0===o?void 0:o.call(r,a,R))===R.mutable;if(e.options.strict&&ae(s,e.options,c),c||l||!N(s,e.options)||e.finalized||!e.original.has(s))l&&(a=l.proxy);else{const t=A.createDraft({original:s,parentDraft:e,key:s,finalities:e.finalities,options:e.options});e.setMap.set(s,t),a=t}return{done:!1,value:n?a:[a,a]}},pe={get size(){return _(this).setMap.size},has(e){const t=_(this);if(t.setMap.has(e))return!0;H(t);const n=_(e);return!(!n||!t.setMap.has(n.original))},add(e){const t=_(this);return this.has(e)||(H(t),Z(t),t.assignedMap.set(e,!0),t.setMap.set(e,e),ie(t,e,e,se)),this},delete(e){if(!this.has(e))return!1;const t=_(this);H(t),Z(t);const n=_(e);return n&&t.setMap.has(n.original)?(t.assignedMap.set(n.original,!1),t.setMap.delete(n.original)):(!n&&t.setMap.has(e)?t.assignedMap.set(e,!1):t.assignedMap.delete(e),t.setMap.delete(e))},clear(){if(!this.size)return;const e=_(this);H(e),Z(e);for(const t of e.original)e.assignedMap.set(t,!1);e.setMap.clear()},values(){const e=_(this);H(e);const t=e.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:ue(e,t,{isValuesIterator:!0})}},entries(){const e=_(this);H(e);const t=e.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:ue(e,t,{isValuesIterator:!1})}},keys(){return this.values()},[k](){return this.values()},forEach(e,t){const n=this.values();let r=n.next();for(;!r.done;)e.call(t,r.value,r.value,this),r=n.next()}};Set.prototype.difference&&Object.assign(pe,{intersection(e){return Set.prototype.intersection.call(new Set(this.values()),e)},union(e){return Set.prototype.union.call(new Set(this.values()),e)},difference(e){return Set.prototype.difference.call(new Set(this.values()),e)},symmetricDifference(e){return Set.prototype.symmetricDifference.call(new Set(this.values()),e)},isSubsetOf(e){return Set.prototype.isSubsetOf.call(new Set(this.values()),e)},isSupersetOf(e){return Set.prototype.isSupersetOf.call(new Set(this.values()),e)},isDisjointFrom(e){return Set.prototype.isDisjointFrom.call(new Set(this.values()),e)}});const fe=Reflect.ownKeys(pe),he=new WeakSet,de={get(e,t,n){var r,o;const i=null===(r=e.copy)||void 0===r?void 0:r[t];if(i&&he.has(i))return i;if(t===j)return e;let s;if(e.options.mark){const r="size"===t&&(e.original instanceof Map||e.original instanceof Set)?Reflect.get(e.original,t):Reflect.get(e.original,t,n);if(s=e.options.mark(r,R),s===R.mutable)return e.options.strict&&ae(r,e.options,!0),r}const a=D(e);if(a instanceof Map&&ce.includes(t)){if("size"===t)return Object.getOwnPropertyDescriptor(le,"size").get.call(e.proxy);const n=le[t];if(n)return n.bind(e.proxy)}if(a instanceof Set&&fe.includes(t)){if("size"===t)return Object.getOwnPropertyDescriptor(pe,"size").get.call(e.proxy);const n=pe[t];if(n)return n.bind(e.proxy)}if(!P(a,t)){const n=x(a,t);return n?"value"in n?n.value:null===(o=n.get)||void 0===o?void 0:o.call(e.proxy):void 0}const l=a[t];if(e.options.strict&&ae(l,e.options),e.finalized||!N(l,e.options))return l;if(l===U(e.original,t)){if(H(e),e.copy[t]=ye({original:e.original[t],parentDraft:e,key:1===e.type?Number(t):t,finalities:e.finalities,options:e.options}),"function"==typeof s){const n=_(e.copy[t]);return H(n),Z(n),n.copy}return e.copy[t]}return l},set(e,t,n){var r;if(3===e.type||2===e.type)throw new Error("Map/Set draft does not support any property assignment.");let o;if(1===e.type&&"length"!==t&&(!(Number.isInteger(o=Number(t))&&o>=0)||0!==t&&0!==o&&String(o)!==String(t)))throw new Error("Only supports setting array indices and the 'length' property.");const i=x(D(e),t);if(null==i?void 0:i.set)return i.set.call(e.proxy,n),!0;const s=U(D(e),t),a=_(s);return a&&$(a.original,n)?(e.copy[t]=n,e.assignedMap=null!==(r=e.assignedMap)&&void 0!==r?r:new Map,e.assignedMap.set(t,!1),!0):($(n,s)&&(void 0!==n||P(e.original,t))||(H(e),Z(e),P(e.original,t)&&$(n,e.original[t])?e.assignedMap.delete(t):e.assignedMap.set(t,!0),e.copy[t]=n,ie(e,t,n,se)),!0)},has:(e,t)=>t in D(e),ownKeys:e=>Reflect.ownKeys(D(e)),getOwnPropertyDescriptor(e,t){const n=D(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},getPrototypeOf:e=>Reflect.getPrototypeOf(e.original),setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(e,t){var n;return 1===e.type?de.set.call(this,e,t,void 0,e.proxy):(void 0!==U(e.original,t)||t in e.original?(H(e),Z(e),e.assignedMap.set(t,!1)):(e.assignedMap=null!==(n=e.assignedMap)&&void 0!==n?n:new Map,e.assignedMap.delete(t)),e.copy&&delete e.copy[t],!0)}};function ye(e){const{original:t,parentDraft:n,key:r,finalities:o,options:i}=e,s=V(t),a={type:s,finalized:!1,parent:n,original:t,copy:null,proxy:null,finalities:o,options:i,setMap:3===s?new Map(t.entries()):void 0};(r||"key"in e)&&(a.key=r);const{proxy:l,revoke:c}=Proxy.revocable(1===s?Object.assign([],a):a,de);if(o.revoke.push(c),he.add(l),a.proxy=l,n){const e=n;e.finalities.draft.push(((t,n)=>{var o,i;const s=_(l);let a=3===e.type?e.setMap:e.copy;const c=L(a,r),u=_(c);if(u){let i=u.original;u.operated&&(i=I(c)),re(u),oe(u,se,t,n),e.options.enableAutoFreeze&&(e.options.updatedValues=null!==(o=e.options.updatedValues)&&void 0!==o?o:new WeakMap,e.options.updatedValues.set(i,u.original)),q(a,r,i)}null===(i=s.callbacks)||void 0===i||i.forEach((e=>{e(t,n)}))}))}else{const e=_(l);e.finalities.draft.push(((t,n)=>{re(e),oe(e,se,t,n)}))}return l}function ge(e,t,n,r,o){var i;const s=_(e),a=null!==(i=null==s?void 0:s.original)&&void 0!==i?i:e,l=!!t.length;if(null==s?void 0:s.operated)for(;s.finalities.draft.length>0;)s.finalities.draft.pop()(n,r);const c=l?t[0]:s?s.operated?s.copy:s.original:e;return s&&W(s),o&&Q(c,c,null==s?void 0:s.options.updatedValues),[c,n&&l?[{op:M,path:[],value:t[0]}]:n,r&&l?[{op:M,path:[],value:a}]:r]}function ve(e){const{rootDraft:t,value:n,useRawReturn:r=!1,isRoot:o=!0}=e;ee(n,((n,r,o)=>{const i=_(r);if(i&&t&&i.finalities===t.finalities){e.isContainDraft=!0;const t=i.original;if(o instanceof Set){const e=Array.from(o);o.clear(),e.forEach((e=>o.add(n===e?t:e)))}else q(o,n,t)}else"object"==typeof r&&null!==r&&(e.value=r,e.isRoot=!1,ve(e))})),o&&e.isContainDraft}function me(e){var t;const n=_(e);if(!N(e,null==n?void 0:n.options))return e;const r=V(e);if(n&&!n.operated)return n.original;let o;function i(){o=2===r?z(e)?new Map(e):new(Object.getPrototypeOf(e).constructor)(e):3===r?Array.from(n.setMap.values()):X(e,null==n?void 0:n.options)}if(n){n.finalized=!0;try{i()}finally{n.finalized=!1}}else o=e;if(ee(o,((t,r)=>{if(n&&$(L(n.original,t),r))return;const s=me(r);s!==r&&(o===e&&i(),q(o,t,s))})),3===r){const e=null!==(t=null==n?void 0:n.original)&&void 0!==t?t:o;return C(e)?new Set(o):new(Object.getPrototypeOf(e).constructor)(o)}return o}function be(e){if(!T(e))throw new Error(`current() is only used for Draft, parameter: ${e}`);return me(e)}A.createDraft=ye;const we=function e(t,n,r){var o,i,s;if("function"==typeof t&&"function"!=typeof n)return function(r,...o){return e(r,(e=>t.call(this,e,...o)),n)};const a=t,l=n;let c=r;if("function"!=typeof n&&(c=n),void 0!==c&&"[object Object]"!==Object.prototype.toString.call(c))throw new Error(`Invalid options: ${c}, 'options' should be an object.`);c=Object.assign(Object.assign({},void 0),c);const u=T(a)?be(a):a,p=Array.isArray(c.mark)?(e,t)=>{for(const n of c.mark){if("function"!=typeof n)throw new Error(`Invalid mark: ${n}, 'mark' should be a function.`);const r=n(e,t);if(r)return r}}:c.mark,f=null!==(o=c.enablePatches)&&void 0!==o&&o,h=null!==(i=c.strict)&&void 0!==i&&i,d={enableAutoFreeze:null!==(s=c.enableAutoFreeze)&&void 0!==s&&s,mark:p,strict:h,enablePatches:f};if(!N(u,d)&&"object"==typeof u&&null!==u)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");const[y,g]=function(e,t){var n;const r={draft:[],revoke:[],handledSet:new WeakSet};let o,i;t.enablePatches&&(o=[],i=[]);const s=(null===(n=t.mark)||void 0===n?void 0:n.call(t,e,R))!==R.mutable&&N(e,t)?ye({original:e,parentDraft:null,finalities:r,options:t}):e;return[s,(e=[])=>{const[n,r,a]=ge(s,e,o,i,t.enableAutoFreeze);return t.enablePatches?[n,r,a]:n}]}(u,d);if("function"!=typeof n){if(!N(u,d))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[y,g]}let v;try{v=l(y)}catch(e){throw W(_(y)),e}const m=e=>{const t=_(y);if(!T(e)){if(void 0!==e&&!$(e,y)&&(null==t?void 0:t.operated))throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");const n=null==e?void 0:e[S];if(n){const r=n[0];return d.strict&&"object"==typeof e&&null!==e&&ve({rootDraft:t,value:e,useRawReturn:!0}),g([r])}if(void 0!==e)return"object"==typeof e&&null!==e&&ve({rootDraft:t,value:e}),g([e])}if(e===y||void 0===e)return g([]);const n=_(e);if(d===n.options){if(n.operated)throw new Error("Cannot return a modified child draft.");return g([be(e)])}return g([e])};return v instanceof Promise?v.then(m,(e=>{throw W(_(y)),e})):m(v)};Object.prototype.constructor.toString();class Oe{constructor(e,t=null){this.value=e,this.reactor=t??new b(this,[])}produce(e){return n=e,void(t=this).set(we(t.get(),n));var t,n}reducer(...e){let t;return t=1===e.length?new w(this,"",e[0]):new w(this,e[0],e[1]),t.trigger.bind(t)}setObjectByPath(e="",t){if(0==e.length)return void(this.value=t);if("string"!=typeof e||!e)throw new Error("Invalid path");let n=e.split("."),r=this.value;for(let e=0;e<n.length-1;e++){let t=n[e];t in r||(r[t]={}),r=r[t]}r[n[n.length-1]]=t}set(...e){if(1===e.length)this.value=e[0];else{let t=e[0],n=e[1];this.setObjectByPath(t,n)}this.reactor.react()}get(){return this.value}}class Me{constructor(e){this.target=e}set html(e){this.target.innerHTML=e}query(e){return this.target.querySelectorAll(e)}set text(e){this.target.textContent=e}on(e,t){this.target.addEventListener(e,t)}off(e,t){this.target.removeEventListener(e,t)}remove(){this.target.remove()}addChild(e){this.target.appendChild(e)}set(e){this.target=e}}class Ee{constructor(e){this.target=e}query(e){return this.target.querySelectorAll(e)}index(e){return Array.from(this.target.children)[e]}list(){return Array.from(this.target.children)}get parent(){return this.target}remove(){this.target.remove()}addChild(e){this.target.appendChild(e)}set(e){this.target=e}}class je{constructor(e){this.target=e}set(e){this.target=e,e.setRef(this)}}return e.RumiousApp=class{constructor(e=document.createElement("span"),n={}){this.root=e,this.configs=n,this.renderContext=new t(this)}render(e){m(e,this.root,this.renderContext)}},e.RumiousChildrensRef=Ee,e.RumiousComponent=n,e.RumiousComponentElement=y,e.RumiousComponentRef=je,e.RumiousElementRef=Me,e.RumiousState=Oe,e.createChildrensRef=function(e){return new Ee(e)},e.createComponentElement=g,e.createComponentRef=function(e){return new je(e)},e.createElementRef=function(e){return new Me(e)},e.createState=function(e){return new Oe(e)},e.isComponent=r,e.isState=function(e){return e instanceof Oe},e.watcher=function(e,t){e.reactor.addBinding(t)},e}({});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "rumious",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.3",
|
4
4
|
"description": "The simple library for build UI",
|
5
5
|
"keywords": [
|
6
6
|
"rumious",
|
@@ -13,17 +13,15 @@
|
|
13
13
|
"module": "dist/index.esm.js",
|
14
14
|
"unpkg": "dist/index.min.js",
|
15
15
|
"scripts": {
|
16
|
-
"build": "rollup -c"
|
17
|
-
"prepublishOnly": "npm run build",
|
18
|
-
"release": "standard-version && git push --follow-tags && npm publish && npm pkg fix"
|
16
|
+
"build": "rollup -c rollup.config.mjs"
|
19
17
|
},
|
20
18
|
"files": [
|
21
19
|
"dist/*",
|
22
20
|
"index.js"
|
23
21
|
],
|
24
|
-
"dependencies": {
|
25
|
-
|
26
|
-
|
22
|
+
"dependencies": {
|
23
|
+
"mutative": "^1.1.0"
|
24
|
+
},
|
27
25
|
"repository": {
|
28
26
|
"type": "git",
|
29
27
|
"url": "git+https://github.com/smtdfc/rumious.git"
|
package/dist/index.cjs.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/render/context.js","../src/component/component.js","../src/dom/element.js","../src/jsx/index.js","../src/utils/checker.js","../src/component/element.js","../src/component/render.js","../src/render/index.js","../src/app/index.js","../src/state/reactive.js","../src/state/state.js","../src/state/watcher.js"],"sourcesContent":["export class RumiousRenderContext{\n constructor(target){\n this.target = target\n }\n \n \n}","import { RumiousRenderContext } from '../render/context.js';\n\nexport class RumiousComponent {\n constructor() {\n this.element = null;\n this.props = {};\n this.renderContext = new RumiousRenderContext(this);\n this.renderer = null;\n this.wrapped= null;\n }\n\n prepare(element, props, wrapped={}, renderer = null) {\n this.element = element;\n this.props = props;\n this.renderer = renderer;\n this.wrapped = wrapped;\n }\n\n template() { return {}; }\n\n requestRender() {\n let template = this.template();\n let fragment = this.renderer(template, document.createDocumentFragment(), this.renderContext);\n this.element.appendChild(fragment);\n this.onRender();\n }\n\n onCreate() {}\n onRender() {}\n onUpdate() {}\n onDestroy() {}\n}\n\nexport function isComponent(constructor) {\n return Object.getPrototypeOf(constructor) === RumiousComponent;\n}","export class RumiousElement {\n constructor(type, props, children = []) {\n this.type = type;\n this.props = props;\n this.children = children;\n }\n}\n\nexport class RumiousElementList{\n constructor(list){\n this.type = \"ELEMENT_LIST\"\n this.children = list\n }\n \n forEach(callback ){\n this.children.forEach(callback)\n }\n}","import { isComponent } from '../component/component.js';\nimport {RumiousElement,RumiousElementList} from '../dom/element.js';\n\n\nfunction createElement(type, props, ...children) {\n if (isComponent(type)) {\n return createComponent(type, props, children);\n }\n\n if (type === createFragment) {\n return createFragment(...children);\n }\n\n return new RumiousElement(type, props || {}, normalizeChildren(children));\n}\n\nfunction createTextElement(text) {\n return new RumiousElement(\"TEXT_ELEMENT\", { nodeValue: text }, []);\n}\n\nfunction createComponent(type, props, children) {\n return new RumiousElement(\"COMPONENT\", { component: type, ...props },new RumiousElementList(normalizeChildren(children)));\n}\n\nfunction createFragment(...children) {\n return new RumiousElement(\"FRAGMENT\", {}, normalizeChildren(children));\n}\n\nfunction normalizeChildren(children) {\n return children.map(child => (typeof child === \"object\" ? child : createTextElement(child)));\n}\n\nwindow.RUMIOUS_JSX_SUPPORT = {\n createElement,\n createFragment,\n};","export function isCamelCase(str) {\n const camelCaseRegex = /^[a-z]+([A-Z][a-z]*)*$/;\n return camelCaseRegex.test(str);\n}","export class RumiousComponentElement extends HTMLElement{\n constructor(){\n super();\n this.instance = null;\n }\n \n init(componentConstructor,props,wrapped={},renderer){\n this.instance = new componentConstructor();\n this.instance.prepare(this,props,wrapped,renderer);\n }\n \n connectedCallback(){\n this.instance.onCreate();\n this.instance.requestRender();\n }\n}\n\nexport function createComponentElement(){\n return document.createElement(\"a-component\");\n}\n\nwindow.customElements.define(\"a-component\",RumiousComponentElement);","import { createComponentElement } from './element.js';\n\nexport function renderComponent(componentConstructor, props, wrapped, renderer) {\n const componentElement = createComponentElement();\n componentElement.init(componentConstructor, props,wrapped, renderer);\n return componentElement;\n}\n","import { isCamelCase } from '../utils/checker.js';\nimport { renderComponent } from '../component/render.js';\nimport { isComponent } from '../component/component.js';\n\nexport function render(element, container, renderContext = {}) {\n if (!element) return container;\n\n let dom;\n\n if (element.type === \"COMPONENT\") {\n dom = renderComponent(element.props.component, element.props, element.children, render);\n container.appendChild(dom);\n return container;\n }\n\n if (element.type === \"FRAGMENT\" || element.type === \"ELEMENT_LIST\") {\n element.children.forEach(child => render(child, container, renderContext));\n return container;\n }\n\n if (element.type === \"TEXT_ELEMENT\") {\n dom = document.createTextNode(element.props.nodeValue);\n } else {\n dom = document.createElement(element.type);\n }\n\n Object.entries(element.props || {}).forEach(([name, value]) => {\n if (name === \"ref\") {\n renderContext.addRef?.(value);\n } else if (name.startsWith(\"on\") && isCamelCase(name)) {\n dom.addEventListener(name.substring(2).toLowerCase(), value);\n } else if (dom.nodeType === Node.TEXT_NODE) {\n dom.nodeValue = value;\n } else {\n dom.setAttribute(name, value);\n }\n });\n\n element.children.forEach(child => render(child, dom, renderContext));\n container.appendChild(dom);\n return container;\n}","import { RumiousRenderContext } from '../render/context.js';\nimport { render } from '../render/index.js';\n\nexport class RumiousApp {\n constructor(root = document.createElement(\"span\"), configs = {}) {\n this.root = root;\n this.configs = configs;\n this.renderContext = new RumiousRenderContext(this);\n }\n\n render(element) {\n render(element, this.root, this.renderContext);\n }\n\n}","export class RumiousReactor {\n constructor(target = null, bindings = []) {\n this.target = target;\n this.bindings = bindings;\n }\n\n react() {\n this.bindings.forEach((callback) => callback());\n }\n\n addBinding(fn) {\n this.bindings.push(fn);\n }\n}","import { RumiousReactor } from './reactive.js';\n\nexport class RumiousState {\n constructor(target, reactor = null) {\n this.target = target;\n this.reactor = reactor ?? new RumiousReactor(this, []);\n if (target && typeof target === 'object') {\n this.wrapProxy(target)\n } else {\n this._value = target;\n }\n }\n\n wrapProxy(target) {\n this._value = new Proxy(target, {\n get: (target, prop) => {\n const value = target[prop];\n return value && typeof value === 'object' ? new RumiousState(value, this.reactor).value : value;\n },\n set: (target, prop, value) => {\n if (value && typeof value === 'object') {\n value = new RumiousState(value, this.reactor).proxy;\n }\n this.reactor.react();\n target[prop] = value;\n return true;\n }\n });\n }\n\n\n set value(val) {\n if (val && typeof val === \"object\") {\n this.wrapProxy(val);\n } else {\n this._value = val;\n }\n this.reactor.react();\n }\n\n get value() {\n return this._value;\n }\n}\n\nexport function createState(value) {\n return new RumiousState(value);\n}","export function watcher(state, callback){\n state.reactor.addBinding(callback);\n}"],"names":["RumiousRenderContext","_createClass","target","_classCallCheck","RumiousComponent","element","props","renderContext","renderer","wrapped","key","value","prepare","arguments","length","undefined","template","requestRender","fragment","document","createDocumentFragment","appendChild","onRender","onCreate","onUpdate","onDestroy","isComponent","constructor","Object","getPrototypeOf","RumiousElement","type","children","RumiousElementList","list","forEach","callback","createElement","_len","Array","_key","createComponent","createFragment","apply","normalizeChildren","createTextElement","text","nodeValue","_objectSpread","component","_len2","_key2","map","child","_typeof","window","RUMIOUS_JSX_SUPPORT","isCamelCase","str","camelCaseRegex","test","RumiousComponentElement","_HTMLElement","_this","_callSuper","instance","_inherits","init","componentConstructor","connectedCallback","_wrapNativeSuper","HTMLElement","createComponentElement","customElements","define","renderComponent","componentElement","render","container","dom","createTextNode","entries","_ref","_ref2","_slicedToArray","name","_renderContext$addRef","addRef","call","startsWith","addEventListener","substring","toLowerCase","nodeType","Node","TEXT_NODE","setAttribute","RumiousApp","root","configs","RumiousReactor","bindings","react","addBinding","fn","push","RumiousState","reactor","wrapProxy","_value","Proxy","get","prop","set","proxy","val","createState","watcher","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,IAAAA,oBAAoB,cAAAC,YAAA,CAC/B,SAAAD,oBAAAA,CAAYE,MAAM,CAAC,CAAAC,eAAA,CAAAH,IAAAA,CAAAA,oBAAA,EACjB,IAAI,CAACE,MAAM,CAAGA,MAAM,CACtB,CAAC,CAAA;;ACDU,IAAAE,gBAAgB,cAAA,UAAA,CAC3B,SAAAA,gBAAAA,EAAc,CAAAD,eAAA,CAAA,IAAA,CAAAC,gBAAA,CAAA,CACZ,IAAI,CAACC,OAAO,CAAG,IAAI,CACnB,IAAI,CAACC,KAAK,CAAG,EAAE,CACf,IAAI,CAACC,aAAa,CAAG,IAAIP,oBAAoB,CAAC,IAAI,CAAC,CACnD,IAAI,CAACQ,QAAQ,CAAG,IAAI,CACpB,IAAI,CAACC,OAAO,CAAE,IAAI,CACpB,CAAC,OAAAR,YAAA,CAAAG,gBAAA,CAAAM,CAAAA,CAAAA,GAAA,CAAAC,SAAAA,CAAAA,KAAA,CAED,SAAAC,OAAOA,CAACP,OAAO,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CAAGrG,KAAK,CACpB,WAAW,CACb,CACF,CAAC,CAAC,CACJ,CAAC,CAAA,CAAA,CAAAD,GAAA,CAAA,OAAA,CAAAqG,GAAA,CAYD,SAAAA,GAAAA,EAAY,CACV,OAAW,IAAA,CAACF,MAAM,CACpB,CAAC,CAAAI,GAAA,CAXD,SAAAA,GAAAA,CAAUE,GAAG,CAAE,CACb,GAAIA,GAAG,EAAI7D,OAAA,CAAO6D,GAAG,CAAK,GAAA,QAAQ,CAAE,CAClC,IAAI,CAACP,SAAS,CAACO,GAAG,CAAC,CACrB,CAAC,KAAM,CACL,IAAI,CAACN,MAAM,CAAGM,GAAG,CACnB,CACA,IAAI,CAACR,OAAO,CAACL,KAAK,EAAE,CACtB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,GAOI,SAASc,WAAWA,CAACzG,KAAK,CAAE,CACjC,WAAW+F,YAAY,CAAC/F,KAAK,CAAC,CAChC;;SC/CgB0G,OAAOA,CAACC,KAAK,CAAElF,QAAQ,CAAC,CACtCkF,KAAK,CAACX,OAAO,CAACJ,UAAU,CAACnE,QAAQ,CAAC,CACpC;;;;;;;;;;;"}
|
package/dist/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/render/context.js","../src/component/component.js","../src/dom/element.js","../src/jsx/index.js","../src/utils/checker.js","../src/component/element.js","../src/component/render.js","../src/render/index.js","../src/app/index.js","../src/state/reactive.js","../src/state/state.js","../src/state/watcher.js"],"sourcesContent":["export class RumiousRenderContext{\n constructor(target){\n this.target = target\n }\n \n \n}","import { RumiousRenderContext } from '../render/context.js';\n\nexport class RumiousComponent {\n constructor() {\n this.element = null;\n this.props = {};\n this.renderContext = new RumiousRenderContext(this);\n this.renderer = null;\n this.wrapped= null;\n }\n\n prepare(element, props, wrapped={}, renderer = null) {\n this.element = element;\n this.props = props;\n this.renderer = renderer;\n this.wrapped = wrapped;\n }\n\n template() { return {}; }\n\n requestRender() {\n let template = this.template();\n let fragment = this.renderer(template, document.createDocumentFragment(), this.renderContext);\n this.element.appendChild(fragment);\n this.onRender();\n }\n\n onCreate() {}\n onRender() {}\n onUpdate() {}\n onDestroy() {}\n}\n\nexport function isComponent(constructor) {\n return Object.getPrototypeOf(constructor) === RumiousComponent;\n}","export class RumiousElement {\n constructor(type, props, children = []) {\n this.type = type;\n this.props = props;\n this.children = children;\n }\n}\n\nexport class RumiousElementList{\n constructor(list){\n this.type = \"ELEMENT_LIST\"\n this.children = list\n }\n \n forEach(callback ){\n this.children.forEach(callback)\n }\n}","import { isComponent } from '../component/component.js';\nimport {RumiousElement,RumiousElementList} from '../dom/element.js';\n\n\nfunction createElement(type, props, ...children) {\n if (isComponent(type)) {\n return createComponent(type, props, children);\n }\n\n if (type === createFragment) {\n return createFragment(...children);\n }\n\n return new RumiousElement(type, props || {}, normalizeChildren(children));\n}\n\nfunction createTextElement(text) {\n return new RumiousElement(\"TEXT_ELEMENT\", { nodeValue: text }, []);\n}\n\nfunction createComponent(type, props, children) {\n return new RumiousElement(\"COMPONENT\", { component: type, ...props },new RumiousElementList(normalizeChildren(children)));\n}\n\nfunction createFragment(...children) {\n return new RumiousElement(\"FRAGMENT\", {}, normalizeChildren(children));\n}\n\nfunction normalizeChildren(children) {\n return children.map(child => (typeof child === \"object\" ? child : createTextElement(child)));\n}\n\nwindow.RUMIOUS_JSX_SUPPORT = {\n createElement,\n createFragment,\n};","export function isCamelCase(str) {\n const camelCaseRegex = /^[a-z]+([A-Z][a-z]*)*$/;\n return camelCaseRegex.test(str);\n}","export class RumiousComponentElement extends HTMLElement{\n constructor(){\n super();\n this.instance = null;\n }\n \n init(componentConstructor,props,wrapped={},renderer){\n this.instance = new componentConstructor();\n this.instance.prepare(this,props,wrapped,renderer);\n }\n \n connectedCallback(){\n this.instance.onCreate();\n this.instance.requestRender();\n }\n}\n\nexport function createComponentElement(){\n return document.createElement(\"a-component\");\n}\n\nwindow.customElements.define(\"a-component\",RumiousComponentElement);","import { createComponentElement } from './element.js';\n\nexport function renderComponent(componentConstructor, props, wrapped, renderer) {\n const componentElement = createComponentElement();\n componentElement.init(componentConstructor, props,wrapped, renderer);\n return componentElement;\n}\n","import { isCamelCase } from '../utils/checker.js';\nimport { renderComponent } from '../component/render.js';\nimport { isComponent } from '../component/component.js';\n\nexport function render(element, container, renderContext = {}) {\n if (!element) return container;\n\n let dom;\n\n if (element.type === \"COMPONENT\") {\n dom = renderComponent(element.props.component, element.props, element.children, render);\n container.appendChild(dom);\n return container;\n }\n\n if (element.type === \"FRAGMENT\" || element.type === \"ELEMENT_LIST\") {\n element.children.forEach(child => render(child, container, renderContext));\n return container;\n }\n\n if (element.type === \"TEXT_ELEMENT\") {\n dom = document.createTextNode(element.props.nodeValue);\n } else {\n dom = document.createElement(element.type);\n }\n\n Object.entries(element.props || {}).forEach(([name, value]) => {\n if (name === \"ref\") {\n renderContext.addRef?.(value);\n } else if (name.startsWith(\"on\") && isCamelCase(name)) {\n dom.addEventListener(name.substring(2).toLowerCase(), value);\n } else if (dom.nodeType === Node.TEXT_NODE) {\n dom.nodeValue = value;\n } else {\n dom.setAttribute(name, value);\n }\n });\n\n element.children.forEach(child => render(child, dom, renderContext));\n container.appendChild(dom);\n return container;\n}","import { RumiousRenderContext } from '../render/context.js';\nimport { render } from '../render/index.js';\n\nexport class RumiousApp {\n constructor(root = document.createElement(\"span\"), configs = {}) {\n this.root = root;\n this.configs = configs;\n this.renderContext = new RumiousRenderContext(this);\n }\n\n render(element) {\n render(element, this.root, this.renderContext);\n }\n\n}","export class RumiousReactor {\n constructor(target = null, bindings = []) {\n this.target = target;\n this.bindings = bindings;\n }\n\n react() {\n this.bindings.forEach((callback) => callback());\n }\n\n addBinding(fn) {\n this.bindings.push(fn);\n }\n}","import { RumiousReactor } from './reactive.js';\n\nexport class RumiousState {\n constructor(target, reactor = null) {\n this.target = target;\n this.reactor = reactor ?? new RumiousReactor(this, []);\n if (target && typeof target === 'object') {\n this.wrapProxy(target)\n } else {\n this._value = target;\n }\n }\n\n wrapProxy(target) {\n this._value = new Proxy(target, {\n get: (target, prop) => {\n const value = target[prop];\n return value && typeof value === 'object' ? new RumiousState(value, this.reactor).value : value;\n },\n set: (target, prop, value) => {\n if (value && typeof value === 'object') {\n value = new RumiousState(value, this.reactor).proxy;\n }\n this.reactor.react();\n target[prop] = value;\n return true;\n }\n });\n }\n\n\n set value(val) {\n if (val && typeof val === \"object\") {\n this.wrapProxy(val);\n } else {\n this._value = val;\n }\n this.reactor.react();\n }\n\n get value() {\n return this._value;\n }\n}\n\nexport function createState(value) {\n return new RumiousState(value);\n}","export function watcher(state, callback){\n state.reactor.addBinding(callback);\n}"],"names":["RumiousRenderContext","_createClass","target","_classCallCheck","RumiousComponent","element","props","renderContext","renderer","wrapped","key","value","prepare","arguments","length","undefined","template","requestRender","fragment","document","createDocumentFragment","appendChild","onRender","onCreate","onUpdate","onDestroy","isComponent","constructor","Object","getPrototypeOf","RumiousElement","type","children","RumiousElementList","list","forEach","callback","createElement","_len","Array","_key","createComponent","createFragment","apply","normalizeChildren","createTextElement","text","nodeValue","_objectSpread","component","_len2","_key2","map","child","_typeof","window","RUMIOUS_JSX_SUPPORT","isCamelCase","str","camelCaseRegex","test","RumiousComponentElement","_HTMLElement","_this","_callSuper","instance","_inherits","init","componentConstructor","connectedCallback","_wrapNativeSuper","HTMLElement","createComponentElement","customElements","define","renderComponent","componentElement","render","container","dom","createTextNode","entries","_ref","_ref2","_slicedToArray","name","_renderContext$addRef","addRef","call","startsWith","addEventListener","substring","toLowerCase","nodeType","Node","TEXT_NODE","setAttribute","RumiousApp","root","configs","RumiousReactor","bindings","react","addBinding","fn","push","RumiousState","reactor","wrapProxy","_value","Proxy","get","prop","set","proxy","val","createState","watcher","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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