devextreme-dist
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
1,349 lines (1,281 loc) • 15.9 MB
JavaScript
/*!
* DevExtreme (dx.all.debug.js)
* Version: 26.1.3
* Build date: Wed Jun 10 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
"use strict";
(() => {
var __webpack_modules__ = {
75299(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
Computed: () => p,
Effect: () => E,
Signal: () => l,
action: () => C,
batch: () => n,
computed: () => g,
createModel: () => T,
effect: () => j,
signal: () => y,
untracked: () => o
});
var i = Symbol.for("preact-signals");
function t() {
if (!(s > 1)) {
var i, t = !1;
! function() {
var i = c;
c = void 0;
while (void 0 !== i) {
if (i.S.v === i.v) {
i.S.i = i.i
}
i = i.o
}
}();
while (void 0 !== h) {
var n = h;
h = void 0;
v++;
while (void 0 !== n) {
var r = n.u;
n.u = void 0;
n.f &= -3;
if (!(8 & n.f) && w(n)) {
try {
n.c()
} catch (n) {
if (!t) {
i = n;
t = !0
}
}
}
n = r
}
}
v = 0;
s--;
if (t) {
throw i
}
} else {
s--
}
}
function n(i) {
if (s > 0) {
return i()
}
e = ++u;
s++;
try {
return i()
} finally {
t()
}
}
var r = void 0;
function o(i) {
var t = r;
r = void 0;
try {
return i()
} finally {
r = t
}
}
var f, h = void 0,
s = 0,
v = 0,
u = 0,
e = 0,
c = void 0,
d = 0;
function a(i) {
if (void 0 !== r) {
var t = i.n;
if (void 0 === t || t.t !== r) {
t = {
i: 0,
S: i,
p: r.s,
n: void 0,
t: r,
e: void 0,
x: void 0,
r: t
};
if (void 0 !== r.s) {
r.s.n = t
}
r.s = t;
i.n = t;
if (32 & r.f) {
i.S(t)
}
return t
} else if (-1 === t.i) {
t.i = 0;
if (void 0 !== t.n) {
t.n.p = t.p;
if (void 0 !== t.p) {
t.p.n = t.n
}
t.p = r.s;
t.n = void 0;
r.s.n = t;
r.s = t
}
return t
}
}
}
function l(i, t) {
this.v = i;
this.i = 0;
this.n = void 0;
this.t = void 0;
this.l = 0;
this.W = null == t ? void 0 : t.watched;
this.Z = null == t ? void 0 : t.unwatched;
this.name = null == t ? void 0 : t.name
}
l.prototype.brand = i;
l.prototype.h = function() {
return !0
};
l.prototype.S = function(i) {
var t = this,
n = this.t;
if (n !== i && void 0 === i.e) {
i.x = n;
this.t = i;
if (void 0 !== n) {
n.e = i
} else {
o(function() {
var i;
null == (i = t.W) || i.call(t)
})
}
}
};
l.prototype.U = function(i) {
var t = this;
if (void 0 !== this.t) {
var n = i.e,
r = i.x;
if (void 0 !== n) {
n.x = r;
i.e = void 0
}
if (void 0 !== r) {
r.e = n;
i.x = void 0
}
if (i === this.t) {
this.t = r;
if (void 0 === r) {
o(function() {
var i;
null == (i = t.Z) || i.call(t)
})
}
}
}
};
l.prototype.subscribe = function(i) {
var t = this;
return j(function() {
var n = t.value,
o = r;
r = void 0;
try {
i(n)
} finally {
r = o
}
}, {
name: "sub"
})
};
l.prototype.valueOf = function() {
return this.value
};
l.prototype.toString = function() {
return this.value + ""
};
l.prototype.toJSON = function() {
return this.value
};
l.prototype.peek = function() {
var i = r;
r = void 0;
try {
return this.value
} finally {
r = i
}
};
Object.defineProperty(l.prototype, "value", {
get: function() {
var i = a(this);
if (void 0 !== i) {
i.i = this.i
}
return this.v
},
set: function(i) {
if (i !== this.v) {
if (v > 100) {
throw new Error("Cycle detected")
}! function(i) {
if (0 !== s && 0 === v) {
if (i.l !== e) {
i.l = e;
c = {
S: i,
v: i.v,
i: i.i,
o: c
}
}
}
}(this);
this.v = i;
this.i++;
d++;
s++;
try {
for (var n = this.t; void 0 !== n; n = n.x) {
n.t.N()
}
} finally {
t()
}
}
}
});
function y(i, t) {
return new l(i, t)
}
function w(i) {
for (var t = i.s; void 0 !== t; t = t.n) {
if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) {
return !0
}
}
return !1
}
function _(i) {
for (var t = i.s; void 0 !== t; t = t.n) {
var n = t.S.n;
if (void 0 !== n) {
t.r = n
}
t.S.n = t;
t.i = -1;
if (void 0 === t.n) {
i.s = t;
break
}
}
}
function b(i) {
var t = i.s,
n = void 0;
while (void 0 !== t) {
var r = t.p;
if (-1 === t.i) {
t.S.U(t);
if (void 0 !== r) {
r.n = t.n
}
if (void 0 !== t.n) {
t.n.p = r
}
} else {
n = t
}
t.S.n = t.r;
if (void 0 !== t.r) {
t.r = void 0
}
t = r
}
i.s = n
}
function p(i, t) {
l.call(this, void 0);
this.x = i;
this.s = void 0;
this.g = d - 1;
this.f = 4;
this.W = null == t ? void 0 : t.watched;
this.Z = null == t ? void 0 : t.unwatched;
this.name = null == t ? void 0 : t.name
}
p.prototype = new l;
p.prototype.h = function() {
this.f &= -3;
if (1 & this.f) {
return !1
}
if (32 == (36 & this.f)) {
return !0
}
this.f &= -5;
if (this.g === d) {
return !0
}
this.g = d;
this.f |= 1;
if (this.i > 0 && !w(this)) {
this.f &= -2;
return !0
}
var i = r;
try {
_(this);
r = this;
var t = this.x();
if (16 & this.f || this.v !== t || 0 === this.i) {
this.v = t;
this.f &= -17;
this.i++
}
} catch (i) {
this.v = i;
this.f |= 16;
this.i++
}
r = i;
b(this);
this.f &= -2;
return !0
};
p.prototype.S = function(i) {
if (void 0 === this.t) {
this.f |= 36;
for (var t = this.s; void 0 !== t; t = t.n) {
t.S.S(t)
}
}
l.prototype.S.call(this, i)
};
p.prototype.U = function(i) {
if (void 0 !== this.t) {
l.prototype.U.call(this, i);
if (void 0 === this.t) {
this.f &= -33;
for (var t = this.s; void 0 !== t; t = t.n) {
t.S.U(t)
}
}
}
};
p.prototype.N = function() {
if (!(2 & this.f)) {
this.f |= 6;
for (var i = this.t; void 0 !== i; i = i.x) {
i.t.N()
}
}
};
Object.defineProperty(p.prototype, "value", {
get: function() {
if (1 & this.f) {
throw new Error("Cycle detected")
}
var i = a(this);
this.h();
if (void 0 !== i) {
i.i = this.i
}
if (16 & this.f) {
throw this.v
}
return this.v
}
});
function g(i, t) {
return new p(i, t)
}
function S(i) {
var n = i.m;
i.m = void 0;
if ("function" == typeof n) {
s++;
var o = r;
r = void 0;
try {
n()
} catch (t) {
i.f &= -2;
i.f |= 8;
m(i);
throw t
} finally {
r = o;
t()
}
}
}
function m(i) {
for (var t = i.s; void 0 !== t; t = t.n) {
t.S.U(t)
}
i.x = void 0;
i.s = void 0;
S(i)
}
function x(i) {
if (r !== this) {
throw new Error("Out-of-order effect")
}
b(this);
r = i;
this.f &= -2;
if (8 & this.f) {
m(this)
}
t()
}
function E(i, t) {
this.x = i;
this.m = void 0;
this.s = void 0;
this.u = void 0;
this.f = 32;
this.name = null == t ? void 0 : t.name;
if (f) {
f.push(this)
}
}
E.prototype.c = function() {
var i = this.S();
try {
if (8 & this.f) {
return
}
if (void 0 === this.x) {
return
}
var t = this.x();
if ("function" == typeof t) {
this.m = t
}
} finally {
i()
}
};
E.prototype.S = function() {
if (1 & this.f) {
throw new Error("Cycle detected")
}
this.f |= 1;
this.f &= -9;
S(this);
_(this);
s++;
var i = r;
r = this;
return x.bind(this, i)
};
E.prototype.N = function() {
if (!(2 & this.f)) {
this.f |= 2;
this.u = h;
h = this
}
};
E.prototype.d = function() {
this.f |= 8;
if (!(1 & this.f)) {
m(this)
}
};
E.prototype.dispose = function() {
this.d()
};
function j(i, t) {
var n = new E(i, t);
try {
n.c()
} catch (i) {
n.d();
throw i
}
var r = n.d.bind(n);
r[Symbol.dispose] = r;
return r
}
function C(i) {
return function() {
var t = arguments,
r = this;
return n(function() {
return o(function() {
return i.apply(r, [].slice.call(t))
})
})
}
}
var k = function(i) {
for (var t in i) {
var n = i[t];
if ("function" == typeof n) {
i[t] = C(n)
} else if ("object" == typeof n && null !== n && !("brand" in n)) {
k(n)
}
}
};
function T(i) {
return function() {
var t, n, r = function() {
var i = f;
f = [];
return function() {
var t = f;
if (f && i) {
i = i.concat(f)
}
f = i;
return t
}
}();
try {
n = i.apply(void 0, [].slice.call(arguments))
} catch (i) {
f = void 0;
throw i
} finally {
t = r()
}
k(n);
n[Symbol.dispose] = C(function() {
if (t) {
for (var i = 0; i < t.length; i++) {
t[i].dispose()
}
}
t = void 0
});
return n
}
}
},
12887(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
createElement: () => createElement
});
var inferno__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! inferno */ 76231);
function isNullOrUndef(o) {
return void 0 === o || null === o
}
function isUndefined(o) {
return void 0 === o
}
var componentHooks = {
onComponentDidAppear: 1,
onComponentDidMount: 1,
onComponentDidUpdate: 1,
onComponentShouldUpdate: 1,
onComponentWillDisappear: 1,
onComponentWillMount: 1,
onComponentWillUnmount: 1,
onComponentWillUpdate: 1
};
function createElement(type, props, _children) {
var children;
var ref = null;
var key = null;
var className = null;
var flags;
var newProps;
var childLen = arguments.length - 2;
if (1 === childLen) {
children = _children
} else if (childLen > 1) {
children = [];
while (childLen-- > 0) {
children[childLen] = arguments[childLen + 2]
}
}
if (o = type, "string" === typeof o) {
flags = (0, inferno__WEBPACK_IMPORTED_MODULE_0__.getFlagsForElementVnode)(type);
if (!isNullOrUndef(props)) {
newProps = {};
for (var prop in props) {
if ("className" === prop || "class" === prop) {
className = props[prop]
} else if ("key" === prop) {
key = props.key
} else if ("children" === prop && isUndefined(children)) {
children = props.children
} else if ("ref" === prop) {
ref = props.ref
} else {
if ("contenteditable" === prop) {
flags |= 4096
}
newProps[prop] = props[prop]
}
}
}
} else {
flags = 2;
if (!isUndefined(children)) {
if (!props) {
props = {}
}
props.children = children
}
if (!isNullOrUndef(props)) {
newProps = {};
for (var _prop in props) {
if ("key" === _prop) {
key = props.key
} else if ("ref" === _prop) {
ref = props.ref
} else if (1 === componentHooks[_prop]) {
if (!ref) {
ref = {}
}
ref[_prop] = props[_prop]
} else {
newProps[_prop] = props[_prop]
}
}
}
return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createComponentVNode)(flags, type, newProps, key, ref)
}
var o;
if (8192 & flags) {
return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createFragment)(1 === childLen ? [children] : children, 0, key)
}
return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createVNode)(flags, type, className, children, 0, newProps, key, ref)
}
},
76231(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
AnimationQueues: () => AnimationQueues,
Component: () => Component,
EMPTY_OBJ: () => EMPTY_OBJ,
Fragment: () => Fragment,
_CI: () => createClassComponentInstance,
_HI: () => normalizeRoot,
_M: () => mount,
_MCCC: () => mountClassComponentCallbacks,
_ME: () => mountElement,
_MFCC: () => mountFunctionalComponentCallbacks,
_MP: () => mountProps,
_MR: () => mountRef,
_RFC: () => renderFunctionalComponent,
__render: () => __render,
createComponentVNode: () => createComponentVNode,
createFragment: () => createFragment,
createPortal: () => createPortal,
createRef: () => createRef,
createRenderer: () => createRenderer,
createTextVNode: () => createTextVNode,
createVNode: () => createVNode,
directClone: () => directClone,
findDOMFromVNode: () => findDOMFromVNode,
forwardRef: () => forwardRef,
getFlagsForElementVnode: () => getFlagsForElementVnode,
linkEvent: () => linkEvent,
normalizeProps: () => normalizeProps,
options: () => options,
render: () => render,
rerender: () => rerender,
version: () => version
});
var isArray = Array.isArray;
function isStringOrNumber(o) {
var type = typeof o;
return "string" === type || "number" === type
}
function isNullOrUndef(o) {
return void 0 === o || null === o
}
function isInvalid(o) {
return null === o || false === o || true === o || void 0 === o
}
function isFunction(o) {
return "function" === typeof o
}
function isString(o) {
return "string" === typeof o
}
function isNull(o) {
return null === o
}
function isUndefined(o) {
return void 0 === o
}
function combineFrom(first, second) {
var out = {};
if (first) {
for (var key in first) {
out[key] = first[key]
}
}
if (second) {
for (var _key in second) {
out[_key] = second[_key]
}
}
return out
}
function linkEvent(data, event) {
if (isFunction(event)) {
return {
data: data,
event: event
}
}
return null
}
function isLinkEventObject(o) {
return !isNull(o) && "object" === typeof o
}
var EMPTY_OBJ = {};
var Fragment = "$F";
var AnimationQueues = function() {
this.componentDidAppear = [];
this.componentWillDisappear = [];
this.componentWillMove = []
};
function normalizeEventName(name) {
return name.substring(2).toLowerCase()
}
function appendChild(parentDOM, dom) {
parentDOM.appendChild(dom)
}
function insertOrAppend(parentDOM, newNode, nextNode) {
if (isNull(nextNode)) {
appendChild(parentDOM, newNode)
} else {
parentDOM.insertBefore(newNode, nextNode)
}
}
function removeChild(parentDOM, childNode) {
parentDOM.removeChild(childNode)
}
function callAll(arrayFn) {
for (var i = 0; i < arrayFn.length; i++) {
arrayFn[i]()
}
}
function findChildVNode(vNode, startEdge, flags) {
var children = vNode.children;
if (4 & flags) {
return children.$LI
}
if (8192 & flags) {
return 2 === vNode.childFlags ? children : children[startEdge ? 0 : children.length - 1]
}
return children
}
function findDOMFromVNode(vNode, startEdge) {
var flags;
while (vNode) {
flags = vNode.flags;
if (1521 & flags) {
return vNode.dom
}
vNode = findChildVNode(vNode, startEdge, flags)
}
return null
}
function callAllAnimationHooks(animationQueue, callback) {
var animationsLeft = animationQueue.length;
var fn;
while (void 0 !== (fn = animationQueue.pop())) {
fn(function() {
if (--animationsLeft <= 0 && isFunction(callback)) {
callback()
}
})
}
}
function clearVNodeDOM(vNode, parentDOM, deferredRemoval) {
do {
var flags = vNode.flags;
if (1521 & flags) {
if (!deferredRemoval || vNode.dom.parentNode === parentDOM) {
removeChild(parentDOM, vNode.dom)
}
return
}
var children = vNode.children;
if (4 & flags) {
vNode = children.$LI
}
if (8 & flags) {
vNode = children
}
if (8192 & flags) {
if (2 === vNode.childFlags) {
vNode = children
} else {
for (var i = 0, len = children.length; i < len; ++i) {
clearVNodeDOM(children[i], parentDOM, false)
}
return
}
}
} while (vNode)
}
function removeVNodeDOM(vNode, parentDOM, animations) {
if (animations.componentWillDisappear.length > 0) {
callAllAnimationHooks(animations.componentWillDisappear, function(vNode, parentDOM) {
return function() {
clearVNodeDOM(vNode, parentDOM, true)
}
}(vNode, parentDOM))
} else {
clearVNodeDOM(vNode, parentDOM, false)
}
}
function addMoveAnimationHook(animations, parentVNode, refOrInstance, dom, parentDOM, nextNode, flags, props) {
animations.componentWillMove.push({
dom: dom,
fn: function() {
if (4 & flags) {
refOrInstance.componentWillMove(parentVNode, parentDOM, dom)
} else if (8 & flags) {
refOrInstance.onComponentWillMove(parentVNode, parentDOM, dom, props)
}
},
next: nextNode,
parent: parentDOM
})
}
function moveVNodeDOM(parentVNode, vNode, parentDOM, nextNode, animations) {
var refOrInstance;
var instanceProps;
var instanceFlags = vNode.flags;
do {
var flags = vNode.flags;
if (1521 & flags) {
if (!isNullOrUndef(refOrInstance) && (isFunction(refOrInstance.componentWillMove) || isFunction(refOrInstance.onComponentWillMove))) {
addMoveAnimationHook(animations, parentVNode, refOrInstance, vNode.dom, parentDOM, nextNode, instanceFlags, instanceProps)
} else {
insertOrAppend(parentDOM, vNode.dom, nextNode)
}
return
}
var children = vNode.children;
if (4 & flags) {
refOrInstance = vNode.children;
instanceProps = vNode.props;
vNode = children.$LI
} else if (8 & flags) {
refOrInstance = vNode.ref;
instanceProps = vNode.props;
vNode = children
} else if (8192 & flags) {
if (2 === vNode.childFlags) {
vNode = children
} else {
for (var i = 0, len = children.length; i < len; ++i) {
moveVNodeDOM(parentVNode, children[i], parentDOM, nextNode, animations)
}
return
}
}
} while (vNode)
}
function createDerivedState(instance, nextProps, state) {
if (instance.constructor.getDerivedStateFromProps) {
return combineFrom(state, instance.constructor.getDerivedStateFromProps(nextProps, state))
}
return state
}
var renderCheck = {
v: false
};
var options = {
componentComparator: null,
createVNode: null,
renderComplete: null
};
function setTextContent(dom, children) {
dom.textContent = children
}
function isLastValueSameLinkEvent(lastValue, nextValue) {
return isLinkEventObject(lastValue) && lastValue.event === nextValue.event && lastValue.data === nextValue.data
}
function mergeUnsetProperties(to, from) {
for (var propName in from) {
if (isUndefined(to[propName])) {
to[propName] = from[propName]
}
}
return to
}
function safeCall1(method, arg1) {
return !!isFunction(method) && (method(arg1), true)
}
function V(childFlags, children, className, flags, key, props, ref, type) {
this.childFlags = childFlags;
this.children = children;
this.className = className;
this.dom = null;
this.flags = flags;
this.key = void 0 === key ? null : key;
this.props = void 0 === props ? null : props;
this.ref = void 0 === ref ? null : ref;
this.type = type
}
function createVNode(flags, type, className, children, childFlags, props, key, ref) {
var childFlag = void 0 === childFlags ? 1 : childFlags;
var vNode = new V(childFlag, children, className, flags, key, props, ref, type);
if (options.createVNode) {
options.createVNode(vNode)
}
if (0 === childFlag) {
normalizeChildren(vNode, vNode.children)
}
return vNode
}
function createComponentVNode(flags, type, props, key, ref) {
flags = function(flags, type) {
if (12 & flags) {
return flags
}
if (type.prototype && type.prototype.render) {
return 4
}
if (type.render) {
return 32776
}
return 8
}(flags, type);
var vNode = new V(1, null, null, flags, key, function(flags, type, props) {
var defaultProps = (32768 & flags ? type.render : type).defaultProps;
if (isNullOrUndef(defaultProps)) {
return props
}
if (isNullOrUndef(props)) {
return combineFrom(defaultProps, null)
}
return mergeUnsetProperties(props, defaultProps)
}(flags, type, props), function(flags, type, ref) {
if (4 & flags) {
return ref
}
var defaultHooks = (32768 & flags ? type.render : type).defaultHooks;
if (isNullOrUndef(defaultHooks)) {
return ref
}
if (isNullOrUndef(ref)) {
return defaultHooks
}
return mergeUnsetProperties(ref, defaultHooks)
}(flags, type, ref), type);
if (options.createVNode) {
options.createVNode(vNode)
}
return vNode
}
function createTextVNode(text, key) {
return new V(1, isNullOrUndef(text) || true === text || false === text ? "" : text, null, 16, key, null, null, null)
}
function createFragment(children, childFlags, key) {
var fragment = createVNode(8192, 8192, null, children, childFlags, null, key, null);
switch (fragment.childFlags) {
case 1:
fragment.children = createVoidVNode();
fragment.childFlags = 2;
break;
case 16:
fragment.children = [createTextVNode(children)];
fragment.childFlags = 4
}
return fragment
}
function normalizeProps(vNode) {
var props = vNode.props;
if (props) {
var flags = vNode.flags;
if (481 & flags) {
if (void 0 !== props.children && isNullOrUndef(vNode.children)) {
normalizeChildren(vNode, props.children)
}
if (void 0 !== props.className) {
if (isNullOrUndef(vNode.className)) {
vNode.className = props.className || null
}
props.className = void 0
}
}
if (void 0 !== props.key) {
vNode.key = props.key;
props.key = void 0
}
if (void 0 !== props.ref) {
if (8 & flags) {
vNode.ref = combineFrom(vNode.ref, props.ref)
} else {
vNode.ref = props.ref
}
props.ref = void 0
}
}
return vNode
}
function directClone(vNodeToClone) {
var flags = -16385 & vNodeToClone.flags;
var props = vNodeToClone.props;
if (14 & flags) {
if (!isNull(props)) {
var propsToClone = props;
props = {};
for (var key in propsToClone) {
props[key] = propsToClone[key]
}
}
}
if (0 === (8192 & flags)) {
return new V(vNodeToClone.childFlags, vNodeToClone.children, vNodeToClone.className, flags, vNodeToClone.key, props, vNodeToClone.ref, vNodeToClone.type)
}
return function(vNodeToClone) {
var oldChildren = vNodeToClone.children;
var childFlags = vNodeToClone.childFlags;
return createFragment(2 === childFlags ? directClone(oldChildren) : oldChildren.map(directClone), childFlags, vNodeToClone.key)
}(vNodeToClone)
}
function createVoidVNode() {
return createTextVNode("", null)
}
function createPortal(children, container) {
var normalizedRoot = normalizeRoot(children);
return createVNode(1024, 1024, null, normalizedRoot, 0, null, normalizedRoot.key, container)
}
function _normalizeVNodes(nodes, result, index, currentKey) {
for (var len = nodes.length; index < len; index++) {
var n = nodes[index];
if (!isInvalid(n)) {
var newKey = currentKey + "$" + index;
if (isArray(n)) {
_normalizeVNodes(n, result, 0, newKey)
} else {
if (isStringOrNumber(n)) {
n = createTextVNode(n, newKey)
} else {
var oldKey = n.key;
var isPrefixedKey = isString(oldKey) && "$" === oldKey[0];
if (81920 & n.flags || isPrefixedKey) {
n = directClone(n)
}
n.flags |= 65536;
if (!isPrefixedKey) {
if (isNull(oldKey)) {
n.key = newKey
} else {
n.key = currentKey + oldKey
}
} else if (oldKey.substring(0, currentKey.length) !== currentKey) {
n.key = currentKey + oldKey
}
}
result.push(n)
}
}
}
}
function getFlagsForElementVnode(type) {
switch (type) {
case "svg":
return 32;
case "input":
return 64;
case "select":
return 256;
case "textarea":
return 128;
case Fragment:
return 8192;
default:
return 1
}
}
function normalizeChildren(vNode, children) {
var newChildren;
var newChildFlags = 1;
if (isInvalid(children)) {
newChildren = children
} else if (isStringOrNumber(children)) {
newChildFlags = 16;
newChildren = children
} else if (isArray(children)) {
var len = children.length;
for (var i = 0; i < len; ++i) {
var n = children[i];
if (isInvalid(n) || isArray(n)) {
newChildren = newChildren || children.slice(0, i);
_normalizeVNodes(children, newChildren, i, "");
break
} else if (isStringOrNumber(n)) {
newChildren = newChildren || children.slice(0, i);
newChildren.push(createTextVNode(n, "$" + i))
} else {
var key = n.key;
var needsCloning = (81920 & n.flags) > 0;
var isNullKey = isNull(key);
var isPrefixed = isString(key) && "$" === key[0];
if (needsCloning || isNullKey || isPrefixed) {
newChildren = newChildren || children.slice(0, i);
if (needsCloning || isPrefixed) {
n = directClone(n)
}
if (isNullKey || isPrefixed) {
n.key = "$" + i
}
newChildren.push(n)
} else if (newChildren) {
newChildren.push(n)
}
n.flags |= 65536
}
}
newChildren = newChildren || children;
if (0 === newChildren.length) {
newChildFlags = 1
} else {
newChildFlags = 8
}
} else {
newChildren = children;
newChildren.flags |= 65536;
if (81920 & children.flags) {
newChildren = directClone(children)
}
newChildFlags = 2
}
vNode.children = newChildren;
vNode.childFlags = newChildFlags;
return vNode
}
function normalizeRoot(input) {
if (isInvalid(input) || isStringOrNumber(input)) {
return createTextVNode(input, null)
}
if (isArray(input)) {
return createFragment(input, 0, null)
}
return 16384 & input.flags ? directClone(input) : input
}
var xlinkNS = "http://www.w3.org/1999/xlink";
var xmlNS = "http://www.w3.org/XML/1998/namespace";
var namespaces = {
"xlink:actuate": xlinkNS,
"xlink:arcrole": xlinkNS,
"xlink:href": xlinkNS,
"xlink:role": xlinkNS,
"xlink:show": xlinkNS,
"xlink:title": xlinkNS,
"xlink:type": xlinkNS,
"xml:base": xmlNS,
"xml:lang": xmlNS,
"xml:space": xmlNS
};
function getDelegatedEventObject(v) {
return {
onClick: v,
onDblClick: v,
onFocusIn: v,
onFocusOut: v,
onKeyDown: v,
onKeyPress: v,
onKeyUp: v,
onMouseDown: v,
onMouseMove: v,
onMouseUp: v,
onTouchEnd: v,
onTouchMove: v,
onTouchStart: v
}
}
var attachedEventCounts = getDelegatedEventObject(0);
var attachedEvents = getDelegatedEventObject(null);
var syntheticEvents = getDelegatedEventObject(true);
function updateOrAddSyntheticEvent(name, dom) {
var eventsObject = dom.$EV;
if (!eventsObject) {
eventsObject = dom.$EV = getDelegatedEventObject(null)
}
if (!eventsObject[name]) {
if (1 === ++attachedEventCounts[name]) {
attachedEvents[name] = function(name) {
var attachedEvent = "onClick" === name || "onDblClick" === name ? function(name) {
return function(event) {
if (0 !== event.button) {
event.stopPropagation();
return
}
dispatchEvents(event, true, name, extendEventProperties(event))
}
}(name) : function(name) {
return function(event) {
dispatchEvents(event, false, name, extendEventProperties(event))
}
}(name);
document.addEventListener(normalizeEventName(name), attachedEvent);
return attachedEvent
}(name)
}
}
return eventsObject
}
function unmountSyntheticEvent(name, dom) {
var eventsObject = dom.$EV;
if (eventsObject && eventsObject[name]) {
if (0 === --attachedEventCounts[name]) {
document.removeEventListener(normalizeEventName(name), attachedEvents[name]);
attachedEvents[name] = null
}
eventsObject[name] = null
}
}
function dispatchEvents(event, isClick, name, eventData) {
var dom = function(event) {
return isFunction(event.composedPath) ? event.composedPath()[0] : event.target
}(event);
do {
if (isClick && dom.disabled) {
return
}
var eventsObject = dom.$EV;
if (eventsObject) {
var currentEvent = eventsObject[name];
if (currentEvent) {
eventData.dom = dom;
currentEvent.event ? currentEvent.event(currentEvent.data, event) : currentEvent(event);
if (event.cancelBubble) {
return
}
}
}
dom = dom.parentNode
} while (!isNull(dom))
}
function stopPropagation() {
this.cancelBubble = true;
if (!this.immediatePropagationStopped) {
this.stopImmediatePropagation()
}
}
function isDefaultPrevented() {
return this.defaultPrevented