@ea-lab/reactive-json 0.7.0 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/TemplateSystem-kQJEKjik.js +3568 -0
- package/dist/assets/VariablesDebug.css +1 -4
- package/dist/assets/reset.css +4 -0
- package/dist/assets/usePagination.css +1 -0
- package/dist/component/action/HashChangeListener.js +29 -7
- package/dist/component/action/MessageListener.js +26 -8
- package/dist/component/action/ReactOnEvent.js +64 -8
- package/dist/component/action/Redirect.js +9 -5
- package/dist/component/action/SetAttributeValue.js +37 -5
- package/dist/component/action/ToggleAttributeValue.js +56 -5
- package/dist/component/action/UnsetAttribute.js +20 -5
- package/dist/component/action/UnsetAttributeValue.js +58 -5
- package/dist/component/action/index.js +19 -15
- package/dist/component/dataMapping/index.js +6 -3
- package/dist/component/dataMapping/simpleMapping.js +93 -2
- package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +110 -13
- package/dist/component/element/debug/index.js +2 -2
- package/dist/component/element/html/FolderSortableTree.js +131 -8
- package/dist/component/element/html/FormatNumeral.js +57 -6
- package/dist/component/element/html/Html.js +1 -1
- package/dist/component/element/html/LabelFromValue.js +25 -6
- package/dist/component/element/html/PreformattedMarkup.js +50 -7
- package/dist/component/element/html/SortableTreeItemCollapseButton.js +10 -5
- package/dist/component/element/html/index.js +12 -10
- package/dist/component/element/index.js +35 -30
- package/dist/component/element/special/Count.js +21 -10
- package/dist/component/element/special/DataFilter.js +75 -6
- package/dist/component/element/special/DelayedActions.js +46 -7
- package/dist/component/element/special/Phantom.js +12 -3
- package/dist/component/element/special/ReactiveJsonBasicComponentWrapper.js +29 -0
- package/dist/component/element/special/ReactiveJsonSubroot.js +4 -3
- package/dist/component/element/special/Switch.js +78 -8
- package/dist/component/element/special/index.js +16 -10
- package/dist/component/hook/index.js +1 -1
- package/dist/component/hook/usePagination.js +172 -4
- package/dist/component/index.js +85 -63
- package/dist/component/reaction/addData.js +23 -3
- package/dist/component/reaction/fetchData.js +12 -2
- package/dist/component/reaction/index.js +34 -12
- package/dist/component/reaction/moveData.js +34 -2
- package/dist/component/reaction/postMessage.js +23 -2
- package/dist/component/reaction/redirectNow.js +6 -2
- package/dist/component/reaction/removeData.js +27 -2
- package/dist/component/reaction/setClipboardData.js +16 -2
- package/dist/component/reaction/setData.js +22 -3
- package/dist/component/reaction/submitData.js +25 -2
- package/dist/component/reaction/utility/httpRequestCommon.js +3 -2
- package/dist/component/reaction/utility/index.js +1 -1
- package/dist/coreComponentsPlugin.js +5 -2
- package/dist/dnd-kit-sortable-tree.esm-Cz1RJyIg.js +4135 -0
- package/dist/engine/Actions.js +4 -7
- package/dist/engine/ParsingDebugDisplay/ParsingDebugDisplay.js +692 -3
- package/dist/engine/ReactiveJsonRoot.js +8 -6
- package/dist/engine/TemplateSystem.js +3 -3
- package/dist/engine/View.js +2 -7
- package/dist/engine/index.js +38 -37
- package/dist/engine/utility/alterData.js +7 -1
- package/dist/engine/utility/analyzeDataOverrideReferences.js +41 -2
- package/dist/engine/utility/formElementsCommon.js +34 -0
- package/dist/engine/utility/formatString.js +19 -3
- package/dist/engine/utility/index.js +12 -11
- package/dist/httpRequestCommon-BFntjNdS.js +1799 -0
- package/dist/index-BA09SSaJ.js +26 -0
- package/dist/index-Bzk15m61.js +19 -0
- package/dist/index-CACLSxWi.js +8 -0
- package/dist/index-NNBvIV0S.js +1873 -0
- package/dist/index-OhHUX6nj.js +460 -0
- package/dist/main.js +124 -102
- package/package.json +4 -4
- package/dist/HashChangeListener-D6HwdXBJ.js +0 -8526
- package/dist/ParsingDebugDisplay-8f4yL4Jw.js +0 -696
- package/dist/VariablesDebug-pv5GGWel.js +0 -9262
- package/dist/component/action/Popover.js +0 -6
- package/dist/component/action/Tooltip.js +0 -5
- package/dist/component/element/form/CheckBoxField.js +0 -8
- package/dist/component/element/form/DateField.js +0 -8
- package/dist/component/element/form/NumberField.js +0 -8
- package/dist/component/element/form/SelectField.js +0 -8
- package/dist/component/element/form/TextAreaField.js +0 -8
- package/dist/component/element/form/TextField.js +0 -8
- package/dist/component/element/form/formElementsCommon.js +0 -4
- package/dist/component/element/form/index.js +0 -10
- package/dist/component/element/html/AccordionItem.js +0 -6
- package/dist/component/element/html/Modal.js +0 -8
- package/dist/component/element/html/Tabs.js +0 -8
- package/dist/component/element/special/BootstrapElement.js +0 -5
- package/dist/engine/PaginationProvider.js +0 -30
- package/dist/usePagination-Bb6lefHG.js +0 -353
|
@@ -0,0 +1,3568 @@
|
|
|
1
|
+
import { useContext as Ee, useRef as Zt } from "react";
|
|
2
|
+
import { GlobalDataContext as we } from "./engine/GlobalDataContext.js";
|
|
3
|
+
import { TemplateContext as be } from "./engine/TemplateContext.js";
|
|
4
|
+
import { jsx as le, jsxs as ut, Fragment as it } from "react/jsx-runtime";
|
|
5
|
+
import { c as at, g as er } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
6
|
+
import { l as st } from "./lodash-CYNxjS-I.js";
|
|
7
|
+
function ve({ props: E, currentData: P, datafield: x, path: k }) {
|
|
8
|
+
const D = Ee(we), C = Ee(be), l = D.plugins ?? {}, S = (l == null ? void 0 : l.element) ?? {};
|
|
9
|
+
if (!S)
|
|
10
|
+
return null;
|
|
11
|
+
const { element: d } = D;
|
|
12
|
+
if (P === void 0 && (P = ""), E != null && E.type) {
|
|
13
|
+
let f = S[E.type] ?? void 0;
|
|
14
|
+
return f === void 0 && (f = S.Html ?? ct), (S.Html ?? ct) === f && (E.tag = E.tag ?? E.type), /* @__PURE__ */ le(f, { path: k, props: E, currentData: P, datafield: x });
|
|
15
|
+
}
|
|
16
|
+
if (E != null && E.load) {
|
|
17
|
+
let f;
|
|
18
|
+
const h = (E == null ? void 0 : E.customDataLocation) ?? void 0, a = h ? (
|
|
19
|
+
// The data is located somewhere in the current data.
|
|
20
|
+
ke({
|
|
21
|
+
globalDataContext: D,
|
|
22
|
+
templateContext: C,
|
|
23
|
+
valueToEvaluate: h
|
|
24
|
+
})
|
|
25
|
+
) : (
|
|
26
|
+
// The data is the current data.
|
|
27
|
+
P
|
|
28
|
+
), o = h ? ft({
|
|
29
|
+
dataLocation: h,
|
|
30
|
+
currentPath: k,
|
|
31
|
+
globalDataContext: D,
|
|
32
|
+
templateContext: C
|
|
33
|
+
}) : k;
|
|
34
|
+
typeof E.load == "function" ? f = E.load(a) : f = d[E.load];
|
|
35
|
+
const { load: A, customDataLocation: s, ...p } = E;
|
|
36
|
+
return f = { ...f, ...p }, E.keepTemplateContext ? /* @__PURE__ */ le(
|
|
37
|
+
ve,
|
|
38
|
+
{
|
|
39
|
+
currentData: a,
|
|
40
|
+
datafield: x,
|
|
41
|
+
path: o,
|
|
42
|
+
props: f
|
|
43
|
+
}
|
|
44
|
+
) : /* @__PURE__ */ le(be.Provider, { value: { templateData: a, templatePath: o }, children: /* @__PURE__ */ le(
|
|
45
|
+
ve,
|
|
46
|
+
{
|
|
47
|
+
currentData: a,
|
|
48
|
+
datafield: x,
|
|
49
|
+
path: o,
|
|
50
|
+
props: f
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
}
|
|
54
|
+
return Array.isArray(E) ? E.map((f, h) => /* @__PURE__ */ le(
|
|
55
|
+
ve,
|
|
56
|
+
{
|
|
57
|
+
currentData: P[h] ?? void 0,
|
|
58
|
+
datafield: h,
|
|
59
|
+
path: k + "." + h,
|
|
60
|
+
props: f ?? void 0
|
|
61
|
+
},
|
|
62
|
+
k + "." + h
|
|
63
|
+
)) : typeof E == "object" ? Object.entries(E).map(([f, h]) => /* @__PURE__ */ le(
|
|
64
|
+
ve,
|
|
65
|
+
{
|
|
66
|
+
currentData: P[f] ?? void 0,
|
|
67
|
+
datafield: f ?? void 0,
|
|
68
|
+
path: k + "." + f,
|
|
69
|
+
props: h
|
|
70
|
+
},
|
|
71
|
+
k + "." + f
|
|
72
|
+
)) : /* @__PURE__ */ le(ar, { valueToEvaluate: P || (E ?? null) });
|
|
73
|
+
}
|
|
74
|
+
function Ne(E) {
|
|
75
|
+
throw new Error('Could not dynamically require "' + E + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
76
|
+
}
|
|
77
|
+
var He = { exports: {} };
|
|
78
|
+
/*! jsonpath 1.1.1 */
|
|
79
|
+
var ot;
|
|
80
|
+
function tr() {
|
|
81
|
+
return ot || (ot = 1, function(E, P) {
|
|
82
|
+
(function(x) {
|
|
83
|
+
E.exports = x();
|
|
84
|
+
})(function() {
|
|
85
|
+
return function x(k, D, C) {
|
|
86
|
+
function l(f, h) {
|
|
87
|
+
if (!D[f]) {
|
|
88
|
+
if (!k[f]) {
|
|
89
|
+
var a = typeof Ne == "function" && Ne;
|
|
90
|
+
if (!h && a) return a(f, !0);
|
|
91
|
+
if (S) return S(f, !0);
|
|
92
|
+
var o = new Error("Cannot find module '" + f + "'");
|
|
93
|
+
throw o.code = "MODULE_NOT_FOUND", o;
|
|
94
|
+
}
|
|
95
|
+
var A = D[f] = { exports: {} };
|
|
96
|
+
k[f][0].call(A.exports, function(s) {
|
|
97
|
+
var p = k[f][1][s];
|
|
98
|
+
return l(p || s);
|
|
99
|
+
}, A, A.exports, x, k, D, C);
|
|
100
|
+
}
|
|
101
|
+
return D[f].exports;
|
|
102
|
+
}
|
|
103
|
+
for (var S = typeof Ne == "function" && Ne, d = 0; d < C.length; d++) l(C[d]);
|
|
104
|
+
return l;
|
|
105
|
+
}({ "./aesprim": [function(x, k, D) {
|
|
106
|
+
(function(C, l) {
|
|
107
|
+
l(typeof D < "u" ? D : C.esprima = {});
|
|
108
|
+
})(this, function(C) {
|
|
109
|
+
var l, S, d, f, h, a, o, A, s, p, r, F, w, g, n, i, y, m;
|
|
110
|
+
l = {
|
|
111
|
+
BooleanLiteral: 1,
|
|
112
|
+
EOF: 2,
|
|
113
|
+
Identifier: 3,
|
|
114
|
+
Keyword: 4,
|
|
115
|
+
NullLiteral: 5,
|
|
116
|
+
NumericLiteral: 6,
|
|
117
|
+
Punctuator: 7,
|
|
118
|
+
StringLiteral: 8,
|
|
119
|
+
RegularExpression: 9
|
|
120
|
+
}, S = {}, S[l.BooleanLiteral] = "Boolean", S[l.EOF] = "<end>", S[l.Identifier] = "Identifier", S[l.Keyword] = "Keyword", S[l.NullLiteral] = "Null", S[l.NumericLiteral] = "Numeric", S[l.Punctuator] = "Punctuator", S[l.StringLiteral] = "String", S[l.RegularExpression] = "RegularExpression", d = [
|
|
121
|
+
"(",
|
|
122
|
+
"{",
|
|
123
|
+
"[",
|
|
124
|
+
"in",
|
|
125
|
+
"typeof",
|
|
126
|
+
"instanceof",
|
|
127
|
+
"new",
|
|
128
|
+
"return",
|
|
129
|
+
"case",
|
|
130
|
+
"delete",
|
|
131
|
+
"throw",
|
|
132
|
+
"void",
|
|
133
|
+
// assignment operators
|
|
134
|
+
"=",
|
|
135
|
+
"+=",
|
|
136
|
+
"-=",
|
|
137
|
+
"*=",
|
|
138
|
+
"/=",
|
|
139
|
+
"%=",
|
|
140
|
+
"<<=",
|
|
141
|
+
">>=",
|
|
142
|
+
">>>=",
|
|
143
|
+
"&=",
|
|
144
|
+
"|=",
|
|
145
|
+
"^=",
|
|
146
|
+
",",
|
|
147
|
+
// binary/unary operators
|
|
148
|
+
"+",
|
|
149
|
+
"-",
|
|
150
|
+
"*",
|
|
151
|
+
"/",
|
|
152
|
+
"%",
|
|
153
|
+
"++",
|
|
154
|
+
"--",
|
|
155
|
+
"<<",
|
|
156
|
+
">>",
|
|
157
|
+
">>>",
|
|
158
|
+
"&",
|
|
159
|
+
"|",
|
|
160
|
+
"^",
|
|
161
|
+
"!",
|
|
162
|
+
"~",
|
|
163
|
+
"&&",
|
|
164
|
+
"||",
|
|
165
|
+
"?",
|
|
166
|
+
":",
|
|
167
|
+
"===",
|
|
168
|
+
"==",
|
|
169
|
+
">=",
|
|
170
|
+
"<=",
|
|
171
|
+
"<",
|
|
172
|
+
">",
|
|
173
|
+
"!=",
|
|
174
|
+
"!=="
|
|
175
|
+
], f = {
|
|
176
|
+
AssignmentExpression: "AssignmentExpression",
|
|
177
|
+
ArrayExpression: "ArrayExpression",
|
|
178
|
+
BlockStatement: "BlockStatement",
|
|
179
|
+
BinaryExpression: "BinaryExpression",
|
|
180
|
+
BreakStatement: "BreakStatement",
|
|
181
|
+
CallExpression: "CallExpression",
|
|
182
|
+
CatchClause: "CatchClause",
|
|
183
|
+
ConditionalExpression: "ConditionalExpression",
|
|
184
|
+
ContinueStatement: "ContinueStatement",
|
|
185
|
+
DoWhileStatement: "DoWhileStatement",
|
|
186
|
+
DebuggerStatement: "DebuggerStatement",
|
|
187
|
+
EmptyStatement: "EmptyStatement",
|
|
188
|
+
ExpressionStatement: "ExpressionStatement",
|
|
189
|
+
ForStatement: "ForStatement",
|
|
190
|
+
ForInStatement: "ForInStatement",
|
|
191
|
+
FunctionDeclaration: "FunctionDeclaration",
|
|
192
|
+
FunctionExpression: "FunctionExpression",
|
|
193
|
+
Identifier: "Identifier",
|
|
194
|
+
IfStatement: "IfStatement",
|
|
195
|
+
Literal: "Literal",
|
|
196
|
+
LabeledStatement: "LabeledStatement",
|
|
197
|
+
LogicalExpression: "LogicalExpression",
|
|
198
|
+
MemberExpression: "MemberExpression",
|
|
199
|
+
NewExpression: "NewExpression",
|
|
200
|
+
ObjectExpression: "ObjectExpression",
|
|
201
|
+
Program: "Program",
|
|
202
|
+
Property: "Property",
|
|
203
|
+
ReturnStatement: "ReturnStatement",
|
|
204
|
+
SequenceExpression: "SequenceExpression",
|
|
205
|
+
SwitchStatement: "SwitchStatement",
|
|
206
|
+
SwitchCase: "SwitchCase",
|
|
207
|
+
ThisExpression: "ThisExpression",
|
|
208
|
+
ThrowStatement: "ThrowStatement",
|
|
209
|
+
TryStatement: "TryStatement",
|
|
210
|
+
UnaryExpression: "UnaryExpression",
|
|
211
|
+
UpdateExpression: "UpdateExpression",
|
|
212
|
+
VariableDeclaration: "VariableDeclaration",
|
|
213
|
+
VariableDeclarator: "VariableDeclarator",
|
|
214
|
+
WhileStatement: "WhileStatement",
|
|
215
|
+
WithStatement: "WithStatement"
|
|
216
|
+
}, h = {
|
|
217
|
+
Data: 1,
|
|
218
|
+
Get: 2,
|
|
219
|
+
Set: 4
|
|
220
|
+
}, a = {
|
|
221
|
+
UnexpectedToken: "Unexpected token %0",
|
|
222
|
+
UnexpectedNumber: "Unexpected number",
|
|
223
|
+
UnexpectedString: "Unexpected string",
|
|
224
|
+
UnexpectedIdentifier: "Unexpected identifier",
|
|
225
|
+
UnexpectedReserved: "Unexpected reserved word",
|
|
226
|
+
UnexpectedEOS: "Unexpected end of input",
|
|
227
|
+
NewlineAfterThrow: "Illegal newline after throw",
|
|
228
|
+
InvalidRegExp: "Invalid regular expression",
|
|
229
|
+
UnterminatedRegExp: "Invalid regular expression: missing /",
|
|
230
|
+
InvalidLHSInAssignment: "Invalid left-hand side in assignment",
|
|
231
|
+
InvalidLHSInForIn: "Invalid left-hand side in for-in",
|
|
232
|
+
MultipleDefaultsInSwitch: "More than one default clause in switch statement",
|
|
233
|
+
NoCatchOrFinally: "Missing catch or finally after try",
|
|
234
|
+
UnknownLabel: "Undefined label '%0'",
|
|
235
|
+
Redeclaration: "%0 '%1' has already been declared",
|
|
236
|
+
IllegalContinue: "Illegal continue statement",
|
|
237
|
+
IllegalBreak: "Illegal break statement",
|
|
238
|
+
IllegalReturn: "Illegal return statement",
|
|
239
|
+
StrictModeWith: "Strict mode code may not include a with statement",
|
|
240
|
+
StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode",
|
|
241
|
+
StrictVarName: "Variable name may not be eval or arguments in strict mode",
|
|
242
|
+
StrictParamName: "Parameter name eval or arguments is not allowed in strict mode",
|
|
243
|
+
StrictParamDupe: "Strict mode function may not have duplicate parameter names",
|
|
244
|
+
StrictFunctionName: "Function name may not be eval or arguments in strict mode",
|
|
245
|
+
StrictOctalLiteral: "Octal literals are not allowed in strict mode.",
|
|
246
|
+
StrictDelete: "Delete of an unqualified identifier in strict mode.",
|
|
247
|
+
StrictDuplicateProperty: "Duplicate data property in object literal not allowed in strict mode",
|
|
248
|
+
AccessorDataProperty: "Object literal may not have data and accessor property with the same name",
|
|
249
|
+
AccessorGetSet: "Object literal may not have multiple get/set accessors with the same name",
|
|
250
|
+
StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode",
|
|
251
|
+
StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode",
|
|
252
|
+
StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode",
|
|
253
|
+
StrictReservedWord: "Use of future reserved word in strict mode"
|
|
254
|
+
}, o = {
|
|
255
|
+
NonAsciiIdentifierStart: new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),
|
|
256
|
+
NonAsciiIdentifierPart: new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")
|
|
257
|
+
};
|
|
258
|
+
function O(e, t) {
|
|
259
|
+
if (!e)
|
|
260
|
+
throw new Error("ASSERT: " + t);
|
|
261
|
+
}
|
|
262
|
+
function M(e) {
|
|
263
|
+
return e >= 48 && e <= 57;
|
|
264
|
+
}
|
|
265
|
+
function z(e) {
|
|
266
|
+
return "0123456789abcdefABCDEF".indexOf(e) >= 0;
|
|
267
|
+
}
|
|
268
|
+
function T(e) {
|
|
269
|
+
return "01234567".indexOf(e) >= 0;
|
|
270
|
+
}
|
|
271
|
+
function G(e) {
|
|
272
|
+
return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e >= 5760 && [5760, 6158, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(e) >= 0;
|
|
273
|
+
}
|
|
274
|
+
function $(e) {
|
|
275
|
+
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
276
|
+
}
|
|
277
|
+
function q(e) {
|
|
278
|
+
return e == 64 || e === 36 || e === 95 || // $ (dollar) and _ (underscore)
|
|
279
|
+
e >= 65 && e <= 90 || // A..Z
|
|
280
|
+
e >= 97 && e <= 122 || // a..z
|
|
281
|
+
e === 92 || // \ (backslash)
|
|
282
|
+
e >= 128 && o.NonAsciiIdentifierStart.test(String.fromCharCode(e));
|
|
283
|
+
}
|
|
284
|
+
function J(e) {
|
|
285
|
+
return e === 36 || e === 95 || // $ (dollar) and _ (underscore)
|
|
286
|
+
e >= 65 && e <= 90 || // A..Z
|
|
287
|
+
e >= 97 && e <= 122 || // a..z
|
|
288
|
+
e >= 48 && e <= 57 || // 0..9
|
|
289
|
+
e === 92 || // \ (backslash)
|
|
290
|
+
e >= 128 && o.NonAsciiIdentifierPart.test(String.fromCharCode(e));
|
|
291
|
+
}
|
|
292
|
+
function ce(e) {
|
|
293
|
+
switch (e) {
|
|
294
|
+
case "class":
|
|
295
|
+
case "enum":
|
|
296
|
+
case "export":
|
|
297
|
+
case "extends":
|
|
298
|
+
case "import":
|
|
299
|
+
case "super":
|
|
300
|
+
return !0;
|
|
301
|
+
default:
|
|
302
|
+
return !1;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function ee(e) {
|
|
306
|
+
switch (e) {
|
|
307
|
+
case "implements":
|
|
308
|
+
case "interface":
|
|
309
|
+
case "package":
|
|
310
|
+
case "private":
|
|
311
|
+
case "protected":
|
|
312
|
+
case "public":
|
|
313
|
+
case "static":
|
|
314
|
+
case "yield":
|
|
315
|
+
case "let":
|
|
316
|
+
return !0;
|
|
317
|
+
default:
|
|
318
|
+
return !1;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function Y(e) {
|
|
322
|
+
return e === "eval" || e === "arguments";
|
|
323
|
+
}
|
|
324
|
+
function fe(e) {
|
|
325
|
+
if (p && ee(e))
|
|
326
|
+
return !0;
|
|
327
|
+
switch (e.length) {
|
|
328
|
+
case 2:
|
|
329
|
+
return e === "if" || e === "in" || e === "do";
|
|
330
|
+
case 3:
|
|
331
|
+
return e === "var" || e === "for" || e === "new" || e === "try" || e === "let";
|
|
332
|
+
case 4:
|
|
333
|
+
return e === "this" || e === "else" || e === "case" || e === "void" || e === "with" || e === "enum";
|
|
334
|
+
case 5:
|
|
335
|
+
return e === "while" || e === "break" || e === "catch" || e === "throw" || e === "const" || e === "yield" || e === "class" || e === "super";
|
|
336
|
+
case 6:
|
|
337
|
+
return e === "return" || e === "typeof" || e === "delete" || e === "switch" || e === "export" || e === "import";
|
|
338
|
+
case 7:
|
|
339
|
+
return e === "default" || e === "finally" || e === "extends";
|
|
340
|
+
case 8:
|
|
341
|
+
return e === "function" || e === "continue" || e === "debugger";
|
|
342
|
+
case 10:
|
|
343
|
+
return e === "instanceof";
|
|
344
|
+
default:
|
|
345
|
+
return !1;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function oe(e, t, u, c, b) {
|
|
349
|
+
var I;
|
|
350
|
+
O(typeof u == "number", "Comment must have valid position"), !(y.lastCommentStart >= u) && (y.lastCommentStart = u, I = {
|
|
351
|
+
type: e,
|
|
352
|
+
value: t
|
|
353
|
+
}, m.range && (I.range = [u, c]), m.loc && (I.loc = b), m.comments.push(I), m.attachComment && (m.leadingComments.push(I), m.trailingComments.push(I)));
|
|
354
|
+
}
|
|
355
|
+
function pe(e) {
|
|
356
|
+
var t, u, c, b;
|
|
357
|
+
for (t = r - e, u = {
|
|
358
|
+
start: {
|
|
359
|
+
line: F,
|
|
360
|
+
column: r - w - e
|
|
361
|
+
}
|
|
362
|
+
}; r < g; )
|
|
363
|
+
if (c = s.charCodeAt(r), ++r, $(c)) {
|
|
364
|
+
m.comments && (b = s.slice(t + e, r - 1), u.end = {
|
|
365
|
+
line: F,
|
|
366
|
+
column: r - w - 1
|
|
367
|
+
}, oe("Line", b, t, r - 1, u)), c === 13 && s.charCodeAt(r) === 10 && ++r, ++F, w = r;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
m.comments && (b = s.slice(t + e, r), u.end = {
|
|
371
|
+
line: F,
|
|
372
|
+
column: r - w
|
|
373
|
+
}, oe("Line", b, t, r, u));
|
|
374
|
+
}
|
|
375
|
+
function Ie() {
|
|
376
|
+
var e, t, u, c;
|
|
377
|
+
for (m.comments && (e = r - 2, t = {
|
|
378
|
+
start: {
|
|
379
|
+
line: F,
|
|
380
|
+
column: r - w - 2
|
|
381
|
+
}
|
|
382
|
+
}); r < g; )
|
|
383
|
+
if (u = s.charCodeAt(r), $(u))
|
|
384
|
+
u === 13 && s.charCodeAt(r + 1) === 10 && ++r, ++F, ++r, w = r, r >= g && j({}, a.UnexpectedToken, "ILLEGAL");
|
|
385
|
+
else if (u === 42) {
|
|
386
|
+
if (s.charCodeAt(r + 1) === 47) {
|
|
387
|
+
++r, ++r, m.comments && (c = s.slice(e + 2, r - 2), t.end = {
|
|
388
|
+
line: F,
|
|
389
|
+
column: r - w
|
|
390
|
+
}, oe("Block", c, e, r, t));
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
++r;
|
|
394
|
+
} else
|
|
395
|
+
++r;
|
|
396
|
+
j({}, a.UnexpectedToken, "ILLEGAL");
|
|
397
|
+
}
|
|
398
|
+
function v() {
|
|
399
|
+
var e, t;
|
|
400
|
+
for (t = r === 0; r < g; )
|
|
401
|
+
if (e = s.charCodeAt(r), G(e))
|
|
402
|
+
++r;
|
|
403
|
+
else if ($(e))
|
|
404
|
+
++r, e === 13 && s.charCodeAt(r) === 10 && ++r, ++F, w = r, t = !0;
|
|
405
|
+
else if (e === 47)
|
|
406
|
+
if (e = s.charCodeAt(r + 1), e === 47)
|
|
407
|
+
++r, ++r, pe(2), t = !0;
|
|
408
|
+
else if (e === 42)
|
|
409
|
+
++r, ++r, Ie();
|
|
410
|
+
else
|
|
411
|
+
break;
|
|
412
|
+
else if (t && e === 45)
|
|
413
|
+
if (s.charCodeAt(r + 1) === 45 && s.charCodeAt(r + 2) === 62)
|
|
414
|
+
r += 3, pe(3);
|
|
415
|
+
else
|
|
416
|
+
break;
|
|
417
|
+
else if (e === 60)
|
|
418
|
+
if (s.slice(r + 1, r + 4) === "!--")
|
|
419
|
+
++r, ++r, ++r, ++r, pe(4);
|
|
420
|
+
else
|
|
421
|
+
break;
|
|
422
|
+
else
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
function B(e) {
|
|
426
|
+
var t, u, c, b = 0;
|
|
427
|
+
for (u = e === "u" ? 4 : 2, t = 0; t < u; ++t)
|
|
428
|
+
if (r < g && z(s[r]))
|
|
429
|
+
c = s[r++], b = b * 16 + "0123456789abcdef".indexOf(c.toLowerCase());
|
|
430
|
+
else
|
|
431
|
+
return "";
|
|
432
|
+
return String.fromCharCode(b);
|
|
433
|
+
}
|
|
434
|
+
function _() {
|
|
435
|
+
var e, t;
|
|
436
|
+
for (e = s.charCodeAt(r++), t = String.fromCharCode(e), e === 92 && (s.charCodeAt(r) !== 117 && j({}, a.UnexpectedToken, "ILLEGAL"), ++r, e = B("u"), (!e || e === "\\" || !q(e.charCodeAt(0))) && j({}, a.UnexpectedToken, "ILLEGAL"), t = e); r < g && (e = s.charCodeAt(r), !!J(e)); )
|
|
437
|
+
++r, t += String.fromCharCode(e), e === 92 && (t = t.substr(0, t.length - 1), s.charCodeAt(r) !== 117 && j({}, a.UnexpectedToken, "ILLEGAL"), ++r, e = B("u"), (!e || e === "\\" || !J(e.charCodeAt(0))) && j({}, a.UnexpectedToken, "ILLEGAL"), t += e);
|
|
438
|
+
return t;
|
|
439
|
+
}
|
|
440
|
+
function K() {
|
|
441
|
+
var e, t;
|
|
442
|
+
for (e = r++; r < g; ) {
|
|
443
|
+
if (t = s.charCodeAt(r), t === 92)
|
|
444
|
+
return r = e, _();
|
|
445
|
+
if (J(t))
|
|
446
|
+
++r;
|
|
447
|
+
else
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
return s.slice(e, r);
|
|
451
|
+
}
|
|
452
|
+
function re() {
|
|
453
|
+
var e, t, u;
|
|
454
|
+
return e = r, t = s.charCodeAt(r) === 92 ? _() : K(), t.length === 1 ? u = l.Identifier : fe(t) ? u = l.Keyword : t === "null" ? u = l.NullLiteral : t === "true" || t === "false" ? u = l.BooleanLiteral : u = l.Identifier, {
|
|
455
|
+
type: u,
|
|
456
|
+
value: t,
|
|
457
|
+
lineNumber: F,
|
|
458
|
+
lineStart: w,
|
|
459
|
+
start: e,
|
|
460
|
+
end: r
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function H() {
|
|
464
|
+
var e = r, t = s.charCodeAt(r), u, c = s[r], b, I, U;
|
|
465
|
+
switch (t) {
|
|
466
|
+
// Check for most common single-character punctuators.
|
|
467
|
+
case 46:
|
|
468
|
+
// . dot
|
|
469
|
+
case 40:
|
|
470
|
+
// ( open bracket
|
|
471
|
+
case 41:
|
|
472
|
+
// ) close bracket
|
|
473
|
+
case 59:
|
|
474
|
+
// ; semicolon
|
|
475
|
+
case 44:
|
|
476
|
+
// , comma
|
|
477
|
+
case 123:
|
|
478
|
+
// { open curly brace
|
|
479
|
+
case 125:
|
|
480
|
+
// } close curly brace
|
|
481
|
+
case 91:
|
|
482
|
+
// [
|
|
483
|
+
case 93:
|
|
484
|
+
// ]
|
|
485
|
+
case 58:
|
|
486
|
+
// :
|
|
487
|
+
case 63:
|
|
488
|
+
// ?
|
|
489
|
+
case 126:
|
|
490
|
+
return ++r, m.tokenize && (t === 40 ? m.openParenToken = m.tokens.length : t === 123 && (m.openCurlyToken = m.tokens.length)), {
|
|
491
|
+
type: l.Punctuator,
|
|
492
|
+
value: String.fromCharCode(t),
|
|
493
|
+
lineNumber: F,
|
|
494
|
+
lineStart: w,
|
|
495
|
+
start: e,
|
|
496
|
+
end: r
|
|
497
|
+
};
|
|
498
|
+
default:
|
|
499
|
+
if (u = s.charCodeAt(r + 1), u === 61)
|
|
500
|
+
switch (t) {
|
|
501
|
+
case 43:
|
|
502
|
+
// +
|
|
503
|
+
case 45:
|
|
504
|
+
// -
|
|
505
|
+
case 47:
|
|
506
|
+
// /
|
|
507
|
+
case 60:
|
|
508
|
+
// <
|
|
509
|
+
case 62:
|
|
510
|
+
// >
|
|
511
|
+
case 94:
|
|
512
|
+
// ^
|
|
513
|
+
case 124:
|
|
514
|
+
// |
|
|
515
|
+
case 37:
|
|
516
|
+
// %
|
|
517
|
+
case 38:
|
|
518
|
+
// &
|
|
519
|
+
case 42:
|
|
520
|
+
return r += 2, {
|
|
521
|
+
type: l.Punctuator,
|
|
522
|
+
value: String.fromCharCode(t) + String.fromCharCode(u),
|
|
523
|
+
lineNumber: F,
|
|
524
|
+
lineStart: w,
|
|
525
|
+
start: e,
|
|
526
|
+
end: r
|
|
527
|
+
};
|
|
528
|
+
case 33:
|
|
529
|
+
// !
|
|
530
|
+
case 61:
|
|
531
|
+
return r += 2, s.charCodeAt(r) === 61 && ++r, {
|
|
532
|
+
type: l.Punctuator,
|
|
533
|
+
value: s.slice(e, r),
|
|
534
|
+
lineNumber: F,
|
|
535
|
+
lineStart: w,
|
|
536
|
+
start: e,
|
|
537
|
+
end: r
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (U = s.substr(r, 4), U === ">>>=")
|
|
542
|
+
return r += 4, {
|
|
543
|
+
type: l.Punctuator,
|
|
544
|
+
value: U,
|
|
545
|
+
lineNumber: F,
|
|
546
|
+
lineStart: w,
|
|
547
|
+
start: e,
|
|
548
|
+
end: r
|
|
549
|
+
};
|
|
550
|
+
if (I = U.substr(0, 3), I === ">>>" || I === "<<=" || I === ">>=")
|
|
551
|
+
return r += 3, {
|
|
552
|
+
type: l.Punctuator,
|
|
553
|
+
value: I,
|
|
554
|
+
lineNumber: F,
|
|
555
|
+
lineStart: w,
|
|
556
|
+
start: e,
|
|
557
|
+
end: r
|
|
558
|
+
};
|
|
559
|
+
if (b = I.substr(0, 2), c === b[1] && "+-<>&|".indexOf(c) >= 0 || b === "=>")
|
|
560
|
+
return r += 2, {
|
|
561
|
+
type: l.Punctuator,
|
|
562
|
+
value: b,
|
|
563
|
+
lineNumber: F,
|
|
564
|
+
lineStart: w,
|
|
565
|
+
start: e,
|
|
566
|
+
end: r
|
|
567
|
+
};
|
|
568
|
+
if ("<>=!+-*%&|^/".indexOf(c) >= 0)
|
|
569
|
+
return ++r, {
|
|
570
|
+
type: l.Punctuator,
|
|
571
|
+
value: c,
|
|
572
|
+
lineNumber: F,
|
|
573
|
+
lineStart: w,
|
|
574
|
+
start: e,
|
|
575
|
+
end: r
|
|
576
|
+
};
|
|
577
|
+
j({}, a.UnexpectedToken, "ILLEGAL");
|
|
578
|
+
}
|
|
579
|
+
function W(e) {
|
|
580
|
+
for (var t = ""; r < g && z(s[r]); )
|
|
581
|
+
t += s[r++];
|
|
582
|
+
return t.length === 0 && j({}, a.UnexpectedToken, "ILLEGAL"), q(s.charCodeAt(r)) && j({}, a.UnexpectedToken, "ILLEGAL"), {
|
|
583
|
+
type: l.NumericLiteral,
|
|
584
|
+
value: parseInt("0x" + t, 16),
|
|
585
|
+
lineNumber: F,
|
|
586
|
+
lineStart: w,
|
|
587
|
+
start: e,
|
|
588
|
+
end: r
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function Q(e) {
|
|
592
|
+
for (var t = "0" + s[r++]; r < g && T(s[r]); )
|
|
593
|
+
t += s[r++];
|
|
594
|
+
return (q(s.charCodeAt(r)) || M(s.charCodeAt(r))) && j({}, a.UnexpectedToken, "ILLEGAL"), {
|
|
595
|
+
type: l.NumericLiteral,
|
|
596
|
+
value: parseInt(t, 8),
|
|
597
|
+
octal: !0,
|
|
598
|
+
lineNumber: F,
|
|
599
|
+
lineStart: w,
|
|
600
|
+
start: e,
|
|
601
|
+
end: r
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function Z() {
|
|
605
|
+
var e, t, u;
|
|
606
|
+
if (u = s[r], O(
|
|
607
|
+
M(u.charCodeAt(0)) || u === ".",
|
|
608
|
+
"Numeric literal must start with a decimal digit or a decimal point"
|
|
609
|
+
), t = r, e = "", u !== ".") {
|
|
610
|
+
if (e = s[r++], u = s[r], e === "0") {
|
|
611
|
+
if (u === "x" || u === "X")
|
|
612
|
+
return ++r, W(t);
|
|
613
|
+
if (T(u))
|
|
614
|
+
return Q(t);
|
|
615
|
+
u && M(u.charCodeAt(0)) && j({}, a.UnexpectedToken, "ILLEGAL");
|
|
616
|
+
}
|
|
617
|
+
for (; M(s.charCodeAt(r)); )
|
|
618
|
+
e += s[r++];
|
|
619
|
+
u = s[r];
|
|
620
|
+
}
|
|
621
|
+
if (u === ".") {
|
|
622
|
+
for (e += s[r++]; M(s.charCodeAt(r)); )
|
|
623
|
+
e += s[r++];
|
|
624
|
+
u = s[r];
|
|
625
|
+
}
|
|
626
|
+
if (u === "e" || u === "E")
|
|
627
|
+
if (e += s[r++], u = s[r], (u === "+" || u === "-") && (e += s[r++]), M(s.charCodeAt(r)))
|
|
628
|
+
for (; M(s.charCodeAt(r)); )
|
|
629
|
+
e += s[r++];
|
|
630
|
+
else
|
|
631
|
+
j({}, a.UnexpectedToken, "ILLEGAL");
|
|
632
|
+
return q(s.charCodeAt(r)) && j({}, a.UnexpectedToken, "ILLEGAL"), {
|
|
633
|
+
type: l.NumericLiteral,
|
|
634
|
+
value: parseFloat(e),
|
|
635
|
+
lineNumber: F,
|
|
636
|
+
lineStart: w,
|
|
637
|
+
start: t,
|
|
638
|
+
end: r
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function me() {
|
|
642
|
+
var e = "", t, u, c, b, I, U, X = !1, ae, ue;
|
|
643
|
+
for (ae = F, ue = w, t = s[r], O(
|
|
644
|
+
t === "'" || t === '"',
|
|
645
|
+
"String literal must starts with a quote"
|
|
646
|
+
), u = r, ++r; r < g; )
|
|
647
|
+
if (c = s[r++], c === t) {
|
|
648
|
+
t = "";
|
|
649
|
+
break;
|
|
650
|
+
} else if (c === "\\")
|
|
651
|
+
if (c = s[r++], !c || !$(c.charCodeAt(0)))
|
|
652
|
+
switch (c) {
|
|
653
|
+
case "u":
|
|
654
|
+
case "x":
|
|
655
|
+
U = r, I = B(c), I ? e += I : (r = U, e += c);
|
|
656
|
+
break;
|
|
657
|
+
case "n":
|
|
658
|
+
e += `
|
|
659
|
+
`;
|
|
660
|
+
break;
|
|
661
|
+
case "r":
|
|
662
|
+
e += "\r";
|
|
663
|
+
break;
|
|
664
|
+
case "t":
|
|
665
|
+
e += " ";
|
|
666
|
+
break;
|
|
667
|
+
case "b":
|
|
668
|
+
e += "\b";
|
|
669
|
+
break;
|
|
670
|
+
case "f":
|
|
671
|
+
e += "\f";
|
|
672
|
+
break;
|
|
673
|
+
case "v":
|
|
674
|
+
e += "\v";
|
|
675
|
+
break;
|
|
676
|
+
default:
|
|
677
|
+
T(c) ? (b = "01234567".indexOf(c), b !== 0 && (X = !0), r < g && T(s[r]) && (X = !0, b = b * 8 + "01234567".indexOf(s[r++]), "0123".indexOf(c) >= 0 && r < g && T(s[r]) && (b = b * 8 + "01234567".indexOf(s[r++]))), e += String.fromCharCode(b)) : e += c;
|
|
678
|
+
break;
|
|
679
|
+
}
|
|
680
|
+
else
|
|
681
|
+
++F, c === "\r" && s[r] === `
|
|
682
|
+
` && ++r, w = r;
|
|
683
|
+
else {
|
|
684
|
+
if ($(c.charCodeAt(0)))
|
|
685
|
+
break;
|
|
686
|
+
e += c;
|
|
687
|
+
}
|
|
688
|
+
return t !== "" && j({}, a.UnexpectedToken, "ILLEGAL"), {
|
|
689
|
+
type: l.StringLiteral,
|
|
690
|
+
value: e,
|
|
691
|
+
octal: X,
|
|
692
|
+
startLineNumber: ae,
|
|
693
|
+
startLineStart: ue,
|
|
694
|
+
lineNumber: F,
|
|
695
|
+
lineStart: w,
|
|
696
|
+
start: u,
|
|
697
|
+
end: r
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function Se(e, t) {
|
|
701
|
+
var u;
|
|
702
|
+
try {
|
|
703
|
+
u = new RegExp(e, t);
|
|
704
|
+
} catch {
|
|
705
|
+
j({}, a.InvalidRegExp);
|
|
706
|
+
}
|
|
707
|
+
return u;
|
|
708
|
+
}
|
|
709
|
+
function Le() {
|
|
710
|
+
var e, t, u, c, b;
|
|
711
|
+
for (e = s[r], O(e === "/", "Regular expression literal must start with a slash"), t = s[r++], u = !1, c = !1; r < g; )
|
|
712
|
+
if (e = s[r++], t += e, e === "\\")
|
|
713
|
+
e = s[r++], $(e.charCodeAt(0)) && j({}, a.UnterminatedRegExp), t += e;
|
|
714
|
+
else if ($(e.charCodeAt(0)))
|
|
715
|
+
j({}, a.UnterminatedRegExp);
|
|
716
|
+
else if (u)
|
|
717
|
+
e === "]" && (u = !1);
|
|
718
|
+
else if (e === "/") {
|
|
719
|
+
c = !0;
|
|
720
|
+
break;
|
|
721
|
+
} else e === "[" && (u = !0);
|
|
722
|
+
return c || j({}, a.UnterminatedRegExp), b = t.substr(1, t.length - 2), {
|
|
723
|
+
value: b,
|
|
724
|
+
literal: t
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
function De() {
|
|
728
|
+
var e, t, u, c;
|
|
729
|
+
for (t = "", u = ""; r < g && (e = s[r], !!J(e.charCodeAt(0))); )
|
|
730
|
+
if (++r, e === "\\" && r < g)
|
|
731
|
+
if (e = s[r], e === "u") {
|
|
732
|
+
if (++r, c = r, e = B("u"), e)
|
|
733
|
+
for (u += e, t += "\\u"; c < r; ++c)
|
|
734
|
+
t += s[c];
|
|
735
|
+
else
|
|
736
|
+
r = c, u += "u", t += "\\u";
|
|
737
|
+
V({}, a.UnexpectedToken, "ILLEGAL");
|
|
738
|
+
} else
|
|
739
|
+
t += "\\", V({}, a.UnexpectedToken, "ILLEGAL");
|
|
740
|
+
else
|
|
741
|
+
u += e, t += e;
|
|
742
|
+
return {
|
|
743
|
+
value: u,
|
|
744
|
+
literal: t
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
function _e() {
|
|
748
|
+
var e, t, u, c;
|
|
749
|
+
return i = null, v(), e = r, t = Le(), u = De(), c = Se(t.value, u.value), m.tokenize ? {
|
|
750
|
+
type: l.RegularExpression,
|
|
751
|
+
value: c,
|
|
752
|
+
lineNumber: F,
|
|
753
|
+
lineStart: w,
|
|
754
|
+
start: e,
|
|
755
|
+
end: r
|
|
756
|
+
} : {
|
|
757
|
+
literal: t.literal + u.literal,
|
|
758
|
+
value: c,
|
|
759
|
+
start: e,
|
|
760
|
+
end: r
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
function Ce() {
|
|
764
|
+
var e, t, u, c;
|
|
765
|
+
return v(), e = r, t = {
|
|
766
|
+
start: {
|
|
767
|
+
line: F,
|
|
768
|
+
column: r - w
|
|
769
|
+
}
|
|
770
|
+
}, u = _e(), t.end = {
|
|
771
|
+
line: F,
|
|
772
|
+
column: r - w
|
|
773
|
+
}, m.tokenize || (m.tokens.length > 0 && (c = m.tokens[m.tokens.length - 1], c.range[0] === e && c.type === "Punctuator" && (c.value === "/" || c.value === "/=") && m.tokens.pop()), m.tokens.push({
|
|
774
|
+
type: "RegularExpression",
|
|
775
|
+
value: u.literal,
|
|
776
|
+
range: [e, r],
|
|
777
|
+
loc: t
|
|
778
|
+
})), u;
|
|
779
|
+
}
|
|
780
|
+
function mt(e) {
|
|
781
|
+
return e.type === l.Identifier || e.type === l.Keyword || e.type === l.BooleanLiteral || e.type === l.NullLiteral;
|
|
782
|
+
}
|
|
783
|
+
function yt() {
|
|
784
|
+
var e, t;
|
|
785
|
+
if (e = m.tokens[m.tokens.length - 1], !e)
|
|
786
|
+
return Ce();
|
|
787
|
+
if (e.type === "Punctuator") {
|
|
788
|
+
if (e.value === "]")
|
|
789
|
+
return H();
|
|
790
|
+
if (e.value === ")")
|
|
791
|
+
return t = m.tokens[m.openParenToken - 1], t && t.type === "Keyword" && (t.value === "if" || t.value === "while" || t.value === "for" || t.value === "with") ? Ce() : H();
|
|
792
|
+
if (e.value === "}") {
|
|
793
|
+
if (m.tokens[m.openCurlyToken - 3] && m.tokens[m.openCurlyToken - 3].type === "Keyword") {
|
|
794
|
+
if (t = m.tokens[m.openCurlyToken - 4], !t)
|
|
795
|
+
return H();
|
|
796
|
+
} else if (m.tokens[m.openCurlyToken - 4] && m.tokens[m.openCurlyToken - 4].type === "Keyword") {
|
|
797
|
+
if (t = m.tokens[m.openCurlyToken - 5], !t)
|
|
798
|
+
return Ce();
|
|
799
|
+
} else
|
|
800
|
+
return H();
|
|
801
|
+
return d.indexOf(t.value) >= 0 ? H() : Ce();
|
|
802
|
+
}
|
|
803
|
+
return Ce();
|
|
804
|
+
}
|
|
805
|
+
return e.type === "Keyword" ? Ce() : H();
|
|
806
|
+
}
|
|
807
|
+
function je() {
|
|
808
|
+
var e;
|
|
809
|
+
return v(), r >= g ? {
|
|
810
|
+
type: l.EOF,
|
|
811
|
+
lineNumber: F,
|
|
812
|
+
lineStart: w,
|
|
813
|
+
start: r,
|
|
814
|
+
end: r
|
|
815
|
+
} : (e = s.charCodeAt(r), q(e) ? re() : e === 40 || e === 41 || e === 59 ? H() : e === 39 || e === 34 ? me() : e === 46 ? M(s.charCodeAt(r + 1)) ? Z() : H() : M(e) ? Z() : m.tokenize && e === 47 ? yt() : H());
|
|
816
|
+
}
|
|
817
|
+
function We() {
|
|
818
|
+
var e, t, u;
|
|
819
|
+
return v(), e = {
|
|
820
|
+
start: {
|
|
821
|
+
line: F,
|
|
822
|
+
column: r - w
|
|
823
|
+
}
|
|
824
|
+
}, t = je(), e.end = {
|
|
825
|
+
line: F,
|
|
826
|
+
column: r - w
|
|
827
|
+
}, t.type !== l.EOF && (u = s.slice(t.start, t.end), m.tokens.push({
|
|
828
|
+
type: S[t.type],
|
|
829
|
+
value: u,
|
|
830
|
+
range: [t.start, t.end],
|
|
831
|
+
loc: e
|
|
832
|
+
})), t;
|
|
833
|
+
}
|
|
834
|
+
function L() {
|
|
835
|
+
var e;
|
|
836
|
+
return e = i, r = e.end, F = e.lineNumber, w = e.lineStart, i = typeof m.tokens < "u" ? We() : je(), r = e.end, F = e.lineNumber, w = e.lineStart, e;
|
|
837
|
+
}
|
|
838
|
+
function Me() {
|
|
839
|
+
var e, t, u;
|
|
840
|
+
e = r, t = F, u = w, i = typeof m.tokens < "u" ? We() : je(), r = e, F = t, w = u;
|
|
841
|
+
}
|
|
842
|
+
function Ve(e, t) {
|
|
843
|
+
this.line = e, this.column = t;
|
|
844
|
+
}
|
|
845
|
+
function dt(e, t, u, c) {
|
|
846
|
+
this.start = new Ve(e, t), this.end = new Ve(u, c);
|
|
847
|
+
}
|
|
848
|
+
A = {
|
|
849
|
+
name: "SyntaxTree",
|
|
850
|
+
processComment: function(e) {
|
|
851
|
+
var t, u;
|
|
852
|
+
if (!(e.type === f.Program && e.body.length > 0)) {
|
|
853
|
+
for (m.trailingComments.length > 0 ? m.trailingComments[0].range[0] >= e.range[1] ? (u = m.trailingComments, m.trailingComments = []) : m.trailingComments.length = 0 : m.bottomRightStack.length > 0 && m.bottomRightStack[m.bottomRightStack.length - 1].trailingComments && m.bottomRightStack[m.bottomRightStack.length - 1].trailingComments[0].range[0] >= e.range[1] && (u = m.bottomRightStack[m.bottomRightStack.length - 1].trailingComments, delete m.bottomRightStack[m.bottomRightStack.length - 1].trailingComments); m.bottomRightStack.length > 0 && m.bottomRightStack[m.bottomRightStack.length - 1].range[0] >= e.range[0]; )
|
|
854
|
+
t = m.bottomRightStack.pop();
|
|
855
|
+
t ? t.leadingComments && t.leadingComments[t.leadingComments.length - 1].range[1] <= e.range[0] && (e.leadingComments = t.leadingComments, delete t.leadingComments) : m.leadingComments.length > 0 && m.leadingComments[m.leadingComments.length - 1].range[1] <= e.range[0] && (e.leadingComments = m.leadingComments, m.leadingComments = []), u && (e.trailingComments = u), m.bottomRightStack.push(e);
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
markEnd: function(e, t) {
|
|
859
|
+
return m.range && (e.range = [t.start, r]), m.loc && (e.loc = new dt(
|
|
860
|
+
t.startLineNumber === void 0 ? t.lineNumber : t.startLineNumber,
|
|
861
|
+
t.start - (t.startLineStart === void 0 ? t.lineStart : t.startLineStart),
|
|
862
|
+
F,
|
|
863
|
+
r - w
|
|
864
|
+
), this.postProcess(e)), m.attachComment && this.processComment(e), e;
|
|
865
|
+
},
|
|
866
|
+
postProcess: function(e) {
|
|
867
|
+
return m.source && (e.loc.source = m.source), e;
|
|
868
|
+
},
|
|
869
|
+
createArrayExpression: function(e) {
|
|
870
|
+
return {
|
|
871
|
+
type: f.ArrayExpression,
|
|
872
|
+
elements: e
|
|
873
|
+
};
|
|
874
|
+
},
|
|
875
|
+
createAssignmentExpression: function(e, t, u) {
|
|
876
|
+
return {
|
|
877
|
+
type: f.AssignmentExpression,
|
|
878
|
+
operator: e,
|
|
879
|
+
left: t,
|
|
880
|
+
right: u
|
|
881
|
+
};
|
|
882
|
+
},
|
|
883
|
+
createBinaryExpression: function(e, t, u) {
|
|
884
|
+
var c = e === "||" || e === "&&" ? f.LogicalExpression : f.BinaryExpression;
|
|
885
|
+
return {
|
|
886
|
+
type: c,
|
|
887
|
+
operator: e,
|
|
888
|
+
left: t,
|
|
889
|
+
right: u
|
|
890
|
+
};
|
|
891
|
+
},
|
|
892
|
+
createBlockStatement: function(e) {
|
|
893
|
+
return {
|
|
894
|
+
type: f.BlockStatement,
|
|
895
|
+
body: e
|
|
896
|
+
};
|
|
897
|
+
},
|
|
898
|
+
createBreakStatement: function(e) {
|
|
899
|
+
return {
|
|
900
|
+
type: f.BreakStatement,
|
|
901
|
+
label: e
|
|
902
|
+
};
|
|
903
|
+
},
|
|
904
|
+
createCallExpression: function(e, t) {
|
|
905
|
+
return {
|
|
906
|
+
type: f.CallExpression,
|
|
907
|
+
callee: e,
|
|
908
|
+
arguments: t
|
|
909
|
+
};
|
|
910
|
+
},
|
|
911
|
+
createCatchClause: function(e, t) {
|
|
912
|
+
return {
|
|
913
|
+
type: f.CatchClause,
|
|
914
|
+
param: e,
|
|
915
|
+
body: t
|
|
916
|
+
};
|
|
917
|
+
},
|
|
918
|
+
createConditionalExpression: function(e, t, u) {
|
|
919
|
+
return {
|
|
920
|
+
type: f.ConditionalExpression,
|
|
921
|
+
test: e,
|
|
922
|
+
consequent: t,
|
|
923
|
+
alternate: u
|
|
924
|
+
};
|
|
925
|
+
},
|
|
926
|
+
createContinueStatement: function(e) {
|
|
927
|
+
return {
|
|
928
|
+
type: f.ContinueStatement,
|
|
929
|
+
label: e
|
|
930
|
+
};
|
|
931
|
+
},
|
|
932
|
+
createDebuggerStatement: function() {
|
|
933
|
+
return {
|
|
934
|
+
type: f.DebuggerStatement
|
|
935
|
+
};
|
|
936
|
+
},
|
|
937
|
+
createDoWhileStatement: function(e, t) {
|
|
938
|
+
return {
|
|
939
|
+
type: f.DoWhileStatement,
|
|
940
|
+
body: e,
|
|
941
|
+
test: t
|
|
942
|
+
};
|
|
943
|
+
},
|
|
944
|
+
createEmptyStatement: function() {
|
|
945
|
+
return {
|
|
946
|
+
type: f.EmptyStatement
|
|
947
|
+
};
|
|
948
|
+
},
|
|
949
|
+
createExpressionStatement: function(e) {
|
|
950
|
+
return {
|
|
951
|
+
type: f.ExpressionStatement,
|
|
952
|
+
expression: e
|
|
953
|
+
};
|
|
954
|
+
},
|
|
955
|
+
createForStatement: function(e, t, u, c) {
|
|
956
|
+
return {
|
|
957
|
+
type: f.ForStatement,
|
|
958
|
+
init: e,
|
|
959
|
+
test: t,
|
|
960
|
+
update: u,
|
|
961
|
+
body: c
|
|
962
|
+
};
|
|
963
|
+
},
|
|
964
|
+
createForInStatement: function(e, t, u) {
|
|
965
|
+
return {
|
|
966
|
+
type: f.ForInStatement,
|
|
967
|
+
left: e,
|
|
968
|
+
right: t,
|
|
969
|
+
body: u,
|
|
970
|
+
each: !1
|
|
971
|
+
};
|
|
972
|
+
},
|
|
973
|
+
createFunctionDeclaration: function(e, t, u, c) {
|
|
974
|
+
return {
|
|
975
|
+
type: f.FunctionDeclaration,
|
|
976
|
+
id: e,
|
|
977
|
+
params: t,
|
|
978
|
+
defaults: u,
|
|
979
|
+
body: c,
|
|
980
|
+
rest: null,
|
|
981
|
+
generator: !1,
|
|
982
|
+
expression: !1
|
|
983
|
+
};
|
|
984
|
+
},
|
|
985
|
+
createFunctionExpression: function(e, t, u, c) {
|
|
986
|
+
return {
|
|
987
|
+
type: f.FunctionExpression,
|
|
988
|
+
id: e,
|
|
989
|
+
params: t,
|
|
990
|
+
defaults: u,
|
|
991
|
+
body: c,
|
|
992
|
+
rest: null,
|
|
993
|
+
generator: !1,
|
|
994
|
+
expression: !1
|
|
995
|
+
};
|
|
996
|
+
},
|
|
997
|
+
createIdentifier: function(e) {
|
|
998
|
+
return {
|
|
999
|
+
type: f.Identifier,
|
|
1000
|
+
name: e
|
|
1001
|
+
};
|
|
1002
|
+
},
|
|
1003
|
+
createIfStatement: function(e, t, u) {
|
|
1004
|
+
return {
|
|
1005
|
+
type: f.IfStatement,
|
|
1006
|
+
test: e,
|
|
1007
|
+
consequent: t,
|
|
1008
|
+
alternate: u
|
|
1009
|
+
};
|
|
1010
|
+
},
|
|
1011
|
+
createLabeledStatement: function(e, t) {
|
|
1012
|
+
return {
|
|
1013
|
+
type: f.LabeledStatement,
|
|
1014
|
+
label: e,
|
|
1015
|
+
body: t
|
|
1016
|
+
};
|
|
1017
|
+
},
|
|
1018
|
+
createLiteral: function(e) {
|
|
1019
|
+
return {
|
|
1020
|
+
type: f.Literal,
|
|
1021
|
+
value: e.value,
|
|
1022
|
+
raw: s.slice(e.start, e.end)
|
|
1023
|
+
};
|
|
1024
|
+
},
|
|
1025
|
+
createMemberExpression: function(e, t, u) {
|
|
1026
|
+
return {
|
|
1027
|
+
type: f.MemberExpression,
|
|
1028
|
+
computed: e === "[",
|
|
1029
|
+
object: t,
|
|
1030
|
+
property: u
|
|
1031
|
+
};
|
|
1032
|
+
},
|
|
1033
|
+
createNewExpression: function(e, t) {
|
|
1034
|
+
return {
|
|
1035
|
+
type: f.NewExpression,
|
|
1036
|
+
callee: e,
|
|
1037
|
+
arguments: t
|
|
1038
|
+
};
|
|
1039
|
+
},
|
|
1040
|
+
createObjectExpression: function(e) {
|
|
1041
|
+
return {
|
|
1042
|
+
type: f.ObjectExpression,
|
|
1043
|
+
properties: e
|
|
1044
|
+
};
|
|
1045
|
+
},
|
|
1046
|
+
createPostfixExpression: function(e, t) {
|
|
1047
|
+
return {
|
|
1048
|
+
type: f.UpdateExpression,
|
|
1049
|
+
operator: e,
|
|
1050
|
+
argument: t,
|
|
1051
|
+
prefix: !1
|
|
1052
|
+
};
|
|
1053
|
+
},
|
|
1054
|
+
createProgram: function(e) {
|
|
1055
|
+
return {
|
|
1056
|
+
type: f.Program,
|
|
1057
|
+
body: e
|
|
1058
|
+
};
|
|
1059
|
+
},
|
|
1060
|
+
createProperty: function(e, t, u) {
|
|
1061
|
+
return {
|
|
1062
|
+
type: f.Property,
|
|
1063
|
+
key: t,
|
|
1064
|
+
value: u,
|
|
1065
|
+
kind: e
|
|
1066
|
+
};
|
|
1067
|
+
},
|
|
1068
|
+
createReturnStatement: function(e) {
|
|
1069
|
+
return {
|
|
1070
|
+
type: f.ReturnStatement,
|
|
1071
|
+
argument: e
|
|
1072
|
+
};
|
|
1073
|
+
},
|
|
1074
|
+
createSequenceExpression: function(e) {
|
|
1075
|
+
return {
|
|
1076
|
+
type: f.SequenceExpression,
|
|
1077
|
+
expressions: e
|
|
1078
|
+
};
|
|
1079
|
+
},
|
|
1080
|
+
createSwitchCase: function(e, t) {
|
|
1081
|
+
return {
|
|
1082
|
+
type: f.SwitchCase,
|
|
1083
|
+
test: e,
|
|
1084
|
+
consequent: t
|
|
1085
|
+
};
|
|
1086
|
+
},
|
|
1087
|
+
createSwitchStatement: function(e, t) {
|
|
1088
|
+
return {
|
|
1089
|
+
type: f.SwitchStatement,
|
|
1090
|
+
discriminant: e,
|
|
1091
|
+
cases: t
|
|
1092
|
+
};
|
|
1093
|
+
},
|
|
1094
|
+
createThisExpression: function() {
|
|
1095
|
+
return {
|
|
1096
|
+
type: f.ThisExpression
|
|
1097
|
+
};
|
|
1098
|
+
},
|
|
1099
|
+
createThrowStatement: function(e) {
|
|
1100
|
+
return {
|
|
1101
|
+
type: f.ThrowStatement,
|
|
1102
|
+
argument: e
|
|
1103
|
+
};
|
|
1104
|
+
},
|
|
1105
|
+
createTryStatement: function(e, t, u, c) {
|
|
1106
|
+
return {
|
|
1107
|
+
type: f.TryStatement,
|
|
1108
|
+
block: e,
|
|
1109
|
+
guardedHandlers: t,
|
|
1110
|
+
handlers: u,
|
|
1111
|
+
finalizer: c
|
|
1112
|
+
};
|
|
1113
|
+
},
|
|
1114
|
+
createUnaryExpression: function(e, t) {
|
|
1115
|
+
return e === "++" || e === "--" ? {
|
|
1116
|
+
type: f.UpdateExpression,
|
|
1117
|
+
operator: e,
|
|
1118
|
+
argument: t,
|
|
1119
|
+
prefix: !0
|
|
1120
|
+
} : {
|
|
1121
|
+
type: f.UnaryExpression,
|
|
1122
|
+
operator: e,
|
|
1123
|
+
argument: t,
|
|
1124
|
+
prefix: !0
|
|
1125
|
+
};
|
|
1126
|
+
},
|
|
1127
|
+
createVariableDeclaration: function(e, t) {
|
|
1128
|
+
return {
|
|
1129
|
+
type: f.VariableDeclaration,
|
|
1130
|
+
declarations: e,
|
|
1131
|
+
kind: t
|
|
1132
|
+
};
|
|
1133
|
+
},
|
|
1134
|
+
createVariableDeclarator: function(e, t) {
|
|
1135
|
+
return {
|
|
1136
|
+
type: f.VariableDeclarator,
|
|
1137
|
+
id: e,
|
|
1138
|
+
init: t
|
|
1139
|
+
};
|
|
1140
|
+
},
|
|
1141
|
+
createWhileStatement: function(e, t) {
|
|
1142
|
+
return {
|
|
1143
|
+
type: f.WhileStatement,
|
|
1144
|
+
test: e,
|
|
1145
|
+
body: t
|
|
1146
|
+
};
|
|
1147
|
+
},
|
|
1148
|
+
createWithStatement: function(e, t) {
|
|
1149
|
+
return {
|
|
1150
|
+
type: f.WithStatement,
|
|
1151
|
+
object: e,
|
|
1152
|
+
body: t
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
function xe() {
|
|
1157
|
+
var e, t, u, c;
|
|
1158
|
+
return e = r, t = F, u = w, v(), c = F !== t, r = e, F = t, w = u, c;
|
|
1159
|
+
}
|
|
1160
|
+
function j(e, t) {
|
|
1161
|
+
var u, c = Array.prototype.slice.call(arguments, 2), b = t.replace(
|
|
1162
|
+
/%(\d)/g,
|
|
1163
|
+
function(I, U) {
|
|
1164
|
+
return O(U < c.length, "Message reference must be in range"), c[U];
|
|
1165
|
+
}
|
|
1166
|
+
);
|
|
1167
|
+
throw typeof e.lineNumber == "number" ? (u = new Error("Line " + e.lineNumber + ": " + b), u.index = e.start, u.lineNumber = e.lineNumber, u.column = e.start - w + 1) : (u = new Error("Line " + F + ": " + b), u.index = r, u.lineNumber = F, u.column = r - w + 1), u.description = b, u;
|
|
1168
|
+
}
|
|
1169
|
+
function V() {
|
|
1170
|
+
try {
|
|
1171
|
+
j.apply(null, arguments);
|
|
1172
|
+
} catch (e) {
|
|
1173
|
+
if (m.errors)
|
|
1174
|
+
m.errors.push(e);
|
|
1175
|
+
else
|
|
1176
|
+
throw e;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
function ye(e) {
|
|
1180
|
+
if (e.type === l.EOF && j(e, a.UnexpectedEOS), e.type === l.NumericLiteral && j(e, a.UnexpectedNumber), e.type === l.StringLiteral && j(e, a.UnexpectedString), e.type === l.Identifier && j(e, a.UnexpectedIdentifier), e.type === l.Keyword) {
|
|
1181
|
+
if (ce(e.value))
|
|
1182
|
+
j(e, a.UnexpectedReserved);
|
|
1183
|
+
else if (p && ee(e.value)) {
|
|
1184
|
+
V(e, a.StrictReservedWord);
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
j(e, a.UnexpectedToken, e.value);
|
|
1188
|
+
}
|
|
1189
|
+
j(e, a.UnexpectedToken, e.value);
|
|
1190
|
+
}
|
|
1191
|
+
function R(e) {
|
|
1192
|
+
var t = L();
|
|
1193
|
+
(t.type !== l.Punctuator || t.value !== e) && ye(t);
|
|
1194
|
+
}
|
|
1195
|
+
function te(e) {
|
|
1196
|
+
var t = L();
|
|
1197
|
+
(t.type !== l.Keyword || t.value !== e) && ye(t);
|
|
1198
|
+
}
|
|
1199
|
+
function N(e) {
|
|
1200
|
+
return i.type === l.Punctuator && i.value === e;
|
|
1201
|
+
}
|
|
1202
|
+
function ie(e) {
|
|
1203
|
+
return i.type === l.Keyword && i.value === e;
|
|
1204
|
+
}
|
|
1205
|
+
function At() {
|
|
1206
|
+
var e;
|
|
1207
|
+
return i.type !== l.Punctuator ? !1 : (e = i.value, e === "=" || e === "*=" || e === "/=" || e === "%=" || e === "+=" || e === "-=" || e === "<<=" || e === ">>=" || e === ">>>=" || e === "&=" || e === "^=" || e === "|=");
|
|
1208
|
+
}
|
|
1209
|
+
function de() {
|
|
1210
|
+
var e;
|
|
1211
|
+
if (s.charCodeAt(r) === 59 || N(";")) {
|
|
1212
|
+
L();
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
e = F, v(), F === e && i.type !== l.EOF && !N("}") && ye(i);
|
|
1216
|
+
}
|
|
1217
|
+
function Oe(e) {
|
|
1218
|
+
return e.type === f.Identifier || e.type === f.MemberExpression;
|
|
1219
|
+
}
|
|
1220
|
+
function Et() {
|
|
1221
|
+
var e = [], t;
|
|
1222
|
+
for (t = i, R("["); !N("]"); )
|
|
1223
|
+
N(",") ? (L(), e.push(null)) : (e.push(he()), N("]") || R(","));
|
|
1224
|
+
return L(), n.markEnd(n.createArrayExpression(e), t);
|
|
1225
|
+
}
|
|
1226
|
+
function Ue(e, t) {
|
|
1227
|
+
var u, c, b;
|
|
1228
|
+
return u = p, b = i, c = ze(), t && p && Y(e[0].name) && V(t, a.StrictParamName), p = u, n.markEnd(n.createFunctionExpression(null, e, [], c), b);
|
|
1229
|
+
}
|
|
1230
|
+
function Te() {
|
|
1231
|
+
var e, t;
|
|
1232
|
+
return t = i, e = L(), e.type === l.StringLiteral || e.type === l.NumericLiteral ? (p && e.octal && V(e, a.StrictOctalLiteral), n.markEnd(n.createLiteral(e), t)) : n.markEnd(n.createIdentifier(e.value), t);
|
|
1233
|
+
}
|
|
1234
|
+
function gt() {
|
|
1235
|
+
var e, t, u, c, b, I;
|
|
1236
|
+
if (e = i, I = i, e.type === l.Identifier)
|
|
1237
|
+
return u = Te(), e.value === "get" && !N(":") ? (t = Te(), R("("), R(")"), c = Ue([]), n.markEnd(n.createProperty("get", t, c), I)) : e.value === "set" && !N(":") ? (t = Te(), R("("), e = i, e.type !== l.Identifier ? (R(")"), V(e, a.UnexpectedToken, e.value), c = Ue([])) : (b = [ge()], R(")"), c = Ue(b, e)), n.markEnd(n.createProperty("set", t, c), I)) : (R(":"), c = he(), n.markEnd(n.createProperty("init", u, c), I));
|
|
1238
|
+
if (e.type === l.EOF || e.type === l.Punctuator)
|
|
1239
|
+
ye(e);
|
|
1240
|
+
else
|
|
1241
|
+
return t = Te(), R(":"), c = he(), n.markEnd(n.createProperty("init", t, c), I);
|
|
1242
|
+
}
|
|
1243
|
+
function Ct() {
|
|
1244
|
+
var e = [], t, u, c, b, I = {}, U = String, X;
|
|
1245
|
+
for (X = i, R("{"); !N("}"); )
|
|
1246
|
+
t = gt(), t.key.type === f.Identifier ? u = t.key.name : u = U(t.key.value), b = t.kind === "init" ? h.Data : t.kind === "get" ? h.Get : h.Set, c = "$" + u, Object.prototype.hasOwnProperty.call(I, c) ? (I[c] === h.Data ? p && b === h.Data ? V({}, a.StrictDuplicateProperty) : b !== h.Data && V({}, a.AccessorDataProperty) : b === h.Data ? V({}, a.AccessorDataProperty) : I[c] & b && V({}, a.AccessorGetSet), I[c] |= b) : I[c] = b, e.push(t), N("}") || R(",");
|
|
1247
|
+
return R("}"), n.markEnd(n.createObjectExpression(e), X);
|
|
1248
|
+
}
|
|
1249
|
+
function vt() {
|
|
1250
|
+
var e;
|
|
1251
|
+
return R("("), e = ne(), R(")"), e;
|
|
1252
|
+
}
|
|
1253
|
+
function Xe() {
|
|
1254
|
+
var e, t, u, c;
|
|
1255
|
+
if (N("("))
|
|
1256
|
+
return vt();
|
|
1257
|
+
if (N("["))
|
|
1258
|
+
return Et();
|
|
1259
|
+
if (N("{"))
|
|
1260
|
+
return Ct();
|
|
1261
|
+
if (e = i.type, c = i, e === l.Identifier)
|
|
1262
|
+
u = n.createIdentifier(L().value);
|
|
1263
|
+
else if (e === l.StringLiteral || e === l.NumericLiteral)
|
|
1264
|
+
p && i.octal && V(i, a.StrictOctalLiteral), u = n.createLiteral(L());
|
|
1265
|
+
else if (e === l.Keyword) {
|
|
1266
|
+
if (ie("function"))
|
|
1267
|
+
return Xt();
|
|
1268
|
+
ie("this") ? (L(), u = n.createThisExpression()) : ye(L());
|
|
1269
|
+
} else e === l.BooleanLiteral ? (t = L(), t.value = t.value === "true", u = n.createLiteral(t)) : e === l.NullLiteral ? (t = L(), t.value = null, u = n.createLiteral(t)) : N("/") || N("/=") ? (typeof m.tokens < "u" ? u = n.createLiteral(Ce()) : u = n.createLiteral(_e()), Me()) : ye(L());
|
|
1270
|
+
return n.markEnd(u, c);
|
|
1271
|
+
}
|
|
1272
|
+
function Ke() {
|
|
1273
|
+
var e = [];
|
|
1274
|
+
if (R("("), !N(")"))
|
|
1275
|
+
for (; r < g && (e.push(he()), !N(")")); )
|
|
1276
|
+
R(",");
|
|
1277
|
+
return R(")"), e;
|
|
1278
|
+
}
|
|
1279
|
+
function St() {
|
|
1280
|
+
var e, t;
|
|
1281
|
+
return t = i, e = L(), mt(e) || ye(e), n.markEnd(n.createIdentifier(e.value), t);
|
|
1282
|
+
}
|
|
1283
|
+
function Je() {
|
|
1284
|
+
return R("."), St();
|
|
1285
|
+
}
|
|
1286
|
+
function Qe() {
|
|
1287
|
+
var e;
|
|
1288
|
+
return R("["), e = ne(), R("]"), e;
|
|
1289
|
+
}
|
|
1290
|
+
function Ye() {
|
|
1291
|
+
var e, t, u;
|
|
1292
|
+
return u = i, te("new"), e = bt(), t = N("(") ? Ke() : [], n.markEnd(n.createNewExpression(e, t), u);
|
|
1293
|
+
}
|
|
1294
|
+
function Ft() {
|
|
1295
|
+
var e, t, u, c, b;
|
|
1296
|
+
for (b = i, e = y.allowIn, y.allowIn = !0, t = ie("new") ? Ye() : Xe(), y.allowIn = e; ; ) {
|
|
1297
|
+
if (N("."))
|
|
1298
|
+
c = Je(), t = n.createMemberExpression(".", t, c);
|
|
1299
|
+
else if (N("("))
|
|
1300
|
+
u = Ke(), t = n.createCallExpression(t, u);
|
|
1301
|
+
else if (N("["))
|
|
1302
|
+
c = Qe(), t = n.createMemberExpression("[", t, c);
|
|
1303
|
+
else
|
|
1304
|
+
break;
|
|
1305
|
+
n.markEnd(t, b);
|
|
1306
|
+
}
|
|
1307
|
+
return t;
|
|
1308
|
+
}
|
|
1309
|
+
function bt() {
|
|
1310
|
+
var e, t, u, c;
|
|
1311
|
+
for (c = i, e = y.allowIn, t = ie("new") ? Ye() : Xe(), y.allowIn = e; N(".") || N("["); )
|
|
1312
|
+
N("[") ? (u = Qe(), t = n.createMemberExpression("[", t, u)) : (u = Je(), t = n.createMemberExpression(".", t, u)), n.markEnd(t, c);
|
|
1313
|
+
return t;
|
|
1314
|
+
}
|
|
1315
|
+
function Ze() {
|
|
1316
|
+
var e, t, u = i;
|
|
1317
|
+
return e = Ft(), i.type === l.Punctuator && (N("++") || N("--")) && !xe() && (p && e.type === f.Identifier && Y(e.name) && V({}, a.StrictLHSPostfix), Oe(e) || V({}, a.InvalidLHSInAssignment), t = L(), e = n.markEnd(n.createPostfixExpression(t.value, e), u)), e;
|
|
1318
|
+
}
|
|
1319
|
+
function Fe() {
|
|
1320
|
+
var e, t, u;
|
|
1321
|
+
return i.type !== l.Punctuator && i.type !== l.Keyword ? t = Ze() : N("++") || N("--") ? (u = i, e = L(), t = Fe(), p && t.type === f.Identifier && Y(t.name) && V({}, a.StrictLHSPrefix), Oe(t) || V({}, a.InvalidLHSInAssignment), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u)) : N("+") || N("-") || N("~") || N("!") ? (u = i, e = L(), t = Fe(), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u)) : ie("delete") || ie("void") || ie("typeof") ? (u = i, e = L(), t = Fe(), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u), p && t.operator === "delete" && t.argument.type === f.Identifier && V({}, a.StrictDelete)) : t = Ze(), t;
|
|
1322
|
+
}
|
|
1323
|
+
function et(e, t) {
|
|
1324
|
+
var u = 0;
|
|
1325
|
+
if (e.type !== l.Punctuator && e.type !== l.Keyword)
|
|
1326
|
+
return 0;
|
|
1327
|
+
switch (e.value) {
|
|
1328
|
+
case "||":
|
|
1329
|
+
u = 1;
|
|
1330
|
+
break;
|
|
1331
|
+
case "&&":
|
|
1332
|
+
u = 2;
|
|
1333
|
+
break;
|
|
1334
|
+
case "|":
|
|
1335
|
+
u = 3;
|
|
1336
|
+
break;
|
|
1337
|
+
case "^":
|
|
1338
|
+
u = 4;
|
|
1339
|
+
break;
|
|
1340
|
+
case "&":
|
|
1341
|
+
u = 5;
|
|
1342
|
+
break;
|
|
1343
|
+
case "==":
|
|
1344
|
+
case "!=":
|
|
1345
|
+
case "===":
|
|
1346
|
+
case "!==":
|
|
1347
|
+
u = 6;
|
|
1348
|
+
break;
|
|
1349
|
+
case "<":
|
|
1350
|
+
case ">":
|
|
1351
|
+
case "<=":
|
|
1352
|
+
case ">=":
|
|
1353
|
+
case "instanceof":
|
|
1354
|
+
u = 7;
|
|
1355
|
+
break;
|
|
1356
|
+
case "in":
|
|
1357
|
+
u = t ? 7 : 0;
|
|
1358
|
+
break;
|
|
1359
|
+
case "<<":
|
|
1360
|
+
case ">>":
|
|
1361
|
+
case ">>>":
|
|
1362
|
+
u = 8;
|
|
1363
|
+
break;
|
|
1364
|
+
case "+":
|
|
1365
|
+
case "-":
|
|
1366
|
+
u = 9;
|
|
1367
|
+
break;
|
|
1368
|
+
case "*":
|
|
1369
|
+
case "/":
|
|
1370
|
+
case "%":
|
|
1371
|
+
u = 11;
|
|
1372
|
+
break;
|
|
1373
|
+
}
|
|
1374
|
+
return u;
|
|
1375
|
+
}
|
|
1376
|
+
function Dt() {
|
|
1377
|
+
var e, t, u, c, b, I, U, X, ae, ue;
|
|
1378
|
+
if (e = i, ae = Fe(), c = i, b = et(c, y.allowIn), b === 0)
|
|
1379
|
+
return ae;
|
|
1380
|
+
for (c.prec = b, L(), t = [e, i], U = Fe(), I = [ae, c, U]; (b = et(i, y.allowIn)) > 0; ) {
|
|
1381
|
+
for (; I.length > 2 && b <= I[I.length - 2].prec; )
|
|
1382
|
+
U = I.pop(), X = I.pop().value, ae = I.pop(), u = n.createBinaryExpression(X, ae, U), t.pop(), e = t[t.length - 1], n.markEnd(u, e), I.push(u);
|
|
1383
|
+
c = L(), c.prec = b, I.push(c), t.push(i), u = Fe(), I.push(u);
|
|
1384
|
+
}
|
|
1385
|
+
for (ue = I.length - 1, u = I[ue], t.pop(); ue > 1; )
|
|
1386
|
+
u = n.createBinaryExpression(I[ue - 1].value, I[ue - 2], u), ue -= 2, e = t.pop(), n.markEnd(u, e);
|
|
1387
|
+
return u;
|
|
1388
|
+
}
|
|
1389
|
+
function xt() {
|
|
1390
|
+
var e, t, u, c, b;
|
|
1391
|
+
return b = i, e = Dt(), N("?") && (L(), t = y.allowIn, y.allowIn = !0, u = he(), y.allowIn = t, R(":"), c = he(), e = n.createConditionalExpression(e, u, c), n.markEnd(e, b)), e;
|
|
1392
|
+
}
|
|
1393
|
+
function he() {
|
|
1394
|
+
var e, t, u, c, b;
|
|
1395
|
+
return e = i, b = i, c = t = xt(), At() && (Oe(t) || V({}, a.InvalidLHSInAssignment), p && t.type === f.Identifier && Y(t.name) && V(e, a.StrictLHSAssignment), e = L(), u = he(), c = n.markEnd(n.createAssignmentExpression(e.value, t, u), b)), c;
|
|
1396
|
+
}
|
|
1397
|
+
function ne() {
|
|
1398
|
+
var e, t = i;
|
|
1399
|
+
if (e = he(), N(",")) {
|
|
1400
|
+
for (e = n.createSequenceExpression([e]); r < g && N(","); )
|
|
1401
|
+
L(), e.expressions.push(he());
|
|
1402
|
+
n.markEnd(e, t);
|
|
1403
|
+
}
|
|
1404
|
+
return e;
|
|
1405
|
+
}
|
|
1406
|
+
function Bt() {
|
|
1407
|
+
for (var e = [], t; r < g && !(N("}") || (t = Be(), typeof t > "u")); )
|
|
1408
|
+
e.push(t);
|
|
1409
|
+
return e;
|
|
1410
|
+
}
|
|
1411
|
+
function Pe() {
|
|
1412
|
+
var e, t;
|
|
1413
|
+
return t = i, R("{"), e = Bt(), R("}"), n.markEnd(n.createBlockStatement(e), t);
|
|
1414
|
+
}
|
|
1415
|
+
function ge() {
|
|
1416
|
+
var e, t;
|
|
1417
|
+
return t = i, e = L(), e.type !== l.Identifier && ye(e), n.markEnd(n.createIdentifier(e.value), t);
|
|
1418
|
+
}
|
|
1419
|
+
function kt(e) {
|
|
1420
|
+
var t = null, u, c;
|
|
1421
|
+
return c = i, u = ge(), p && Y(u.name) && V({}, a.StrictVarName), e === "const" ? (R("="), t = he()) : N("=") && (L(), t = he()), n.markEnd(n.createVariableDeclarator(u, t), c);
|
|
1422
|
+
}
|
|
1423
|
+
function $e(e) {
|
|
1424
|
+
var t = [];
|
|
1425
|
+
do {
|
|
1426
|
+
if (t.push(kt(e)), !N(","))
|
|
1427
|
+
break;
|
|
1428
|
+
L();
|
|
1429
|
+
} while (r < g);
|
|
1430
|
+
return t;
|
|
1431
|
+
}
|
|
1432
|
+
function wt() {
|
|
1433
|
+
var e;
|
|
1434
|
+
return te("var"), e = $e(), de(), n.createVariableDeclaration(e, "var");
|
|
1435
|
+
}
|
|
1436
|
+
function It(e) {
|
|
1437
|
+
var t, u;
|
|
1438
|
+
return u = i, te(e), t = $e(e), de(), n.markEnd(n.createVariableDeclaration(t, e), u);
|
|
1439
|
+
}
|
|
1440
|
+
function _t() {
|
|
1441
|
+
return R(";"), n.createEmptyStatement();
|
|
1442
|
+
}
|
|
1443
|
+
function Ot() {
|
|
1444
|
+
var e = ne();
|
|
1445
|
+
return de(), n.createExpressionStatement(e);
|
|
1446
|
+
}
|
|
1447
|
+
function Tt() {
|
|
1448
|
+
var e, t, u;
|
|
1449
|
+
return te("if"), R("("), e = ne(), R(")"), t = Ae(), ie("else") ? (L(), u = Ae()) : u = null, n.createIfStatement(e, t, u);
|
|
1450
|
+
}
|
|
1451
|
+
function Pt() {
|
|
1452
|
+
var e, t, u;
|
|
1453
|
+
return te("do"), u = y.inIteration, y.inIteration = !0, e = Ae(), y.inIteration = u, te("while"), R("("), t = ne(), R(")"), N(";") && L(), n.createDoWhileStatement(e, t);
|
|
1454
|
+
}
|
|
1455
|
+
function Nt() {
|
|
1456
|
+
var e, t, u;
|
|
1457
|
+
return te("while"), R("("), e = ne(), R(")"), u = y.inIteration, y.inIteration = !0, t = Ae(), y.inIteration = u, n.createWhileStatement(e, t);
|
|
1458
|
+
}
|
|
1459
|
+
function Rt() {
|
|
1460
|
+
var e, t, u;
|
|
1461
|
+
return u = i, e = L(), t = $e(), n.markEnd(n.createVariableDeclaration(t, e.value), u);
|
|
1462
|
+
}
|
|
1463
|
+
function Lt() {
|
|
1464
|
+
var e, t, u, c, b, I, U;
|
|
1465
|
+
return e = t = u = null, te("for"), R("("), N(";") ? L() : (ie("var") || ie("let") ? (y.allowIn = !1, e = Rt(), y.allowIn = !0, e.declarations.length === 1 && ie("in") && (L(), c = e, b = ne(), e = null)) : (y.allowIn = !1, e = ne(), y.allowIn = !0, ie("in") && (Oe(e) || V({}, a.InvalidLHSInForIn), L(), c = e, b = ne(), e = null)), typeof c > "u" && R(";")), typeof c > "u" && (N(";") || (t = ne()), R(";"), N(")") || (u = ne())), R(")"), U = y.inIteration, y.inIteration = !0, I = Ae(), y.inIteration = U, typeof c > "u" ? n.createForStatement(e, t, u, I) : n.createForInStatement(c, b, I);
|
|
1466
|
+
}
|
|
1467
|
+
function jt() {
|
|
1468
|
+
var e = null, t;
|
|
1469
|
+
return te("continue"), s.charCodeAt(r) === 59 ? (L(), y.inIteration || j({}, a.IllegalContinue), n.createContinueStatement(null)) : xe() ? (y.inIteration || j({}, a.IllegalContinue), n.createContinueStatement(null)) : (i.type === l.Identifier && (e = ge(), t = "$" + e.name, Object.prototype.hasOwnProperty.call(y.labelSet, t) || j({}, a.UnknownLabel, e.name)), de(), e === null && !y.inIteration && j({}, a.IllegalContinue), n.createContinueStatement(e));
|
|
1470
|
+
}
|
|
1471
|
+
function Mt() {
|
|
1472
|
+
var e = null, t;
|
|
1473
|
+
return te("break"), s.charCodeAt(r) === 59 ? (L(), y.inIteration || y.inSwitch || j({}, a.IllegalBreak), n.createBreakStatement(null)) : xe() ? (y.inIteration || y.inSwitch || j({}, a.IllegalBreak), n.createBreakStatement(null)) : (i.type === l.Identifier && (e = ge(), t = "$" + e.name, Object.prototype.hasOwnProperty.call(y.labelSet, t) || j({}, a.UnknownLabel, e.name)), de(), e === null && !(y.inIteration || y.inSwitch) && j({}, a.IllegalBreak), n.createBreakStatement(e));
|
|
1474
|
+
}
|
|
1475
|
+
function Ut() {
|
|
1476
|
+
var e = null;
|
|
1477
|
+
return te("return"), y.inFunctionBody || V({}, a.IllegalReturn), s.charCodeAt(r) === 32 && q(s.charCodeAt(r + 1)) ? (e = ne(), de(), n.createReturnStatement(e)) : xe() ? n.createReturnStatement(null) : (N(";") || !N("}") && i.type !== l.EOF && (e = ne()), de(), n.createReturnStatement(e));
|
|
1478
|
+
}
|
|
1479
|
+
function $t() {
|
|
1480
|
+
var e, t;
|
|
1481
|
+
return p && (v(), V({}, a.StrictModeWith)), te("with"), R("("), e = ne(), R(")"), t = Ae(), n.createWithStatement(e, t);
|
|
1482
|
+
}
|
|
1483
|
+
function zt() {
|
|
1484
|
+
var e, t = [], u, c;
|
|
1485
|
+
for (c = i, ie("default") ? (L(), e = null) : (te("case"), e = ne()), R(":"); r < g && !(N("}") || ie("default") || ie("case")); )
|
|
1486
|
+
u = Ae(), t.push(u);
|
|
1487
|
+
return n.markEnd(n.createSwitchCase(e, t), c);
|
|
1488
|
+
}
|
|
1489
|
+
function Ht() {
|
|
1490
|
+
var e, t, u, c, b;
|
|
1491
|
+
if (te("switch"), R("("), e = ne(), R(")"), R("{"), t = [], N("}"))
|
|
1492
|
+
return L(), n.createSwitchStatement(e, t);
|
|
1493
|
+
for (c = y.inSwitch, y.inSwitch = !0, b = !1; r < g && !N("}"); )
|
|
1494
|
+
u = zt(), u.test === null && (b && j({}, a.MultipleDefaultsInSwitch), b = !0), t.push(u);
|
|
1495
|
+
return y.inSwitch = c, R("}"), n.createSwitchStatement(e, t);
|
|
1496
|
+
}
|
|
1497
|
+
function qt() {
|
|
1498
|
+
var e;
|
|
1499
|
+
return te("throw"), xe() && j({}, a.NewlineAfterThrow), e = ne(), de(), n.createThrowStatement(e);
|
|
1500
|
+
}
|
|
1501
|
+
function Gt() {
|
|
1502
|
+
var e, t, u;
|
|
1503
|
+
return u = i, te("catch"), R("("), N(")") && ye(i), e = ge(), p && Y(e.name) && V({}, a.StrictCatchVariable), R(")"), t = Pe(), n.markEnd(n.createCatchClause(e, t), u);
|
|
1504
|
+
}
|
|
1505
|
+
function Wt() {
|
|
1506
|
+
var e, t = [], u = null;
|
|
1507
|
+
return te("try"), e = Pe(), ie("catch") && t.push(Gt()), ie("finally") && (L(), u = Pe()), t.length === 0 && !u && j({}, a.NoCatchOrFinally), n.createTryStatement(e, [], t, u);
|
|
1508
|
+
}
|
|
1509
|
+
function Vt() {
|
|
1510
|
+
return te("debugger"), de(), n.createDebuggerStatement();
|
|
1511
|
+
}
|
|
1512
|
+
function Ae() {
|
|
1513
|
+
var e = i.type, t, u, c, b;
|
|
1514
|
+
if (e === l.EOF && ye(i), e === l.Punctuator && i.value === "{")
|
|
1515
|
+
return Pe();
|
|
1516
|
+
if (b = i, e === l.Punctuator)
|
|
1517
|
+
switch (i.value) {
|
|
1518
|
+
case ";":
|
|
1519
|
+
return n.markEnd(_t(), b);
|
|
1520
|
+
case "(":
|
|
1521
|
+
return n.markEnd(Ot(), b);
|
|
1522
|
+
}
|
|
1523
|
+
if (e === l.Keyword)
|
|
1524
|
+
switch (i.value) {
|
|
1525
|
+
case "break":
|
|
1526
|
+
return n.markEnd(Mt(), b);
|
|
1527
|
+
case "continue":
|
|
1528
|
+
return n.markEnd(jt(), b);
|
|
1529
|
+
case "debugger":
|
|
1530
|
+
return n.markEnd(Vt(), b);
|
|
1531
|
+
case "do":
|
|
1532
|
+
return n.markEnd(Pt(), b);
|
|
1533
|
+
case "for":
|
|
1534
|
+
return n.markEnd(Lt(), b);
|
|
1535
|
+
case "function":
|
|
1536
|
+
return n.markEnd(rt(), b);
|
|
1537
|
+
case "if":
|
|
1538
|
+
return n.markEnd(Tt(), b);
|
|
1539
|
+
case "return":
|
|
1540
|
+
return n.markEnd(Ut(), b);
|
|
1541
|
+
case "switch":
|
|
1542
|
+
return n.markEnd(Ht(), b);
|
|
1543
|
+
case "throw":
|
|
1544
|
+
return n.markEnd(qt(), b);
|
|
1545
|
+
case "try":
|
|
1546
|
+
return n.markEnd(Wt(), b);
|
|
1547
|
+
case "var":
|
|
1548
|
+
return n.markEnd(wt(), b);
|
|
1549
|
+
case "while":
|
|
1550
|
+
return n.markEnd(Nt(), b);
|
|
1551
|
+
case "with":
|
|
1552
|
+
return n.markEnd($t(), b);
|
|
1553
|
+
}
|
|
1554
|
+
return t = ne(), t.type === f.Identifier && N(":") ? (L(), c = "$" + t.name, Object.prototype.hasOwnProperty.call(y.labelSet, c) && j({}, a.Redeclaration, "Label", t.name), y.labelSet[c] = !0, u = Ae(), delete y.labelSet[c], n.markEnd(n.createLabeledStatement(t, u), b)) : (de(), n.markEnd(n.createExpressionStatement(t), b));
|
|
1555
|
+
}
|
|
1556
|
+
function ze() {
|
|
1557
|
+
var e, t = [], u, c, b, I, U, X, ae, ue;
|
|
1558
|
+
for (ue = i, R("{"); r < g && !(i.type !== l.StringLiteral || (u = i, e = Be(), t.push(e), e.expression.type !== f.Literal)); )
|
|
1559
|
+
c = s.slice(u.start + 1, u.end - 1), c === "use strict" ? (p = !0, b && V(b, a.StrictOctalLiteral)) : !b && u.octal && (b = u);
|
|
1560
|
+
for (I = y.labelSet, U = y.inIteration, X = y.inSwitch, ae = y.inFunctionBody, y.labelSet = {}, y.inIteration = !1, y.inSwitch = !1, y.inFunctionBody = !0; r < g && !(N("}") || (e = Be(), typeof e > "u")); )
|
|
1561
|
+
t.push(e);
|
|
1562
|
+
return R("}"), y.labelSet = I, y.inIteration = U, y.inSwitch = X, y.inFunctionBody = ae, n.markEnd(n.createBlockStatement(t), ue);
|
|
1563
|
+
}
|
|
1564
|
+
function tt(e) {
|
|
1565
|
+
var t, u = [], c, b, I, U, X;
|
|
1566
|
+
if (R("("), !N(")"))
|
|
1567
|
+
for (I = {}; r < g && (c = i, t = ge(), U = "$" + c.value, p ? (Y(c.value) && (b = c, X = a.StrictParamName), Object.prototype.hasOwnProperty.call(I, U) && (b = c, X = a.StrictParamDupe)) : e || (Y(c.value) ? (e = c, X = a.StrictParamName) : ee(c.value) ? (e = c, X = a.StrictReservedWord) : Object.prototype.hasOwnProperty.call(I, U) && (e = c, X = a.StrictParamDupe)), u.push(t), I[U] = !0, !N(")")); )
|
|
1568
|
+
R(",");
|
|
1569
|
+
return R(")"), {
|
|
1570
|
+
params: u,
|
|
1571
|
+
stricted: b,
|
|
1572
|
+
firstRestricted: e,
|
|
1573
|
+
message: X
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
function rt() {
|
|
1577
|
+
var e, t = [], u, c, b, I, U, X, ae, ue;
|
|
1578
|
+
return ue = i, te("function"), c = i, e = ge(), p ? Y(c.value) && V(c, a.StrictFunctionName) : Y(c.value) ? (U = c, X = a.StrictFunctionName) : ee(c.value) && (U = c, X = a.StrictReservedWord), I = tt(U), t = I.params, b = I.stricted, U = I.firstRestricted, I.message && (X = I.message), ae = p, u = ze(), p && U && j(U, X), p && b && V(b, X), p = ae, n.markEnd(n.createFunctionDeclaration(e, t, [], u), ue);
|
|
1579
|
+
}
|
|
1580
|
+
function Xt() {
|
|
1581
|
+
var e, t = null, u, c, b, I, U = [], X, ae, ue;
|
|
1582
|
+
return ue = i, te("function"), N("(") || (e = i, t = ge(), p ? Y(e.value) && V(e, a.StrictFunctionName) : Y(e.value) ? (c = e, b = a.StrictFunctionName) : ee(e.value) && (c = e, b = a.StrictReservedWord)), I = tt(c), U = I.params, u = I.stricted, c = I.firstRestricted, I.message && (b = I.message), ae = p, X = ze(), p && c && j(c, b), p && u && V(u, b), p = ae, n.markEnd(n.createFunctionExpression(t, U, [], X), ue);
|
|
1583
|
+
}
|
|
1584
|
+
function Be() {
|
|
1585
|
+
if (i.type === l.Keyword)
|
|
1586
|
+
switch (i.value) {
|
|
1587
|
+
case "const":
|
|
1588
|
+
case "let":
|
|
1589
|
+
return It(i.value);
|
|
1590
|
+
case "function":
|
|
1591
|
+
return rt();
|
|
1592
|
+
default:
|
|
1593
|
+
return Ae();
|
|
1594
|
+
}
|
|
1595
|
+
if (i.type !== l.EOF)
|
|
1596
|
+
return Ae();
|
|
1597
|
+
}
|
|
1598
|
+
function Kt() {
|
|
1599
|
+
for (var e, t = [], u, c, b; r < g && (u = i, !(u.type !== l.StringLiteral || (e = Be(), t.push(e), e.expression.type !== f.Literal))); )
|
|
1600
|
+
c = s.slice(u.start + 1, u.end - 1), c === "use strict" ? (p = !0, b && V(b, a.StrictOctalLiteral)) : !b && u.octal && (b = u);
|
|
1601
|
+
for (; r < g && (e = Be(), !(typeof e > "u")); )
|
|
1602
|
+
t.push(e);
|
|
1603
|
+
return t;
|
|
1604
|
+
}
|
|
1605
|
+
function Jt() {
|
|
1606
|
+
var e, t;
|
|
1607
|
+
return v(), Me(), t = i, p = !1, e = Kt(), n.markEnd(n.createProgram(e), t);
|
|
1608
|
+
}
|
|
1609
|
+
function nt() {
|
|
1610
|
+
var e, t, u, c = [];
|
|
1611
|
+
for (e = 0; e < m.tokens.length; ++e)
|
|
1612
|
+
t = m.tokens[e], u = {
|
|
1613
|
+
type: t.type,
|
|
1614
|
+
value: t.value
|
|
1615
|
+
}, m.range && (u.range = t.range), m.loc && (u.loc = t.loc), c.push(u);
|
|
1616
|
+
m.tokens = c;
|
|
1617
|
+
}
|
|
1618
|
+
function Qt(e, t) {
|
|
1619
|
+
var u, c, b;
|
|
1620
|
+
u = String, typeof e != "string" && !(e instanceof String) && (e = u(e)), n = A, s = e, r = 0, F = s.length > 0 ? 1 : 0, w = 0, g = s.length, i = null, y = {
|
|
1621
|
+
allowIn: !0,
|
|
1622
|
+
labelSet: {},
|
|
1623
|
+
inFunctionBody: !1,
|
|
1624
|
+
inIteration: !1,
|
|
1625
|
+
inSwitch: !1,
|
|
1626
|
+
lastCommentStart: -1
|
|
1627
|
+
}, m = {}, t = t || {}, t.tokens = !0, m.tokens = [], m.tokenize = !0, m.openParenToken = -1, m.openCurlyToken = -1, m.range = typeof t.range == "boolean" && t.range, m.loc = typeof t.loc == "boolean" && t.loc, typeof t.comment == "boolean" && t.comment && (m.comments = []), typeof t.tolerant == "boolean" && t.tolerant && (m.errors = []);
|
|
1628
|
+
try {
|
|
1629
|
+
if (Me(), i.type === l.EOF)
|
|
1630
|
+
return m.tokens;
|
|
1631
|
+
for (c = L(); i.type !== l.EOF; )
|
|
1632
|
+
try {
|
|
1633
|
+
c = L();
|
|
1634
|
+
} catch (I) {
|
|
1635
|
+
if (c = i, m.errors) {
|
|
1636
|
+
m.errors.push(I);
|
|
1637
|
+
break;
|
|
1638
|
+
} else
|
|
1639
|
+
throw I;
|
|
1640
|
+
}
|
|
1641
|
+
nt(), b = m.tokens, typeof m.comments < "u" && (b.comments = m.comments), typeof m.errors < "u" && (b.errors = m.errors);
|
|
1642
|
+
} catch (I) {
|
|
1643
|
+
throw I;
|
|
1644
|
+
} finally {
|
|
1645
|
+
m = {};
|
|
1646
|
+
}
|
|
1647
|
+
return b;
|
|
1648
|
+
}
|
|
1649
|
+
function Yt(e, t) {
|
|
1650
|
+
var u, c;
|
|
1651
|
+
c = String, typeof e != "string" && !(e instanceof String) && (e = c(e)), n = A, s = e, r = 0, F = s.length > 0 ? 1 : 0, w = 0, g = s.length, i = null, y = {
|
|
1652
|
+
allowIn: !0,
|
|
1653
|
+
labelSet: {},
|
|
1654
|
+
inFunctionBody: !1,
|
|
1655
|
+
inIteration: !1,
|
|
1656
|
+
inSwitch: !1,
|
|
1657
|
+
lastCommentStart: -1
|
|
1658
|
+
}, m = {}, typeof t < "u" && (m.range = typeof t.range == "boolean" && t.range, m.loc = typeof t.loc == "boolean" && t.loc, m.attachComment = typeof t.attachComment == "boolean" && t.attachComment, m.loc && t.source !== null && t.source !== void 0 && (m.source = c(t.source)), typeof t.tokens == "boolean" && t.tokens && (m.tokens = []), typeof t.comment == "boolean" && t.comment && (m.comments = []), typeof t.tolerant == "boolean" && t.tolerant && (m.errors = []), m.attachComment && (m.range = !0, m.comments = [], m.bottomRightStack = [], m.trailingComments = [], m.leadingComments = []));
|
|
1659
|
+
try {
|
|
1660
|
+
u = Jt(), typeof m.comments < "u" && (u.comments = m.comments), typeof m.tokens < "u" && (nt(), u.tokens = m.tokens), typeof m.errors < "u" && (u.errors = m.errors);
|
|
1661
|
+
} catch (b) {
|
|
1662
|
+
throw b;
|
|
1663
|
+
} finally {
|
|
1664
|
+
m = {};
|
|
1665
|
+
}
|
|
1666
|
+
return u;
|
|
1667
|
+
}
|
|
1668
|
+
C.version = "1.2.2", C.tokenize = Qt, C.parse = Yt, C.Syntax = function() {
|
|
1669
|
+
var e, t = {};
|
|
1670
|
+
typeof Object.create == "function" && (t = /* @__PURE__ */ Object.create(null));
|
|
1671
|
+
for (e in f)
|
|
1672
|
+
f.hasOwnProperty(e) && (t[e] = f[e]);
|
|
1673
|
+
return typeof Object.freeze == "function" && Object.freeze(t), t;
|
|
1674
|
+
}();
|
|
1675
|
+
});
|
|
1676
|
+
}, {}], 1: [function(x, k, D) {
|
|
1677
|
+
(function(C) {
|
|
1678
|
+
var l = function() {
|
|
1679
|
+
var S = {
|
|
1680
|
+
trace: function() {
|
|
1681
|
+
},
|
|
1682
|
+
yy: {},
|
|
1683
|
+
symbols_: { error: 2, JSON_PATH: 3, DOLLAR: 4, PATH_COMPONENTS: 5, LEADING_CHILD_MEMBER_EXPRESSION: 6, PATH_COMPONENT: 7, MEMBER_COMPONENT: 8, SUBSCRIPT_COMPONENT: 9, CHILD_MEMBER_COMPONENT: 10, DESCENDANT_MEMBER_COMPONENT: 11, DOT: 12, MEMBER_EXPRESSION: 13, DOT_DOT: 14, STAR: 15, IDENTIFIER: 16, SCRIPT_EXPRESSION: 17, INTEGER: 18, END: 19, CHILD_SUBSCRIPT_COMPONENT: 20, DESCENDANT_SUBSCRIPT_COMPONENT: 21, "[": 22, SUBSCRIPT: 23, "]": 24, SUBSCRIPT_EXPRESSION: 25, SUBSCRIPT_EXPRESSION_LIST: 26, SUBSCRIPT_EXPRESSION_LISTABLE: 27, ",": 28, STRING_LITERAL: 29, ARRAY_SLICE: 30, FILTER_EXPRESSION: 31, QQ_STRING: 32, Q_STRING: 33, $accept: 0, $end: 1 },
|
|
1684
|
+
terminals_: { 2: "error", 4: "DOLLAR", 12: "DOT", 14: "DOT_DOT", 15: "STAR", 16: "IDENTIFIER", 17: "SCRIPT_EXPRESSION", 18: "INTEGER", 19: "END", 22: "[", 24: "]", 28: ",", 30: "ARRAY_SLICE", 31: "FILTER_EXPRESSION", 32: "QQ_STRING", 33: "Q_STRING" },
|
|
1685
|
+
productions_: [0, [3, 1], [3, 2], [3, 1], [3, 2], [5, 1], [5, 2], [7, 1], [7, 1], [8, 1], [8, 1], [10, 2], [6, 1], [11, 2], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [9, 1], [9, 1], [20, 3], [21, 4], [23, 1], [23, 1], [26, 1], [26, 3], [27, 1], [27, 1], [27, 1], [25, 1], [25, 1], [25, 1], [29, 1], [29, 1]],
|
|
1686
|
+
performAction: function(o, A, s, p, r, F, w) {
|
|
1687
|
+
p.ast || (p.ast = d, d.initialize());
|
|
1688
|
+
var g = F.length - 1;
|
|
1689
|
+
switch (r) {
|
|
1690
|
+
case 1:
|
|
1691
|
+
return p.ast.set({ expression: { type: "root", value: F[g] } }), p.ast.unshift(), p.ast.yield();
|
|
1692
|
+
case 2:
|
|
1693
|
+
return p.ast.set({ expression: { type: "root", value: F[g - 1] } }), p.ast.unshift(), p.ast.yield();
|
|
1694
|
+
case 3:
|
|
1695
|
+
return p.ast.unshift(), p.ast.yield();
|
|
1696
|
+
case 4:
|
|
1697
|
+
return p.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: F[g - 1] } }), p.ast.unshift(), p.ast.yield();
|
|
1698
|
+
case 5:
|
|
1699
|
+
break;
|
|
1700
|
+
case 6:
|
|
1701
|
+
break;
|
|
1702
|
+
case 7:
|
|
1703
|
+
p.ast.set({ operation: "member" }), p.ast.push();
|
|
1704
|
+
break;
|
|
1705
|
+
case 8:
|
|
1706
|
+
p.ast.set({ operation: "subscript" }), p.ast.push();
|
|
1707
|
+
break;
|
|
1708
|
+
case 9:
|
|
1709
|
+
p.ast.set({ scope: "child" });
|
|
1710
|
+
break;
|
|
1711
|
+
case 10:
|
|
1712
|
+
p.ast.set({ scope: "descendant" });
|
|
1713
|
+
break;
|
|
1714
|
+
case 11:
|
|
1715
|
+
break;
|
|
1716
|
+
case 12:
|
|
1717
|
+
p.ast.set({ scope: "child", operation: "member" });
|
|
1718
|
+
break;
|
|
1719
|
+
case 13:
|
|
1720
|
+
break;
|
|
1721
|
+
case 14:
|
|
1722
|
+
p.ast.set({ expression: { type: "wildcard", value: F[g] } });
|
|
1723
|
+
break;
|
|
1724
|
+
case 15:
|
|
1725
|
+
p.ast.set({ expression: { type: "identifier", value: F[g] } });
|
|
1726
|
+
break;
|
|
1727
|
+
case 16:
|
|
1728
|
+
p.ast.set({ expression: { type: "script_expression", value: F[g] } });
|
|
1729
|
+
break;
|
|
1730
|
+
case 17:
|
|
1731
|
+
p.ast.set({ expression: { type: "numeric_literal", value: parseInt(F[g]) } });
|
|
1732
|
+
break;
|
|
1733
|
+
case 18:
|
|
1734
|
+
break;
|
|
1735
|
+
case 19:
|
|
1736
|
+
p.ast.set({ scope: "child" });
|
|
1737
|
+
break;
|
|
1738
|
+
case 20:
|
|
1739
|
+
p.ast.set({ scope: "descendant" });
|
|
1740
|
+
break;
|
|
1741
|
+
case 21:
|
|
1742
|
+
break;
|
|
1743
|
+
case 22:
|
|
1744
|
+
break;
|
|
1745
|
+
case 23:
|
|
1746
|
+
break;
|
|
1747
|
+
case 24:
|
|
1748
|
+
F[g].length > 1 ? p.ast.set({ expression: { type: "union", value: F[g] } }) : this.$ = F[g];
|
|
1749
|
+
break;
|
|
1750
|
+
case 25:
|
|
1751
|
+
this.$ = [F[g]];
|
|
1752
|
+
break;
|
|
1753
|
+
case 26:
|
|
1754
|
+
this.$ = F[g - 2].concat(F[g]);
|
|
1755
|
+
break;
|
|
1756
|
+
case 27:
|
|
1757
|
+
this.$ = { expression: { type: "numeric_literal", value: parseInt(F[g]) } }, p.ast.set(this.$);
|
|
1758
|
+
break;
|
|
1759
|
+
case 28:
|
|
1760
|
+
this.$ = { expression: { type: "string_literal", value: F[g] } }, p.ast.set(this.$);
|
|
1761
|
+
break;
|
|
1762
|
+
case 29:
|
|
1763
|
+
this.$ = { expression: { type: "slice", value: F[g] } }, p.ast.set(this.$);
|
|
1764
|
+
break;
|
|
1765
|
+
case 30:
|
|
1766
|
+
this.$ = { expression: { type: "wildcard", value: F[g] } }, p.ast.set(this.$);
|
|
1767
|
+
break;
|
|
1768
|
+
case 31:
|
|
1769
|
+
this.$ = { expression: { type: "script_expression", value: F[g] } }, p.ast.set(this.$);
|
|
1770
|
+
break;
|
|
1771
|
+
case 32:
|
|
1772
|
+
this.$ = { expression: { type: "filter_expression", value: F[g] } }, p.ast.set(this.$);
|
|
1773
|
+
break;
|
|
1774
|
+
case 33:
|
|
1775
|
+
this.$ = F[g];
|
|
1776
|
+
break;
|
|
1777
|
+
case 34:
|
|
1778
|
+
this.$ = F[g];
|
|
1779
|
+
break;
|
|
1780
|
+
}
|
|
1781
|
+
},
|
|
1782
|
+
table: [{ 3: 1, 4: [1, 2], 6: 3, 13: 4, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9] }, { 1: [3] }, { 1: [2, 1], 5: 10, 7: 11, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 3], 5: 21, 7: 11, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 12], 12: [2, 12], 14: [2, 12], 22: [2, 12] }, { 1: [2, 14], 12: [2, 14], 14: [2, 14], 22: [2, 14] }, { 1: [2, 15], 12: [2, 15], 14: [2, 15], 22: [2, 15] }, { 1: [2, 16], 12: [2, 16], 14: [2, 16], 22: [2, 16] }, { 1: [2, 17], 12: [2, 17], 14: [2, 17], 22: [2, 17] }, { 1: [2, 18], 12: [2, 18], 14: [2, 18], 22: [2, 18] }, { 1: [2, 2], 7: 22, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 5], 12: [2, 5], 14: [2, 5], 22: [2, 5] }, { 1: [2, 7], 12: [2, 7], 14: [2, 7], 22: [2, 7] }, { 1: [2, 8], 12: [2, 8], 14: [2, 8], 22: [2, 8] }, { 1: [2, 9], 12: [2, 9], 14: [2, 9], 22: [2, 9] }, { 1: [2, 10], 12: [2, 10], 14: [2, 10], 22: [2, 10] }, { 1: [2, 19], 12: [2, 19], 14: [2, 19], 22: [2, 19] }, { 1: [2, 20], 12: [2, 20], 14: [2, 20], 22: [2, 20] }, { 13: 23, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9] }, { 13: 24, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9], 22: [1, 25] }, { 15: [1, 29], 17: [1, 30], 18: [1, 33], 23: 26, 25: 27, 26: 28, 27: 32, 29: 34, 30: [1, 35], 31: [1, 31], 32: [1, 36], 33: [1, 37] }, { 1: [2, 4], 7: 22, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 6], 12: [2, 6], 14: [2, 6], 22: [2, 6] }, { 1: [2, 11], 12: [2, 11], 14: [2, 11], 22: [2, 11] }, { 1: [2, 13], 12: [2, 13], 14: [2, 13], 22: [2, 13] }, { 15: [1, 29], 17: [1, 30], 18: [1, 33], 23: 38, 25: 27, 26: 28, 27: 32, 29: 34, 30: [1, 35], 31: [1, 31], 32: [1, 36], 33: [1, 37] }, { 24: [1, 39] }, { 24: [2, 23] }, { 24: [2, 24], 28: [1, 40] }, { 24: [2, 30] }, { 24: [2, 31] }, { 24: [2, 32] }, { 24: [2, 25], 28: [2, 25] }, { 24: [2, 27], 28: [2, 27] }, { 24: [2, 28], 28: [2, 28] }, { 24: [2, 29], 28: [2, 29] }, { 24: [2, 33], 28: [2, 33] }, { 24: [2, 34], 28: [2, 34] }, { 24: [1, 41] }, { 1: [2, 21], 12: [2, 21], 14: [2, 21], 22: [2, 21] }, { 18: [1, 33], 27: 42, 29: 34, 30: [1, 35], 32: [1, 36], 33: [1, 37] }, { 1: [2, 22], 12: [2, 22], 14: [2, 22], 22: [2, 22] }, { 24: [2, 26], 28: [2, 26] }],
|
|
1783
|
+
defaultActions: { 27: [2, 23], 29: [2, 30], 30: [2, 31], 31: [2, 32] },
|
|
1784
|
+
parseError: function(o, A) {
|
|
1785
|
+
if (A.recoverable)
|
|
1786
|
+
this.trace(o);
|
|
1787
|
+
else
|
|
1788
|
+
throw new Error(o);
|
|
1789
|
+
},
|
|
1790
|
+
parse: function(o) {
|
|
1791
|
+
var A = this, s = [0], p = [null], r = [], F = this.table, w = "", g = 0, n = 0, i = 2, y = 1, m = r.slice.call(arguments, 1);
|
|
1792
|
+
this.lexer.setInput(o), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, typeof this.lexer.yylloc > "u" && (this.lexer.yylloc = {});
|
|
1793
|
+
var O = this.lexer.yylloc;
|
|
1794
|
+
r.push(O);
|
|
1795
|
+
var M = this.lexer.options && this.lexer.options.ranges;
|
|
1796
|
+
typeof this.yy.parseError == "function" ? this.parseError = this.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
1797
|
+
function z() {
|
|
1798
|
+
var pe;
|
|
1799
|
+
return pe = A.lexer.lex() || y, typeof pe != "number" && (pe = A.symbols_[pe] || pe), pe;
|
|
1800
|
+
}
|
|
1801
|
+
for (var T, G, $, q, J = {}, ce, ee, Y, fe; ; ) {
|
|
1802
|
+
if (G = s[s.length - 1], this.defaultActions[G] ? $ = this.defaultActions[G] : ((T === null || typeof T > "u") && (T = z()), $ = F[G] && F[G][T]), typeof $ > "u" || !$.length || !$[0]) {
|
|
1803
|
+
var oe = "";
|
|
1804
|
+
fe = [];
|
|
1805
|
+
for (ce in F[G])
|
|
1806
|
+
this.terminals_[ce] && ce > i && fe.push("'" + this.terminals_[ce] + "'");
|
|
1807
|
+
this.lexer.showPosition ? oe = "Parse error on line " + (g + 1) + `:
|
|
1808
|
+
` + this.lexer.showPosition() + `
|
|
1809
|
+
Expecting ` + fe.join(", ") + ", got '" + (this.terminals_[T] || T) + "'" : oe = "Parse error on line " + (g + 1) + ": Unexpected " + (T == y ? "end of input" : "'" + (this.terminals_[T] || T) + "'"), this.parseError(oe, {
|
|
1810
|
+
text: this.lexer.match,
|
|
1811
|
+
token: this.terminals_[T] || T,
|
|
1812
|
+
line: this.lexer.yylineno,
|
|
1813
|
+
loc: O,
|
|
1814
|
+
expected: fe
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
if ($[0] instanceof Array && $.length > 1)
|
|
1818
|
+
throw new Error("Parse Error: multiple actions possible at state: " + G + ", token: " + T);
|
|
1819
|
+
switch ($[0]) {
|
|
1820
|
+
case 1:
|
|
1821
|
+
s.push(T), p.push(this.lexer.yytext), r.push(this.lexer.yylloc), s.push($[1]), T = null, n = this.lexer.yyleng, w = this.lexer.yytext, g = this.lexer.yylineno, O = this.lexer.yylloc;
|
|
1822
|
+
break;
|
|
1823
|
+
case 2:
|
|
1824
|
+
if (ee = this.productions_[$[1]][1], J.$ = p[p.length - ee], J._$ = {
|
|
1825
|
+
first_line: r[r.length - (ee || 1)].first_line,
|
|
1826
|
+
last_line: r[r.length - 1].last_line,
|
|
1827
|
+
first_column: r[r.length - (ee || 1)].first_column,
|
|
1828
|
+
last_column: r[r.length - 1].last_column
|
|
1829
|
+
}, M && (J._$.range = [
|
|
1830
|
+
r[r.length - (ee || 1)].range[0],
|
|
1831
|
+
r[r.length - 1].range[1]
|
|
1832
|
+
]), q = this.performAction.apply(J, [
|
|
1833
|
+
w,
|
|
1834
|
+
n,
|
|
1835
|
+
g,
|
|
1836
|
+
this.yy,
|
|
1837
|
+
$[1],
|
|
1838
|
+
p,
|
|
1839
|
+
r
|
|
1840
|
+
].concat(m)), typeof q < "u")
|
|
1841
|
+
return q;
|
|
1842
|
+
ee && (s = s.slice(0, -1 * ee * 2), p = p.slice(0, -1 * ee), r = r.slice(0, -1 * ee)), s.push(this.productions_[$[1]][0]), p.push(J.$), r.push(J._$), Y = F[s[s.length - 2]][s[s.length - 1]], s.push(Y);
|
|
1843
|
+
break;
|
|
1844
|
+
case 3:
|
|
1845
|
+
return !0;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return !0;
|
|
1849
|
+
}
|
|
1850
|
+
}, d = {
|
|
1851
|
+
initialize: function() {
|
|
1852
|
+
this._nodes = [], this._node = {}, this._stash = [];
|
|
1853
|
+
},
|
|
1854
|
+
set: function(a) {
|
|
1855
|
+
for (var o in a) this._node[o] = a[o];
|
|
1856
|
+
return this._node;
|
|
1857
|
+
},
|
|
1858
|
+
node: function(a) {
|
|
1859
|
+
return arguments.length && (this._node = a), this._node;
|
|
1860
|
+
},
|
|
1861
|
+
push: function() {
|
|
1862
|
+
this._nodes.push(this._node), this._node = {};
|
|
1863
|
+
},
|
|
1864
|
+
unshift: function() {
|
|
1865
|
+
this._nodes.unshift(this._node), this._node = {};
|
|
1866
|
+
},
|
|
1867
|
+
yield: function() {
|
|
1868
|
+
var a = this._nodes;
|
|
1869
|
+
return this.initialize(), a;
|
|
1870
|
+
}
|
|
1871
|
+
}, f = /* @__PURE__ */ function() {
|
|
1872
|
+
var a = {
|
|
1873
|
+
EOF: 1,
|
|
1874
|
+
parseError: function(A, s) {
|
|
1875
|
+
if (this.yy.parser)
|
|
1876
|
+
this.yy.parser.parseError(A, s);
|
|
1877
|
+
else
|
|
1878
|
+
throw new Error(A);
|
|
1879
|
+
},
|
|
1880
|
+
// resets the lexer, sets new input
|
|
1881
|
+
setInput: function(o) {
|
|
1882
|
+
return this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
1883
|
+
first_line: 1,
|
|
1884
|
+
first_column: 0,
|
|
1885
|
+
last_line: 1,
|
|
1886
|
+
last_column: 0
|
|
1887
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
1888
|
+
},
|
|
1889
|
+
// consumes and returns one char from the input
|
|
1890
|
+
input: function() {
|
|
1891
|
+
var o = this._input[0];
|
|
1892
|
+
this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
|
|
1893
|
+
var A = o.match(/(?:\r\n?|\n).*/g);
|
|
1894
|
+
return A ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
|
|
1895
|
+
},
|
|
1896
|
+
// unshifts one char (or a string) into the input
|
|
1897
|
+
unput: function(o) {
|
|
1898
|
+
var A = o.length, s = o.split(/(?:\r\n?|\n)/g);
|
|
1899
|
+
this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - A - 1), this.offset -= A;
|
|
1900
|
+
var p = this.match.split(/(?:\r\n?|\n)/g);
|
|
1901
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1);
|
|
1902
|
+
var r = this.yylloc.range;
|
|
1903
|
+
return this.yylloc = {
|
|
1904
|
+
first_line: this.yylloc.first_line,
|
|
1905
|
+
last_line: this.yylineno + 1,
|
|
1906
|
+
first_column: this.yylloc.first_column,
|
|
1907
|
+
last_column: s ? (s.length === p.length ? this.yylloc.first_column : 0) + p[p.length - s.length].length - s[0].length : this.yylloc.first_column - A
|
|
1908
|
+
}, this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - A]), this.yyleng = this.yytext.length, this;
|
|
1909
|
+
},
|
|
1910
|
+
// When called from action, caches matched text and appends it on next action
|
|
1911
|
+
more: function() {
|
|
1912
|
+
return this._more = !0, this;
|
|
1913
|
+
},
|
|
1914
|
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
1915
|
+
reject: function() {
|
|
1916
|
+
if (this.options.backtrack_lexer)
|
|
1917
|
+
this._backtrack = !0;
|
|
1918
|
+
else
|
|
1919
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
1920
|
+
` + this.showPosition(), {
|
|
1921
|
+
text: "",
|
|
1922
|
+
token: null,
|
|
1923
|
+
line: this.yylineno
|
|
1924
|
+
});
|
|
1925
|
+
return this;
|
|
1926
|
+
},
|
|
1927
|
+
// retain first n characters of the match
|
|
1928
|
+
less: function(o) {
|
|
1929
|
+
this.unput(this.match.slice(o));
|
|
1930
|
+
},
|
|
1931
|
+
// displays already matched input, i.e. for error messages
|
|
1932
|
+
pastInput: function() {
|
|
1933
|
+
var o = this.matched.substr(0, this.matched.length - this.match.length);
|
|
1934
|
+
return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
|
|
1935
|
+
},
|
|
1936
|
+
// displays upcoming input, i.e. for error messages
|
|
1937
|
+
upcomingInput: function() {
|
|
1938
|
+
var o = this.match;
|
|
1939
|
+
return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
1940
|
+
},
|
|
1941
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
1942
|
+
showPosition: function() {
|
|
1943
|
+
var o = this.pastInput(), A = new Array(o.length + 1).join("-");
|
|
1944
|
+
return o + this.upcomingInput() + `
|
|
1945
|
+
` + A + "^";
|
|
1946
|
+
},
|
|
1947
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
1948
|
+
test_match: function(o, A) {
|
|
1949
|
+
var s, p, r;
|
|
1950
|
+
if (this.options.backtrack_lexer && (r = {
|
|
1951
|
+
yylineno: this.yylineno,
|
|
1952
|
+
yylloc: {
|
|
1953
|
+
first_line: this.yylloc.first_line,
|
|
1954
|
+
last_line: this.last_line,
|
|
1955
|
+
first_column: this.yylloc.first_column,
|
|
1956
|
+
last_column: this.yylloc.last_column
|
|
1957
|
+
},
|
|
1958
|
+
yytext: this.yytext,
|
|
1959
|
+
match: this.match,
|
|
1960
|
+
matches: this.matches,
|
|
1961
|
+
matched: this.matched,
|
|
1962
|
+
yyleng: this.yyleng,
|
|
1963
|
+
offset: this.offset,
|
|
1964
|
+
_more: this._more,
|
|
1965
|
+
_input: this._input,
|
|
1966
|
+
yy: this.yy,
|
|
1967
|
+
conditionStack: this.conditionStack.slice(0),
|
|
1968
|
+
done: this.done
|
|
1969
|
+
}, this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), p = o[0].match(/(?:\r\n?|\n).*/g), p && (this.yylineno += p.length), this.yylloc = {
|
|
1970
|
+
first_line: this.yylloc.last_line,
|
|
1971
|
+
last_line: this.yylineno + 1,
|
|
1972
|
+
first_column: this.yylloc.last_column,
|
|
1973
|
+
last_column: p ? p[p.length - 1].length - p[p.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
|
|
1974
|
+
}, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], s = this.performAction.call(this, this.yy, this, A, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), s)
|
|
1975
|
+
return s;
|
|
1976
|
+
if (this._backtrack) {
|
|
1977
|
+
for (var F in r)
|
|
1978
|
+
this[F] = r[F];
|
|
1979
|
+
return !1;
|
|
1980
|
+
}
|
|
1981
|
+
return !1;
|
|
1982
|
+
},
|
|
1983
|
+
// return next match in input
|
|
1984
|
+
next: function() {
|
|
1985
|
+
if (this.done)
|
|
1986
|
+
return this.EOF;
|
|
1987
|
+
this._input || (this.done = !0);
|
|
1988
|
+
var o, A, s, p;
|
|
1989
|
+
this._more || (this.yytext = "", this.match = "");
|
|
1990
|
+
for (var r = this._currentRules(), F = 0; F < r.length; F++)
|
|
1991
|
+
if (s = this._input.match(this.rules[r[F]]), s && (!A || s[0].length > A[0].length)) {
|
|
1992
|
+
if (A = s, p = F, this.options.backtrack_lexer) {
|
|
1993
|
+
if (o = this.test_match(s, r[F]), o !== !1)
|
|
1994
|
+
return o;
|
|
1995
|
+
if (this._backtrack) {
|
|
1996
|
+
A = !1;
|
|
1997
|
+
continue;
|
|
1998
|
+
} else
|
|
1999
|
+
return !1;
|
|
2000
|
+
} else if (!this.options.flex)
|
|
2001
|
+
break;
|
|
2002
|
+
}
|
|
2003
|
+
return A ? (o = this.test_match(A, r[p]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
2004
|
+
` + this.showPosition(), {
|
|
2005
|
+
text: "",
|
|
2006
|
+
token: null,
|
|
2007
|
+
line: this.yylineno
|
|
2008
|
+
});
|
|
2009
|
+
},
|
|
2010
|
+
// return next match that has a token
|
|
2011
|
+
lex: function() {
|
|
2012
|
+
var A = this.next();
|
|
2013
|
+
return A || this.lex();
|
|
2014
|
+
},
|
|
2015
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
2016
|
+
begin: function(A) {
|
|
2017
|
+
this.conditionStack.push(A);
|
|
2018
|
+
},
|
|
2019
|
+
// pop the previously active lexer condition state off the condition stack
|
|
2020
|
+
popState: function() {
|
|
2021
|
+
var A = this.conditionStack.length - 1;
|
|
2022
|
+
return A > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
2023
|
+
},
|
|
2024
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
2025
|
+
_currentRules: function() {
|
|
2026
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
2027
|
+
},
|
|
2028
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
2029
|
+
topState: function(A) {
|
|
2030
|
+
return A = this.conditionStack.length - 1 - Math.abs(A || 0), A >= 0 ? this.conditionStack[A] : "INITIAL";
|
|
2031
|
+
},
|
|
2032
|
+
// alias for begin(condition)
|
|
2033
|
+
pushState: function(A) {
|
|
2034
|
+
this.begin(A);
|
|
2035
|
+
},
|
|
2036
|
+
// return the number of states currently on the stack
|
|
2037
|
+
stateStackSize: function() {
|
|
2038
|
+
return this.conditionStack.length;
|
|
2039
|
+
},
|
|
2040
|
+
options: {},
|
|
2041
|
+
performAction: function(A, s, p, r) {
|
|
2042
|
+
switch (p) {
|
|
2043
|
+
case 0:
|
|
2044
|
+
return 4;
|
|
2045
|
+
case 1:
|
|
2046
|
+
return 14;
|
|
2047
|
+
case 2:
|
|
2048
|
+
return 12;
|
|
2049
|
+
case 3:
|
|
2050
|
+
return 15;
|
|
2051
|
+
case 4:
|
|
2052
|
+
return 16;
|
|
2053
|
+
case 5:
|
|
2054
|
+
return 22;
|
|
2055
|
+
case 6:
|
|
2056
|
+
return 24;
|
|
2057
|
+
case 7:
|
|
2058
|
+
return 28;
|
|
2059
|
+
case 8:
|
|
2060
|
+
return 30;
|
|
2061
|
+
case 9:
|
|
2062
|
+
return 18;
|
|
2063
|
+
case 10:
|
|
2064
|
+
return s.yytext = s.yytext.substr(1, s.yyleng - 2), 32;
|
|
2065
|
+
case 11:
|
|
2066
|
+
return s.yytext = s.yytext.substr(1, s.yyleng - 2), 33;
|
|
2067
|
+
case 12:
|
|
2068
|
+
return 17;
|
|
2069
|
+
case 13:
|
|
2070
|
+
return 31;
|
|
2071
|
+
}
|
|
2072
|
+
},
|
|
2073
|
+
rules: [/^(?:\$)/, /^(?:\.\.)/, /^(?:\.)/, /^(?:\*)/, /^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/, /^(?:\[)/, /^(?:\])/, /^(?:,)/, /^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/, /^(?:(-?(?:0|[1-9][0-9]*)))/, /^(?:"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/, /^(?:'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/, /^(?:\(.+?\)(?=\]))/, /^(?:\?\(.+?\)(?=\]))/],
|
|
2074
|
+
conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: !0 } }
|
|
2075
|
+
};
|
|
2076
|
+
return a;
|
|
2077
|
+
}();
|
|
2078
|
+
S.lexer = f;
|
|
2079
|
+
function h() {
|
|
2080
|
+
this.yy = {};
|
|
2081
|
+
}
|
|
2082
|
+
return h.prototype = S, S.Parser = h, new h();
|
|
2083
|
+
}();
|
|
2084
|
+
typeof x < "u" && typeof D < "u" && (D.parser = l, D.Parser = l.Parser, D.parse = function() {
|
|
2085
|
+
return l.parse.apply(l, arguments);
|
|
2086
|
+
}, D.main = function(d) {
|
|
2087
|
+
d[1] || (console.log("Usage: " + d[0] + " FILE"), C.exit(1));
|
|
2088
|
+
var f = x("fs").readFileSync(x("path").normalize(d[1]), "utf8");
|
|
2089
|
+
return D.parser.parse(f);
|
|
2090
|
+
}, typeof k < "u" && x.main === k && D.main(C.argv.slice(1)));
|
|
2091
|
+
}).call(this, x("_process"));
|
|
2092
|
+
}, { _process: 14, fs: 12, path: 13 }], 2: [function(x, k, D) {
|
|
2093
|
+
k.exports = {
|
|
2094
|
+
identifier: "[a-zA-Z_]+[a-zA-Z0-9_]*",
|
|
2095
|
+
integer: "-?(?:0|[1-9][0-9]*)",
|
|
2096
|
+
qq_string: '"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',
|
|
2097
|
+
q_string: "'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"
|
|
2098
|
+
};
|
|
2099
|
+
}, {}], 3: [function(x, k, D) {
|
|
2100
|
+
var C = x("./dict"), l = x("fs"), S = {
|
|
2101
|
+
lex: {
|
|
2102
|
+
macros: {
|
|
2103
|
+
esc: "\\\\",
|
|
2104
|
+
int: C.integer
|
|
2105
|
+
},
|
|
2106
|
+
rules: [
|
|
2107
|
+
["\\$", "return 'DOLLAR'"],
|
|
2108
|
+
["\\.\\.", "return 'DOT_DOT'"],
|
|
2109
|
+
["\\.", "return 'DOT'"],
|
|
2110
|
+
["\\*", "return 'STAR'"],
|
|
2111
|
+
[C.identifier, "return 'IDENTIFIER'"],
|
|
2112
|
+
["\\[", "return '['"],
|
|
2113
|
+
["\\]", "return ']'"],
|
|
2114
|
+
[",", "return ','"],
|
|
2115
|
+
["({int})?\\:({int})?(\\:({int})?)?", "return 'ARRAY_SLICE'"],
|
|
2116
|
+
["{int}", "return 'INTEGER'"],
|
|
2117
|
+
[C.qq_string, "yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],
|
|
2118
|
+
[C.q_string, "yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],
|
|
2119
|
+
["\\(.+?\\)(?=\\])", "return 'SCRIPT_EXPRESSION'"],
|
|
2120
|
+
["\\?\\(.+?\\)(?=\\])", "return 'FILTER_EXPRESSION'"]
|
|
2121
|
+
]
|
|
2122
|
+
},
|
|
2123
|
+
start: "JSON_PATH",
|
|
2124
|
+
bnf: {
|
|
2125
|
+
JSON_PATH: [
|
|
2126
|
+
["DOLLAR", 'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],
|
|
2127
|
+
["DOLLAR PATH_COMPONENTS", 'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],
|
|
2128
|
+
["LEADING_CHILD_MEMBER_EXPRESSION", "yy.ast.unshift(); return yy.ast.yield()"],
|
|
2129
|
+
["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS", 'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']
|
|
2130
|
+
],
|
|
2131
|
+
PATH_COMPONENTS: [
|
|
2132
|
+
["PATH_COMPONENT", ""],
|
|
2133
|
+
["PATH_COMPONENTS PATH_COMPONENT", ""]
|
|
2134
|
+
],
|
|
2135
|
+
PATH_COMPONENT: [
|
|
2136
|
+
["MEMBER_COMPONENT", 'yy.ast.set({ operation: "member" }); yy.ast.push()'],
|
|
2137
|
+
["SUBSCRIPT_COMPONENT", 'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']
|
|
2138
|
+
],
|
|
2139
|
+
MEMBER_COMPONENT: [
|
|
2140
|
+
["CHILD_MEMBER_COMPONENT", 'yy.ast.set({ scope: "child" })'],
|
|
2141
|
+
["DESCENDANT_MEMBER_COMPONENT", 'yy.ast.set({ scope: "descendant" })']
|
|
2142
|
+
],
|
|
2143
|
+
CHILD_MEMBER_COMPONENT: [
|
|
2144
|
+
["DOT MEMBER_EXPRESSION", ""]
|
|
2145
|
+
],
|
|
2146
|
+
LEADING_CHILD_MEMBER_EXPRESSION: [
|
|
2147
|
+
["MEMBER_EXPRESSION", 'yy.ast.set({ scope: "child", operation: "member" })']
|
|
2148
|
+
],
|
|
2149
|
+
DESCENDANT_MEMBER_COMPONENT: [
|
|
2150
|
+
["DOT_DOT MEMBER_EXPRESSION", ""]
|
|
2151
|
+
],
|
|
2152
|
+
MEMBER_EXPRESSION: [
|
|
2153
|
+
["STAR", 'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],
|
|
2154
|
+
["IDENTIFIER", 'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],
|
|
2155
|
+
["SCRIPT_EXPRESSION", 'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],
|
|
2156
|
+
["INTEGER", 'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],
|
|
2157
|
+
["END", ""]
|
|
2158
|
+
],
|
|
2159
|
+
SUBSCRIPT_COMPONENT: [
|
|
2160
|
+
["CHILD_SUBSCRIPT_COMPONENT", 'yy.ast.set({ scope: "child" })'],
|
|
2161
|
+
["DESCENDANT_SUBSCRIPT_COMPONENT", 'yy.ast.set({ scope: "descendant" })']
|
|
2162
|
+
],
|
|
2163
|
+
CHILD_SUBSCRIPT_COMPONENT: [
|
|
2164
|
+
["[ SUBSCRIPT ]", ""]
|
|
2165
|
+
],
|
|
2166
|
+
DESCENDANT_SUBSCRIPT_COMPONENT: [
|
|
2167
|
+
["DOT_DOT [ SUBSCRIPT ]", ""]
|
|
2168
|
+
],
|
|
2169
|
+
SUBSCRIPT: [
|
|
2170
|
+
["SUBSCRIPT_EXPRESSION", ""],
|
|
2171
|
+
["SUBSCRIPT_EXPRESSION_LIST", '$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']
|
|
2172
|
+
],
|
|
2173
|
+
SUBSCRIPT_EXPRESSION_LIST: [
|
|
2174
|
+
["SUBSCRIPT_EXPRESSION_LISTABLE", "$$ = [$1]"],
|
|
2175
|
+
["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE", "$$ = $1.concat($3)"]
|
|
2176
|
+
],
|
|
2177
|
+
SUBSCRIPT_EXPRESSION_LISTABLE: [
|
|
2178
|
+
["INTEGER", '$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],
|
|
2179
|
+
["STRING_LITERAL", '$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],
|
|
2180
|
+
["ARRAY_SLICE", '$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']
|
|
2181
|
+
],
|
|
2182
|
+
SUBSCRIPT_EXPRESSION: [
|
|
2183
|
+
["STAR", '$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],
|
|
2184
|
+
["SCRIPT_EXPRESSION", '$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],
|
|
2185
|
+
["FILTER_EXPRESSION", '$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']
|
|
2186
|
+
],
|
|
2187
|
+
STRING_LITERAL: [
|
|
2188
|
+
["QQ_STRING", "$$ = $1"],
|
|
2189
|
+
["Q_STRING", "$$ = $1"]
|
|
2190
|
+
]
|
|
2191
|
+
}
|
|
2192
|
+
};
|
|
2193
|
+
l.readFileSync && (S.moduleInclude = l.readFileSync(x.resolve("../include/module.js")), S.actionInclude = l.readFileSync(x.resolve("../include/action.js"))), k.exports = S;
|
|
2194
|
+
}, { "./dict": 2, fs: 12 }], 4: [function(x, k, D) {
|
|
2195
|
+
var C = x("./aesprim"), l = x("./slice"), S = x("static-eval"), d = x("underscore").uniq, f = function() {
|
|
2196
|
+
return this.initialize.apply(this, arguments);
|
|
2197
|
+
};
|
|
2198
|
+
f.prototype.initialize = function() {
|
|
2199
|
+
this.traverse = A(!0), this.descend = A();
|
|
2200
|
+
}, f.prototype.keys = Object.keys, f.prototype.resolve = function(g) {
|
|
2201
|
+
var n = [g.operation, g.scope, g.expression.type].join("-"), i = this._fns[n];
|
|
2202
|
+
if (!i) throw new Error("couldn't resolve key: " + n);
|
|
2203
|
+
return i.bind(this);
|
|
2204
|
+
}, f.prototype.register = function(g, n) {
|
|
2205
|
+
if (!n instanceof Function)
|
|
2206
|
+
throw new Error("handler must be a function");
|
|
2207
|
+
this._fns[g] = n;
|
|
2208
|
+
}, f.prototype._fns = {
|
|
2209
|
+
"member-child-identifier": function(g, n) {
|
|
2210
|
+
var i = g.expression.value, y = n.value;
|
|
2211
|
+
if (y instanceof Object && i in y)
|
|
2212
|
+
return [{ value: y[i], path: n.path.concat(i) }];
|
|
2213
|
+
},
|
|
2214
|
+
"member-descendant-identifier": p(function(g, n, i) {
|
|
2215
|
+
return g == i;
|
|
2216
|
+
}),
|
|
2217
|
+
"subscript-child-numeric_literal": s(function(g, n, i) {
|
|
2218
|
+
return g === i;
|
|
2219
|
+
}),
|
|
2220
|
+
"member-child-numeric_literal": s(function(g, n, i) {
|
|
2221
|
+
return String(g) === String(i);
|
|
2222
|
+
}),
|
|
2223
|
+
"subscript-descendant-numeric_literal": p(function(g, n, i) {
|
|
2224
|
+
return g === i;
|
|
2225
|
+
}),
|
|
2226
|
+
"member-child-wildcard": s(function() {
|
|
2227
|
+
return !0;
|
|
2228
|
+
}),
|
|
2229
|
+
"member-descendant-wildcard": p(function() {
|
|
2230
|
+
return !0;
|
|
2231
|
+
}),
|
|
2232
|
+
"subscript-descendant-wildcard": p(function() {
|
|
2233
|
+
return !0;
|
|
2234
|
+
}),
|
|
2235
|
+
"subscript-child-wildcard": s(function() {
|
|
2236
|
+
return !0;
|
|
2237
|
+
}),
|
|
2238
|
+
"subscript-child-slice": function(g, n) {
|
|
2239
|
+
if (a(n.value)) {
|
|
2240
|
+
var i = g.expression.value.split(":").map(w), y = n.value.map(function(m, O) {
|
|
2241
|
+
return { value: m, path: n.path.concat(O) };
|
|
2242
|
+
});
|
|
2243
|
+
return l.apply(null, [y].concat(i));
|
|
2244
|
+
}
|
|
2245
|
+
},
|
|
2246
|
+
"subscript-child-union": function(g, n) {
|
|
2247
|
+
var i = [];
|
|
2248
|
+
return g.expression.value.forEach(function(y) {
|
|
2249
|
+
var m = { operation: "subscript", scope: "child", expression: y.expression }, O = this.resolve(m), M = O(m, n);
|
|
2250
|
+
M && (i = i.concat(M));
|
|
2251
|
+
}, this), F(i);
|
|
2252
|
+
},
|
|
2253
|
+
"subscript-descendant-union": function(g, n, i) {
|
|
2254
|
+
var y = x(".."), m = this, O = [], M = y.nodes(n, "$..*").slice(1);
|
|
2255
|
+
return M.forEach(function(z) {
|
|
2256
|
+
O.length >= i || g.expression.value.forEach(function(T) {
|
|
2257
|
+
var G = { operation: "subscript", scope: "child", expression: T.expression }, $ = m.resolve(G), q = $(G, z);
|
|
2258
|
+
O = O.concat(q);
|
|
2259
|
+
});
|
|
2260
|
+
}), F(O);
|
|
2261
|
+
},
|
|
2262
|
+
"subscript-child-filter_expression": function(g, n, i) {
|
|
2263
|
+
var y = g.expression.value.slice(2, -1), m = C.parse(y).body[0].expression, O = function(M, z) {
|
|
2264
|
+
return r(m, { "@": z });
|
|
2265
|
+
};
|
|
2266
|
+
return this.descend(n, null, O, i);
|
|
2267
|
+
},
|
|
2268
|
+
"subscript-descendant-filter_expression": function(g, n, i) {
|
|
2269
|
+
var y = g.expression.value.slice(2, -1), m = C.parse(y).body[0].expression, O = function(M, z) {
|
|
2270
|
+
return r(m, { "@": z });
|
|
2271
|
+
};
|
|
2272
|
+
return this.traverse(n, null, O, i);
|
|
2273
|
+
},
|
|
2274
|
+
"subscript-child-script_expression": function(g, n) {
|
|
2275
|
+
var i = g.expression.value.slice(1, -1);
|
|
2276
|
+
return h(n, i, "$[{{value}}]");
|
|
2277
|
+
},
|
|
2278
|
+
"member-child-script_expression": function(g, n) {
|
|
2279
|
+
var i = g.expression.value.slice(1, -1);
|
|
2280
|
+
return h(n, i, "$.{{value}}");
|
|
2281
|
+
},
|
|
2282
|
+
"member-descendant-script_expression": function(g, n) {
|
|
2283
|
+
var i = g.expression.value.slice(1, -1);
|
|
2284
|
+
return h(n, i, "$..value");
|
|
2285
|
+
}
|
|
2286
|
+
}, f.prototype._fns["subscript-child-string_literal"] = f.prototype._fns["member-child-identifier"], f.prototype._fns["member-descendant-numeric_literal"] = f.prototype._fns["subscript-descendant-string_literal"] = f.prototype._fns["member-descendant-identifier"];
|
|
2287
|
+
function h(g, n, i) {
|
|
2288
|
+
var y = x("./index"), m = C.parse(n).body[0].expression, O = r(m, { "@": g.value }), M = i.replace(/\{\{\s*value\s*\}\}/g, O), z = y.nodes(g.value, M);
|
|
2289
|
+
return z.forEach(function(T) {
|
|
2290
|
+
T.path = g.path.concat(T.path.slice(1));
|
|
2291
|
+
}), z;
|
|
2292
|
+
}
|
|
2293
|
+
function a(g) {
|
|
2294
|
+
return Array.isArray(g);
|
|
2295
|
+
}
|
|
2296
|
+
function o(g) {
|
|
2297
|
+
return g && !(g instanceof Array) && g instanceof Object;
|
|
2298
|
+
}
|
|
2299
|
+
function A(g) {
|
|
2300
|
+
return function(n, i, y, m) {
|
|
2301
|
+
var O = n.value, M = n.path, z = [], T = (function(G, $) {
|
|
2302
|
+
a(G) ? (G.forEach(function(q, J) {
|
|
2303
|
+
z.length >= m || y(J, q, i) && z.push({ path: $.concat(J), value: q });
|
|
2304
|
+
}), G.forEach(function(q, J) {
|
|
2305
|
+
z.length >= m || g && T(q, $.concat(J));
|
|
2306
|
+
})) : o(G) && (this.keys(G).forEach(function(q) {
|
|
2307
|
+
z.length >= m || y(q, G[q], i) && z.push({ path: $.concat(q), value: G[q] });
|
|
2308
|
+
}), this.keys(G).forEach(function(q) {
|
|
2309
|
+
z.length >= m || g && T(G[q], $.concat(q));
|
|
2310
|
+
}));
|
|
2311
|
+
}).bind(this);
|
|
2312
|
+
return T(O, M), z;
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
function s(g) {
|
|
2316
|
+
return function(n, i, y) {
|
|
2317
|
+
return this.descend(i, n.expression.value, g, y);
|
|
2318
|
+
};
|
|
2319
|
+
}
|
|
2320
|
+
function p(g) {
|
|
2321
|
+
return function(n, i, y) {
|
|
2322
|
+
return this.traverse(i, n.expression.value, g, y);
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
function r() {
|
|
2326
|
+
try {
|
|
2327
|
+
return S.apply(this, arguments);
|
|
2328
|
+
} catch {
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
function F(g) {
|
|
2332
|
+
return g = g.filter(function(n) {
|
|
2333
|
+
return n;
|
|
2334
|
+
}), d(
|
|
2335
|
+
g,
|
|
2336
|
+
function(n) {
|
|
2337
|
+
return n.path.map(function(i) {
|
|
2338
|
+
return String(i).replace("-", "--");
|
|
2339
|
+
}).join("-");
|
|
2340
|
+
}
|
|
2341
|
+
);
|
|
2342
|
+
}
|
|
2343
|
+
function w(g) {
|
|
2344
|
+
var n = String(g);
|
|
2345
|
+
return n.match(/^-?[0-9]+$/) ? parseInt(n) : null;
|
|
2346
|
+
}
|
|
2347
|
+
k.exports = f;
|
|
2348
|
+
}, { "..": "jsonpath", "./aesprim": "./aesprim", "./index": 5, "./slice": 7, "static-eval": 15, underscore: 12 }], 5: [function(x, k, D) {
|
|
2349
|
+
var C = x("assert"), l = x("./dict"), S = x("./parser"), d = x("./handlers"), f = function() {
|
|
2350
|
+
this.initialize.apply(this, arguments);
|
|
2351
|
+
};
|
|
2352
|
+
f.prototype.initialize = function() {
|
|
2353
|
+
this.parser = new S(), this.handlers = new d();
|
|
2354
|
+
}, f.prototype.parse = function(o) {
|
|
2355
|
+
return C.ok(h(o), "we need a path"), this.parser.parse(o);
|
|
2356
|
+
}, f.prototype.parent = function(o, A) {
|
|
2357
|
+
C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path");
|
|
2358
|
+
var s = this.nodes(o, A)[0];
|
|
2359
|
+
return s.path.pop(), this.value(o, s.path);
|
|
2360
|
+
}, f.prototype.apply = function(o, A, s) {
|
|
2361
|
+
C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path"), C.equal(typeof s, "function", "fn needs to be function");
|
|
2362
|
+
var p = this.nodes(o, A).sort(function(r, F) {
|
|
2363
|
+
return F.path.length - r.path.length;
|
|
2364
|
+
});
|
|
2365
|
+
return p.forEach(function(r) {
|
|
2366
|
+
var F = r.path.pop(), w = this.value(o, this.stringify(r.path)), g = r.value = s.call(o, w[F]);
|
|
2367
|
+
w[F] = g;
|
|
2368
|
+
}, this), p;
|
|
2369
|
+
}, f.prototype.value = function(o, A, s) {
|
|
2370
|
+
if (C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path"), arguments.length >= 3) {
|
|
2371
|
+
var p = this.nodes(o, A).shift();
|
|
2372
|
+
if (!p) return this._vivify(o, A, s);
|
|
2373
|
+
var r = p.path.slice(-1).shift(), F = this.parent(o, this.stringify(p.path));
|
|
2374
|
+
F[r] = s;
|
|
2375
|
+
}
|
|
2376
|
+
return this.query(o, this.stringify(A), 1).shift();
|
|
2377
|
+
}, f.prototype._vivify = function(o, A, s) {
|
|
2378
|
+
var p = this;
|
|
2379
|
+
C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path");
|
|
2380
|
+
var r = this.parser.parse(A).map(function(w) {
|
|
2381
|
+
return w.expression.value;
|
|
2382
|
+
}), F = function(w, g) {
|
|
2383
|
+
var n = w.pop(), i = p.value(o, w);
|
|
2384
|
+
i || (F(w.concat(), typeof n == "string" ? {} : []), i = p.value(o, w)), i[n] = g;
|
|
2385
|
+
};
|
|
2386
|
+
return F(r, s), this.query(o, A)[0];
|
|
2387
|
+
}, f.prototype.query = function(o, A, s) {
|
|
2388
|
+
C.ok(o instanceof Object, "obj needs to be an object"), C.ok(h(A), "we need a path");
|
|
2389
|
+
var p = this.nodes(o, A, s).map(function(r) {
|
|
2390
|
+
return r.value;
|
|
2391
|
+
});
|
|
2392
|
+
return p;
|
|
2393
|
+
}, f.prototype.paths = function(o, A, s) {
|
|
2394
|
+
C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path");
|
|
2395
|
+
var p = this.nodes(o, A, s).map(function(r) {
|
|
2396
|
+
return r.path;
|
|
2397
|
+
});
|
|
2398
|
+
return p;
|
|
2399
|
+
}, f.prototype.nodes = function(o, A, s) {
|
|
2400
|
+
if (C.ok(o instanceof Object, "obj needs to be an object"), C.ok(A, "we need a path"), s === 0) return [];
|
|
2401
|
+
var p = this.parser.parse(A), r = this.handlers, F = [{ path: ["$"], value: o }], w = [];
|
|
2402
|
+
return p.length && p[0].expression.type == "root" && p.shift(), p.length ? (p.forEach(function(g, n) {
|
|
2403
|
+
if (!(w.length >= s)) {
|
|
2404
|
+
var i = r.resolve(g), y = [];
|
|
2405
|
+
F.forEach(function(m) {
|
|
2406
|
+
if (!(w.length >= s)) {
|
|
2407
|
+
var O = i(g, m, s);
|
|
2408
|
+
n == p.length - 1 ? w = w.concat(O || []) : y = y.concat(O || []);
|
|
2409
|
+
}
|
|
2410
|
+
}), F = y;
|
|
2411
|
+
}
|
|
2412
|
+
}), s ? w.slice(0, s) : w) : F;
|
|
2413
|
+
}, f.prototype.stringify = function(o) {
|
|
2414
|
+
C.ok(o, "we need a path");
|
|
2415
|
+
var A = "$", s = {
|
|
2416
|
+
"descendant-member": "..{{value}}",
|
|
2417
|
+
"child-member": ".{{value}}",
|
|
2418
|
+
"descendant-subscript": "..[{{value}}]",
|
|
2419
|
+
"child-subscript": "[{{value}}]"
|
|
2420
|
+
};
|
|
2421
|
+
return o = this._normalize(o), o.forEach(function(p) {
|
|
2422
|
+
if (p.expression.type != "root") {
|
|
2423
|
+
var r = [p.scope, p.operation].join("-"), F = s[r], w;
|
|
2424
|
+
if (p.expression.type == "string_literal" ? w = JSON.stringify(p.expression.value) : w = p.expression.value, !F) throw new Error("couldn't find template " + r);
|
|
2425
|
+
A += F.replace(/{{value}}/, w);
|
|
2426
|
+
}
|
|
2427
|
+
}), A;
|
|
2428
|
+
}, f.prototype._normalize = function(o) {
|
|
2429
|
+
if (C.ok(o, "we need a path"), typeof o == "string")
|
|
2430
|
+
return this.parser.parse(o);
|
|
2431
|
+
if (Array.isArray(o) && typeof o[0] == "string") {
|
|
2432
|
+
var A = [{ expression: { type: "root", value: "$" } }];
|
|
2433
|
+
return o.forEach(function(s, p) {
|
|
2434
|
+
if (!(s == "$" && p === 0))
|
|
2435
|
+
if (typeof s == "string" && s.match("^" + l.identifier + "$"))
|
|
2436
|
+
A.push({
|
|
2437
|
+
operation: "member",
|
|
2438
|
+
scope: "child",
|
|
2439
|
+
expression: { value: s, type: "identifier" }
|
|
2440
|
+
});
|
|
2441
|
+
else {
|
|
2442
|
+
var r = typeof s == "number" ? "numeric_literal" : "string_literal";
|
|
2443
|
+
A.push({
|
|
2444
|
+
operation: "subscript",
|
|
2445
|
+
scope: "child",
|
|
2446
|
+
expression: { value: s, type: r }
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
}), A;
|
|
2450
|
+
} else if (Array.isArray(o) && typeof o[0] == "object")
|
|
2451
|
+
return o;
|
|
2452
|
+
throw new Error("couldn't understand path " + o);
|
|
2453
|
+
};
|
|
2454
|
+
function h(o) {
|
|
2455
|
+
return Object.prototype.toString.call(o) == "[object String]";
|
|
2456
|
+
}
|
|
2457
|
+
f.Handlers = d, f.Parser = S;
|
|
2458
|
+
var a = new f();
|
|
2459
|
+
a.JSONPath = f, k.exports = a;
|
|
2460
|
+
}, { "./dict": 2, "./handlers": 4, "./parser": 6, assert: 8 }], 6: [function(x, k, D) {
|
|
2461
|
+
var C = x("./grammar"), l = x("../generated/parser"), S = function() {
|
|
2462
|
+
var d = new l.Parser(), f = d.parseError;
|
|
2463
|
+
return d.yy.parseError = function() {
|
|
2464
|
+
d.yy.ast && d.yy.ast.initialize(), f.apply(d, arguments);
|
|
2465
|
+
}, d;
|
|
2466
|
+
};
|
|
2467
|
+
S.grammar = C, k.exports = S;
|
|
2468
|
+
}, { "../generated/parser": 1, "./grammar": 3 }], 7: [function(x, k, D) {
|
|
2469
|
+
k.exports = function(l, S, d, f) {
|
|
2470
|
+
if (typeof S == "string") throw new Error("start cannot be a string");
|
|
2471
|
+
if (typeof d == "string") throw new Error("end cannot be a string");
|
|
2472
|
+
if (typeof f == "string") throw new Error("step cannot be a string");
|
|
2473
|
+
var h = l.length;
|
|
2474
|
+
if (f === 0) throw new Error("step cannot be zero");
|
|
2475
|
+
if (f = f ? C(f) : 1, S = S < 0 ? h + S : S, d = d < 0 ? h + d : d, S = C(S === 0 ? 0 : S || (f > 0 ? 0 : h - 1)), d = C(d === 0 ? 0 : d || (f > 0 ? h : -1)), S = f > 0 ? Math.max(0, S) : Math.min(h, S), d = f > 0 ? Math.min(d, h) : Math.max(-1, d), f > 0 && d <= S) return [];
|
|
2476
|
+
if (f < 0 && S <= d) return [];
|
|
2477
|
+
for (var a = [], o = S; o != d && !(f < 0 && o <= d || f > 0 && o >= d); o += f)
|
|
2478
|
+
a.push(l[o]);
|
|
2479
|
+
return a;
|
|
2480
|
+
};
|
|
2481
|
+
function C(l) {
|
|
2482
|
+
return String(l).match(/^[0-9]+$/) ? parseInt(l) : Number.isFinite(l) ? parseInt(l, 10) : 0;
|
|
2483
|
+
}
|
|
2484
|
+
}, {}], 8: [function(x, k, D) {
|
|
2485
|
+
var C = x("util/"), l = Array.prototype.slice, S = Object.prototype.hasOwnProperty, d = k.exports = A;
|
|
2486
|
+
d.AssertionError = function(i) {
|
|
2487
|
+
this.name = "AssertionError", this.actual = i.actual, this.expected = i.expected, this.operator = i.operator, i.message ? (this.message = i.message, this.generatedMessage = !1) : (this.message = a(this), this.generatedMessage = !0);
|
|
2488
|
+
var y = i.stackStartFunction || o;
|
|
2489
|
+
if (Error.captureStackTrace)
|
|
2490
|
+
Error.captureStackTrace(this, y);
|
|
2491
|
+
else {
|
|
2492
|
+
var m = new Error();
|
|
2493
|
+
if (m.stack) {
|
|
2494
|
+
var O = m.stack, M = y.name, z = O.indexOf(`
|
|
2495
|
+
` + M);
|
|
2496
|
+
if (z >= 0) {
|
|
2497
|
+
var T = O.indexOf(`
|
|
2498
|
+
`, z + 1);
|
|
2499
|
+
O = O.substring(T + 1);
|
|
2500
|
+
}
|
|
2501
|
+
this.stack = O;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}, C.inherits(d.AssertionError, Error);
|
|
2505
|
+
function f(n, i) {
|
|
2506
|
+
return C.isUndefined(i) ? "" + i : C.isNumber(i) && !isFinite(i) || C.isFunction(i) || C.isRegExp(i) ? i.toString() : i;
|
|
2507
|
+
}
|
|
2508
|
+
function h(n, i) {
|
|
2509
|
+
return C.isString(n) ? n.length < i ? n : n.slice(0, i) : n;
|
|
2510
|
+
}
|
|
2511
|
+
function a(n) {
|
|
2512
|
+
return h(JSON.stringify(n.actual, f), 128) + " " + n.operator + " " + h(JSON.stringify(n.expected, f), 128);
|
|
2513
|
+
}
|
|
2514
|
+
function o(n, i, y, m, O) {
|
|
2515
|
+
throw new d.AssertionError({
|
|
2516
|
+
message: y,
|
|
2517
|
+
actual: n,
|
|
2518
|
+
expected: i,
|
|
2519
|
+
operator: m,
|
|
2520
|
+
stackStartFunction: O
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
d.fail = o;
|
|
2524
|
+
function A(n, i) {
|
|
2525
|
+
n || o(n, !0, i, "==", d.ok);
|
|
2526
|
+
}
|
|
2527
|
+
d.ok = A, d.equal = function(i, y, m) {
|
|
2528
|
+
i != y && o(i, y, m, "==", d.equal);
|
|
2529
|
+
}, d.notEqual = function(i, y, m) {
|
|
2530
|
+
i == y && o(i, y, m, "!=", d.notEqual);
|
|
2531
|
+
}, d.deepEqual = function(i, y, m) {
|
|
2532
|
+
s(i, y) || o(i, y, m, "deepEqual", d.deepEqual);
|
|
2533
|
+
};
|
|
2534
|
+
function s(n, i) {
|
|
2535
|
+
if (n === i)
|
|
2536
|
+
return !0;
|
|
2537
|
+
if (C.isBuffer(n) && C.isBuffer(i)) {
|
|
2538
|
+
if (n.length != i.length) return !1;
|
|
2539
|
+
for (var y = 0; y < n.length; y++)
|
|
2540
|
+
if (n[y] !== i[y]) return !1;
|
|
2541
|
+
return !0;
|
|
2542
|
+
} else return C.isDate(n) && C.isDate(i) ? n.getTime() === i.getTime() : C.isRegExp(n) && C.isRegExp(i) ? n.source === i.source && n.global === i.global && n.multiline === i.multiline && n.lastIndex === i.lastIndex && n.ignoreCase === i.ignoreCase : !C.isObject(n) && !C.isObject(i) ? n == i : r(n, i);
|
|
2543
|
+
}
|
|
2544
|
+
function p(n) {
|
|
2545
|
+
return Object.prototype.toString.call(n) == "[object Arguments]";
|
|
2546
|
+
}
|
|
2547
|
+
function r(n, i) {
|
|
2548
|
+
if (C.isNullOrUndefined(n) || C.isNullOrUndefined(i) || n.prototype !== i.prototype) return !1;
|
|
2549
|
+
if (C.isPrimitive(n) || C.isPrimitive(i))
|
|
2550
|
+
return n === i;
|
|
2551
|
+
var y = p(n), m = p(i);
|
|
2552
|
+
if (y && !m || !y && m)
|
|
2553
|
+
return !1;
|
|
2554
|
+
if (y)
|
|
2555
|
+
return n = l.call(n), i = l.call(i), s(n, i);
|
|
2556
|
+
var O = g(n), M = g(i), z, T;
|
|
2557
|
+
if (O.length != M.length)
|
|
2558
|
+
return !1;
|
|
2559
|
+
for (O.sort(), M.sort(), T = O.length - 1; T >= 0; T--)
|
|
2560
|
+
if (O[T] != M[T])
|
|
2561
|
+
return !1;
|
|
2562
|
+
for (T = O.length - 1; T >= 0; T--)
|
|
2563
|
+
if (z = O[T], !s(n[z], i[z])) return !1;
|
|
2564
|
+
return !0;
|
|
2565
|
+
}
|
|
2566
|
+
d.notDeepEqual = function(i, y, m) {
|
|
2567
|
+
s(i, y) && o(i, y, m, "notDeepEqual", d.notDeepEqual);
|
|
2568
|
+
}, d.strictEqual = function(i, y, m) {
|
|
2569
|
+
i !== y && o(i, y, m, "===", d.strictEqual);
|
|
2570
|
+
}, d.notStrictEqual = function(i, y, m) {
|
|
2571
|
+
i === y && o(i, y, m, "!==", d.notStrictEqual);
|
|
2572
|
+
};
|
|
2573
|
+
function F(n, i) {
|
|
2574
|
+
return !n || !i ? !1 : Object.prototype.toString.call(i) == "[object RegExp]" ? i.test(n) : n instanceof i ? !0 : i.call({}, n) === !0;
|
|
2575
|
+
}
|
|
2576
|
+
function w(n, i, y, m) {
|
|
2577
|
+
var O;
|
|
2578
|
+
C.isString(y) && (m = y, y = null);
|
|
2579
|
+
try {
|
|
2580
|
+
i();
|
|
2581
|
+
} catch (M) {
|
|
2582
|
+
O = M;
|
|
2583
|
+
}
|
|
2584
|
+
if (m = (y && y.name ? " (" + y.name + ")." : ".") + (m ? " " + m : "."), n && !O && o(O, y, "Missing expected exception" + m), !n && F(O, y) && o(O, y, "Got unwanted exception" + m), n && O && y && !F(O, y) || !n && O)
|
|
2585
|
+
throw O;
|
|
2586
|
+
}
|
|
2587
|
+
d.throws = function(n, i, y) {
|
|
2588
|
+
w.apply(this, [!0].concat(l.call(arguments)));
|
|
2589
|
+
}, d.doesNotThrow = function(n, i) {
|
|
2590
|
+
w.apply(this, [!1].concat(l.call(arguments)));
|
|
2591
|
+
}, d.ifError = function(n) {
|
|
2592
|
+
if (n)
|
|
2593
|
+
throw n;
|
|
2594
|
+
};
|
|
2595
|
+
var g = Object.keys || function(n) {
|
|
2596
|
+
var i = [];
|
|
2597
|
+
for (var y in n)
|
|
2598
|
+
S.call(n, y) && i.push(y);
|
|
2599
|
+
return i;
|
|
2600
|
+
};
|
|
2601
|
+
}, { "util/": 11 }], 9: [function(x, k, D) {
|
|
2602
|
+
typeof Object.create == "function" ? k.exports = function(l, S) {
|
|
2603
|
+
l.super_ = S, l.prototype = Object.create(S.prototype, {
|
|
2604
|
+
constructor: {
|
|
2605
|
+
value: l,
|
|
2606
|
+
enumerable: !1,
|
|
2607
|
+
writable: !0,
|
|
2608
|
+
configurable: !0
|
|
2609
|
+
}
|
|
2610
|
+
});
|
|
2611
|
+
} : k.exports = function(l, S) {
|
|
2612
|
+
l.super_ = S;
|
|
2613
|
+
var d = function() {
|
|
2614
|
+
};
|
|
2615
|
+
d.prototype = S.prototype, l.prototype = new d(), l.prototype.constructor = l;
|
|
2616
|
+
};
|
|
2617
|
+
}, {}], 10: [function(x, k, D) {
|
|
2618
|
+
k.exports = function(l) {
|
|
2619
|
+
return l && typeof l == "object" && typeof l.copy == "function" && typeof l.fill == "function" && typeof l.readUInt8 == "function";
|
|
2620
|
+
};
|
|
2621
|
+
}, {}], 11: [function(x, k, D) {
|
|
2622
|
+
(function(C, l) {
|
|
2623
|
+
var S = /%[sdj%]/g;
|
|
2624
|
+
D.format = function(v) {
|
|
2625
|
+
if (!M(v)) {
|
|
2626
|
+
for (var B = [], _ = 0; _ < arguments.length; _++)
|
|
2627
|
+
B.push(h(arguments[_]));
|
|
2628
|
+
return B.join(" ");
|
|
2629
|
+
}
|
|
2630
|
+
for (var _ = 1, K = arguments, re = K.length, H = String(v).replace(S, function(Q) {
|
|
2631
|
+
if (Q === "%%") return "%";
|
|
2632
|
+
if (_ >= re) return Q;
|
|
2633
|
+
switch (Q) {
|
|
2634
|
+
case "%s":
|
|
2635
|
+
return String(K[_++]);
|
|
2636
|
+
case "%d":
|
|
2637
|
+
return Number(K[_++]);
|
|
2638
|
+
case "%j":
|
|
2639
|
+
try {
|
|
2640
|
+
return JSON.stringify(K[_++]);
|
|
2641
|
+
} catch {
|
|
2642
|
+
return "[Circular]";
|
|
2643
|
+
}
|
|
2644
|
+
default:
|
|
2645
|
+
return Q;
|
|
2646
|
+
}
|
|
2647
|
+
}), W = K[_]; _ < re; W = K[++_])
|
|
2648
|
+
y(W) || !$(W) ? H += " " + W : H += " " + h(W);
|
|
2649
|
+
return H;
|
|
2650
|
+
}, D.deprecate = function(v, B) {
|
|
2651
|
+
if (T(l.process))
|
|
2652
|
+
return function() {
|
|
2653
|
+
return D.deprecate(v, B).apply(this, arguments);
|
|
2654
|
+
};
|
|
2655
|
+
if (C.noDeprecation === !0)
|
|
2656
|
+
return v;
|
|
2657
|
+
var _ = !1;
|
|
2658
|
+
function K() {
|
|
2659
|
+
if (!_) {
|
|
2660
|
+
if (C.throwDeprecation)
|
|
2661
|
+
throw new Error(B);
|
|
2662
|
+
C.traceDeprecation ? console.trace(B) : console.error(B), _ = !0;
|
|
2663
|
+
}
|
|
2664
|
+
return v.apply(this, arguments);
|
|
2665
|
+
}
|
|
2666
|
+
return K;
|
|
2667
|
+
};
|
|
2668
|
+
var d = {}, f;
|
|
2669
|
+
D.debuglog = function(v) {
|
|
2670
|
+
if (T(f) && (f = C.env.NODE_DEBUG || ""), v = v.toUpperCase(), !d[v])
|
|
2671
|
+
if (new RegExp("\\b" + v + "\\b", "i").test(f)) {
|
|
2672
|
+
var B = C.pid;
|
|
2673
|
+
d[v] = function() {
|
|
2674
|
+
var _ = D.format.apply(D, arguments);
|
|
2675
|
+
console.error("%s %d: %s", v, B, _);
|
|
2676
|
+
};
|
|
2677
|
+
} else
|
|
2678
|
+
d[v] = function() {
|
|
2679
|
+
};
|
|
2680
|
+
return d[v];
|
|
2681
|
+
};
|
|
2682
|
+
function h(v, B) {
|
|
2683
|
+
var _ = {
|
|
2684
|
+
seen: [],
|
|
2685
|
+
stylize: o
|
|
2686
|
+
};
|
|
2687
|
+
return arguments.length >= 3 && (_.depth = arguments[2]), arguments.length >= 4 && (_.colors = arguments[3]), i(B) ? _.showHidden = B : B && D._extend(_, B), T(_.showHidden) && (_.showHidden = !1), T(_.depth) && (_.depth = 2), T(_.colors) && (_.colors = !1), T(_.customInspect) && (_.customInspect = !0), _.colors && (_.stylize = a), s(_, v, _.depth);
|
|
2688
|
+
}
|
|
2689
|
+
D.inspect = h, h.colors = {
|
|
2690
|
+
bold: [1, 22],
|
|
2691
|
+
italic: [3, 23],
|
|
2692
|
+
underline: [4, 24],
|
|
2693
|
+
inverse: [7, 27],
|
|
2694
|
+
white: [37, 39],
|
|
2695
|
+
grey: [90, 39],
|
|
2696
|
+
black: [30, 39],
|
|
2697
|
+
blue: [34, 39],
|
|
2698
|
+
cyan: [36, 39],
|
|
2699
|
+
green: [32, 39],
|
|
2700
|
+
magenta: [35, 39],
|
|
2701
|
+
red: [31, 39],
|
|
2702
|
+
yellow: [33, 39]
|
|
2703
|
+
}, h.styles = {
|
|
2704
|
+
special: "cyan",
|
|
2705
|
+
number: "yellow",
|
|
2706
|
+
boolean: "yellow",
|
|
2707
|
+
undefined: "grey",
|
|
2708
|
+
null: "bold",
|
|
2709
|
+
string: "green",
|
|
2710
|
+
date: "magenta",
|
|
2711
|
+
// "name": intentionally not styling
|
|
2712
|
+
regexp: "red"
|
|
2713
|
+
};
|
|
2714
|
+
function a(v, B) {
|
|
2715
|
+
var _ = h.styles[B];
|
|
2716
|
+
return _ ? "\x1B[" + h.colors[_][0] + "m" + v + "\x1B[" + h.colors[_][1] + "m" : v;
|
|
2717
|
+
}
|
|
2718
|
+
function o(v, B) {
|
|
2719
|
+
return v;
|
|
2720
|
+
}
|
|
2721
|
+
function A(v) {
|
|
2722
|
+
var B = {};
|
|
2723
|
+
return v.forEach(function(_, K) {
|
|
2724
|
+
B[_] = !0;
|
|
2725
|
+
}), B;
|
|
2726
|
+
}
|
|
2727
|
+
function s(v, B, _) {
|
|
2728
|
+
if (v.customInspect && B && ce(B.inspect) && // Filter out the util module, it's inspect function is special
|
|
2729
|
+
B.inspect !== D.inspect && // Also filter out any prototype objects using the circular check.
|
|
2730
|
+
!(B.constructor && B.constructor.prototype === B)) {
|
|
2731
|
+
var K = B.inspect(_, v);
|
|
2732
|
+
return M(K) || (K = s(v, K, _)), K;
|
|
2733
|
+
}
|
|
2734
|
+
var re = p(v, B);
|
|
2735
|
+
if (re)
|
|
2736
|
+
return re;
|
|
2737
|
+
var H = Object.keys(B), W = A(H);
|
|
2738
|
+
if (v.showHidden && (H = Object.getOwnPropertyNames(B)), J(B) && (H.indexOf("message") >= 0 || H.indexOf("description") >= 0))
|
|
2739
|
+
return r(B);
|
|
2740
|
+
if (H.length === 0) {
|
|
2741
|
+
if (ce(B)) {
|
|
2742
|
+
var Q = B.name ? ": " + B.name : "";
|
|
2743
|
+
return v.stylize("[Function" + Q + "]", "special");
|
|
2744
|
+
}
|
|
2745
|
+
if (G(B))
|
|
2746
|
+
return v.stylize(RegExp.prototype.toString.call(B), "regexp");
|
|
2747
|
+
if (q(B))
|
|
2748
|
+
return v.stylize(Date.prototype.toString.call(B), "date");
|
|
2749
|
+
if (J(B))
|
|
2750
|
+
return r(B);
|
|
2751
|
+
}
|
|
2752
|
+
var Z = "", me = !1, Se = ["{", "}"];
|
|
2753
|
+
if (n(B) && (me = !0, Se = ["[", "]"]), ce(B)) {
|
|
2754
|
+
var Le = B.name ? ": " + B.name : "";
|
|
2755
|
+
Z = " [Function" + Le + "]";
|
|
2756
|
+
}
|
|
2757
|
+
if (G(B) && (Z = " " + RegExp.prototype.toString.call(B)), q(B) && (Z = " " + Date.prototype.toUTCString.call(B)), J(B) && (Z = " " + r(B)), H.length === 0 && (!me || B.length == 0))
|
|
2758
|
+
return Se[0] + Z + Se[1];
|
|
2759
|
+
if (_ < 0)
|
|
2760
|
+
return G(B) ? v.stylize(RegExp.prototype.toString.call(B), "regexp") : v.stylize("[Object]", "special");
|
|
2761
|
+
v.seen.push(B);
|
|
2762
|
+
var De;
|
|
2763
|
+
return me ? De = F(v, B, _, W, H) : De = H.map(function(_e) {
|
|
2764
|
+
return w(v, B, _, W, _e, me);
|
|
2765
|
+
}), v.seen.pop(), g(De, Z, Se);
|
|
2766
|
+
}
|
|
2767
|
+
function p(v, B) {
|
|
2768
|
+
if (T(B))
|
|
2769
|
+
return v.stylize("undefined", "undefined");
|
|
2770
|
+
if (M(B)) {
|
|
2771
|
+
var _ = "'" + JSON.stringify(B).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
2772
|
+
return v.stylize(_, "string");
|
|
2773
|
+
}
|
|
2774
|
+
if (O(B))
|
|
2775
|
+
return v.stylize("" + B, "number");
|
|
2776
|
+
if (i(B))
|
|
2777
|
+
return v.stylize("" + B, "boolean");
|
|
2778
|
+
if (y(B))
|
|
2779
|
+
return v.stylize("null", "null");
|
|
2780
|
+
}
|
|
2781
|
+
function r(v) {
|
|
2782
|
+
return "[" + Error.prototype.toString.call(v) + "]";
|
|
2783
|
+
}
|
|
2784
|
+
function F(v, B, _, K, re) {
|
|
2785
|
+
for (var H = [], W = 0, Q = B.length; W < Q; ++W)
|
|
2786
|
+
Ie(B, String(W)) ? H.push(w(
|
|
2787
|
+
v,
|
|
2788
|
+
B,
|
|
2789
|
+
_,
|
|
2790
|
+
K,
|
|
2791
|
+
String(W),
|
|
2792
|
+
!0
|
|
2793
|
+
)) : H.push("");
|
|
2794
|
+
return re.forEach(function(Z) {
|
|
2795
|
+
Z.match(/^\d+$/) || H.push(w(
|
|
2796
|
+
v,
|
|
2797
|
+
B,
|
|
2798
|
+
_,
|
|
2799
|
+
K,
|
|
2800
|
+
Z,
|
|
2801
|
+
!0
|
|
2802
|
+
));
|
|
2803
|
+
}), H;
|
|
2804
|
+
}
|
|
2805
|
+
function w(v, B, _, K, re, H) {
|
|
2806
|
+
var W, Q, Z;
|
|
2807
|
+
if (Z = Object.getOwnPropertyDescriptor(B, re) || { value: B[re] }, Z.get ? Z.set ? Q = v.stylize("[Getter/Setter]", "special") : Q = v.stylize("[Getter]", "special") : Z.set && (Q = v.stylize("[Setter]", "special")), Ie(K, re) || (W = "[" + re + "]"), Q || (v.seen.indexOf(Z.value) < 0 ? (y(_) ? Q = s(v, Z.value, null) : Q = s(v, Z.value, _ - 1), Q.indexOf(`
|
|
2808
|
+
`) > -1 && (H ? Q = Q.split(`
|
|
2809
|
+
`).map(function(me) {
|
|
2810
|
+
return " " + me;
|
|
2811
|
+
}).join(`
|
|
2812
|
+
`).substr(2) : Q = `
|
|
2813
|
+
` + Q.split(`
|
|
2814
|
+
`).map(function(me) {
|
|
2815
|
+
return " " + me;
|
|
2816
|
+
}).join(`
|
|
2817
|
+
`))) : Q = v.stylize("[Circular]", "special")), T(W)) {
|
|
2818
|
+
if (H && re.match(/^\d+$/))
|
|
2819
|
+
return Q;
|
|
2820
|
+
W = JSON.stringify("" + re), W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (W = W.substr(1, W.length - 2), W = v.stylize(W, "name")) : (W = W.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), W = v.stylize(W, "string"));
|
|
2821
|
+
}
|
|
2822
|
+
return W + ": " + Q;
|
|
2823
|
+
}
|
|
2824
|
+
function g(v, B, _) {
|
|
2825
|
+
var K = v.reduce(function(re, H) {
|
|
2826
|
+
return H.indexOf(`
|
|
2827
|
+
`) >= 0, re + H.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
2828
|
+
}, 0);
|
|
2829
|
+
return K > 60 ? _[0] + (B === "" ? "" : B + `
|
|
2830
|
+
`) + " " + v.join(`,
|
|
2831
|
+
`) + " " + _[1] : _[0] + B + " " + v.join(", ") + " " + _[1];
|
|
2832
|
+
}
|
|
2833
|
+
function n(v) {
|
|
2834
|
+
return Array.isArray(v);
|
|
2835
|
+
}
|
|
2836
|
+
D.isArray = n;
|
|
2837
|
+
function i(v) {
|
|
2838
|
+
return typeof v == "boolean";
|
|
2839
|
+
}
|
|
2840
|
+
D.isBoolean = i;
|
|
2841
|
+
function y(v) {
|
|
2842
|
+
return v === null;
|
|
2843
|
+
}
|
|
2844
|
+
D.isNull = y;
|
|
2845
|
+
function m(v) {
|
|
2846
|
+
return v == null;
|
|
2847
|
+
}
|
|
2848
|
+
D.isNullOrUndefined = m;
|
|
2849
|
+
function O(v) {
|
|
2850
|
+
return typeof v == "number";
|
|
2851
|
+
}
|
|
2852
|
+
D.isNumber = O;
|
|
2853
|
+
function M(v) {
|
|
2854
|
+
return typeof v == "string";
|
|
2855
|
+
}
|
|
2856
|
+
D.isString = M;
|
|
2857
|
+
function z(v) {
|
|
2858
|
+
return typeof v == "symbol";
|
|
2859
|
+
}
|
|
2860
|
+
D.isSymbol = z;
|
|
2861
|
+
function T(v) {
|
|
2862
|
+
return v === void 0;
|
|
2863
|
+
}
|
|
2864
|
+
D.isUndefined = T;
|
|
2865
|
+
function G(v) {
|
|
2866
|
+
return $(v) && Y(v) === "[object RegExp]";
|
|
2867
|
+
}
|
|
2868
|
+
D.isRegExp = G;
|
|
2869
|
+
function $(v) {
|
|
2870
|
+
return typeof v == "object" && v !== null;
|
|
2871
|
+
}
|
|
2872
|
+
D.isObject = $;
|
|
2873
|
+
function q(v) {
|
|
2874
|
+
return $(v) && Y(v) === "[object Date]";
|
|
2875
|
+
}
|
|
2876
|
+
D.isDate = q;
|
|
2877
|
+
function J(v) {
|
|
2878
|
+
return $(v) && (Y(v) === "[object Error]" || v instanceof Error);
|
|
2879
|
+
}
|
|
2880
|
+
D.isError = J;
|
|
2881
|
+
function ce(v) {
|
|
2882
|
+
return typeof v == "function";
|
|
2883
|
+
}
|
|
2884
|
+
D.isFunction = ce;
|
|
2885
|
+
function ee(v) {
|
|
2886
|
+
return v === null || typeof v == "boolean" || typeof v == "number" || typeof v == "string" || typeof v == "symbol" || // ES6 symbol
|
|
2887
|
+
typeof v > "u";
|
|
2888
|
+
}
|
|
2889
|
+
D.isPrimitive = ee, D.isBuffer = x("./support/isBuffer");
|
|
2890
|
+
function Y(v) {
|
|
2891
|
+
return Object.prototype.toString.call(v);
|
|
2892
|
+
}
|
|
2893
|
+
function fe(v) {
|
|
2894
|
+
return v < 10 ? "0" + v.toString(10) : v.toString(10);
|
|
2895
|
+
}
|
|
2896
|
+
var oe = [
|
|
2897
|
+
"Jan",
|
|
2898
|
+
"Feb",
|
|
2899
|
+
"Mar",
|
|
2900
|
+
"Apr",
|
|
2901
|
+
"May",
|
|
2902
|
+
"Jun",
|
|
2903
|
+
"Jul",
|
|
2904
|
+
"Aug",
|
|
2905
|
+
"Sep",
|
|
2906
|
+
"Oct",
|
|
2907
|
+
"Nov",
|
|
2908
|
+
"Dec"
|
|
2909
|
+
];
|
|
2910
|
+
function pe() {
|
|
2911
|
+
var v = /* @__PURE__ */ new Date(), B = [
|
|
2912
|
+
fe(v.getHours()),
|
|
2913
|
+
fe(v.getMinutes()),
|
|
2914
|
+
fe(v.getSeconds())
|
|
2915
|
+
].join(":");
|
|
2916
|
+
return [v.getDate(), oe[v.getMonth()], B].join(" ");
|
|
2917
|
+
}
|
|
2918
|
+
D.log = function() {
|
|
2919
|
+
console.log("%s - %s", pe(), D.format.apply(D, arguments));
|
|
2920
|
+
}, D.inherits = x("inherits"), D._extend = function(v, B) {
|
|
2921
|
+
if (!B || !$(B)) return v;
|
|
2922
|
+
for (var _ = Object.keys(B), K = _.length; K--; )
|
|
2923
|
+
v[_[K]] = B[_[K]];
|
|
2924
|
+
return v;
|
|
2925
|
+
};
|
|
2926
|
+
function Ie(v, B) {
|
|
2927
|
+
return Object.prototype.hasOwnProperty.call(v, B);
|
|
2928
|
+
}
|
|
2929
|
+
}).call(this, x("_process"), typeof at < "u" ? at : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2930
|
+
}, { "./support/isBuffer": 10, _process: 14, inherits: 9 }], 12: [function(x, k, D) {
|
|
2931
|
+
}, {}], 13: [function(x, k, D) {
|
|
2932
|
+
(function(C) {
|
|
2933
|
+
function l(h, a) {
|
|
2934
|
+
for (var o = 0, A = h.length - 1; A >= 0; A--) {
|
|
2935
|
+
var s = h[A];
|
|
2936
|
+
s === "." ? h.splice(A, 1) : s === ".." ? (h.splice(A, 1), o++) : o && (h.splice(A, 1), o--);
|
|
2937
|
+
}
|
|
2938
|
+
if (a)
|
|
2939
|
+
for (; o--; o)
|
|
2940
|
+
h.unshift("..");
|
|
2941
|
+
return h;
|
|
2942
|
+
}
|
|
2943
|
+
D.resolve = function() {
|
|
2944
|
+
for (var h = "", a = !1, o = arguments.length - 1; o >= -1 && !a; o--) {
|
|
2945
|
+
var A = o >= 0 ? arguments[o] : C.cwd();
|
|
2946
|
+
if (typeof A != "string")
|
|
2947
|
+
throw new TypeError("Arguments to path.resolve must be strings");
|
|
2948
|
+
if (!A)
|
|
2949
|
+
continue;
|
|
2950
|
+
h = A + "/" + h, a = A.charAt(0) === "/";
|
|
2951
|
+
}
|
|
2952
|
+
return h = l(d(h.split("/"), function(s) {
|
|
2953
|
+
return !!s;
|
|
2954
|
+
}), !a).join("/"), (a ? "/" : "") + h || ".";
|
|
2955
|
+
}, D.normalize = function(h) {
|
|
2956
|
+
var a = D.isAbsolute(h), o = f(h, -1) === "/";
|
|
2957
|
+
return h = l(d(h.split("/"), function(A) {
|
|
2958
|
+
return !!A;
|
|
2959
|
+
}), !a).join("/"), !h && !a && (h = "."), h && o && (h += "/"), (a ? "/" : "") + h;
|
|
2960
|
+
}, D.isAbsolute = function(h) {
|
|
2961
|
+
return h.charAt(0) === "/";
|
|
2962
|
+
}, D.join = function() {
|
|
2963
|
+
var h = Array.prototype.slice.call(arguments, 0);
|
|
2964
|
+
return D.normalize(d(h, function(a, o) {
|
|
2965
|
+
if (typeof a != "string")
|
|
2966
|
+
throw new TypeError("Arguments to path.join must be strings");
|
|
2967
|
+
return a;
|
|
2968
|
+
}).join("/"));
|
|
2969
|
+
}, D.relative = function(h, a) {
|
|
2970
|
+
h = D.resolve(h).substr(1), a = D.resolve(a).substr(1);
|
|
2971
|
+
function o(g) {
|
|
2972
|
+
for (var n = 0; n < g.length && g[n] === ""; n++)
|
|
2973
|
+
;
|
|
2974
|
+
for (var i = g.length - 1; i >= 0 && g[i] === ""; i--)
|
|
2975
|
+
;
|
|
2976
|
+
return n > i ? [] : g.slice(n, i - n + 1);
|
|
2977
|
+
}
|
|
2978
|
+
for (var A = o(h.split("/")), s = o(a.split("/")), p = Math.min(A.length, s.length), r = p, F = 0; F < p; F++)
|
|
2979
|
+
if (A[F] !== s[F]) {
|
|
2980
|
+
r = F;
|
|
2981
|
+
break;
|
|
2982
|
+
}
|
|
2983
|
+
for (var w = [], F = r; F < A.length; F++)
|
|
2984
|
+
w.push("..");
|
|
2985
|
+
return w = w.concat(s.slice(r)), w.join("/");
|
|
2986
|
+
}, D.sep = "/", D.delimiter = ":", D.dirname = function(h) {
|
|
2987
|
+
if (typeof h != "string" && (h = h + ""), h.length === 0) return ".";
|
|
2988
|
+
for (var a = h.charCodeAt(0), o = a === 47, A = -1, s = !0, p = h.length - 1; p >= 1; --p)
|
|
2989
|
+
if (a = h.charCodeAt(p), a === 47) {
|
|
2990
|
+
if (!s) {
|
|
2991
|
+
A = p;
|
|
2992
|
+
break;
|
|
2993
|
+
}
|
|
2994
|
+
} else
|
|
2995
|
+
s = !1;
|
|
2996
|
+
return A === -1 ? o ? "/" : "." : o && A === 1 ? "/" : h.slice(0, A);
|
|
2997
|
+
};
|
|
2998
|
+
function S(h) {
|
|
2999
|
+
typeof h != "string" && (h = h + "");
|
|
3000
|
+
var a = 0, o = -1, A = !0, s;
|
|
3001
|
+
for (s = h.length - 1; s >= 0; --s)
|
|
3002
|
+
if (h.charCodeAt(s) === 47) {
|
|
3003
|
+
if (!A) {
|
|
3004
|
+
a = s + 1;
|
|
3005
|
+
break;
|
|
3006
|
+
}
|
|
3007
|
+
} else o === -1 && (A = !1, o = s + 1);
|
|
3008
|
+
return o === -1 ? "" : h.slice(a, o);
|
|
3009
|
+
}
|
|
3010
|
+
D.basename = function(h, a) {
|
|
3011
|
+
var o = S(h);
|
|
3012
|
+
return a && o.substr(-1 * a.length) === a && (o = o.substr(0, o.length - a.length)), o;
|
|
3013
|
+
}, D.extname = function(h) {
|
|
3014
|
+
typeof h != "string" && (h = h + "");
|
|
3015
|
+
for (var a = -1, o = 0, A = -1, s = !0, p = 0, r = h.length - 1; r >= 0; --r) {
|
|
3016
|
+
var F = h.charCodeAt(r);
|
|
3017
|
+
if (F === 47) {
|
|
3018
|
+
if (!s) {
|
|
3019
|
+
o = r + 1;
|
|
3020
|
+
break;
|
|
3021
|
+
}
|
|
3022
|
+
continue;
|
|
3023
|
+
}
|
|
3024
|
+
A === -1 && (s = !1, A = r + 1), F === 46 ? a === -1 ? a = r : p !== 1 && (p = 1) : a !== -1 && (p = -1);
|
|
3025
|
+
}
|
|
3026
|
+
return a === -1 || A === -1 || // We saw a non-dot character immediately before the dot
|
|
3027
|
+
p === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
3028
|
+
p === 1 && a === A - 1 && a === o + 1 ? "" : h.slice(a, A);
|
|
3029
|
+
};
|
|
3030
|
+
function d(h, a) {
|
|
3031
|
+
if (h.filter) return h.filter(a);
|
|
3032
|
+
for (var o = [], A = 0; A < h.length; A++)
|
|
3033
|
+
a(h[A], A, h) && o.push(h[A]);
|
|
3034
|
+
return o;
|
|
3035
|
+
}
|
|
3036
|
+
var f = "ab".substr(-1) === "b" ? function(h, a, o) {
|
|
3037
|
+
return h.substr(a, o);
|
|
3038
|
+
} : function(h, a, o) {
|
|
3039
|
+
return a < 0 && (a = h.length + a), h.substr(a, o);
|
|
3040
|
+
};
|
|
3041
|
+
}).call(this, x("_process"));
|
|
3042
|
+
}, { _process: 14 }], 14: [function(x, k, D) {
|
|
3043
|
+
var C = k.exports = {}, l, S;
|
|
3044
|
+
function d() {
|
|
3045
|
+
throw new Error("setTimeout has not been defined");
|
|
3046
|
+
}
|
|
3047
|
+
function f() {
|
|
3048
|
+
throw new Error("clearTimeout has not been defined");
|
|
3049
|
+
}
|
|
3050
|
+
(function() {
|
|
3051
|
+
try {
|
|
3052
|
+
typeof setTimeout == "function" ? l = setTimeout : l = d;
|
|
3053
|
+
} catch {
|
|
3054
|
+
l = d;
|
|
3055
|
+
}
|
|
3056
|
+
try {
|
|
3057
|
+
typeof clearTimeout == "function" ? S = clearTimeout : S = f;
|
|
3058
|
+
} catch {
|
|
3059
|
+
S = f;
|
|
3060
|
+
}
|
|
3061
|
+
})();
|
|
3062
|
+
function h(n) {
|
|
3063
|
+
if (l === setTimeout)
|
|
3064
|
+
return setTimeout(n, 0);
|
|
3065
|
+
if ((l === d || !l) && setTimeout)
|
|
3066
|
+
return l = setTimeout, setTimeout(n, 0);
|
|
3067
|
+
try {
|
|
3068
|
+
return l(n, 0);
|
|
3069
|
+
} catch {
|
|
3070
|
+
try {
|
|
3071
|
+
return l.call(null, n, 0);
|
|
3072
|
+
} catch {
|
|
3073
|
+
return l.call(this, n, 0);
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
function a(n) {
|
|
3078
|
+
if (S === clearTimeout)
|
|
3079
|
+
return clearTimeout(n);
|
|
3080
|
+
if ((S === f || !S) && clearTimeout)
|
|
3081
|
+
return S = clearTimeout, clearTimeout(n);
|
|
3082
|
+
try {
|
|
3083
|
+
return S(n);
|
|
3084
|
+
} catch {
|
|
3085
|
+
try {
|
|
3086
|
+
return S.call(null, n);
|
|
3087
|
+
} catch {
|
|
3088
|
+
return S.call(this, n);
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
var o = [], A = !1, s, p = -1;
|
|
3093
|
+
function r() {
|
|
3094
|
+
!A || !s || (A = !1, s.length ? o = s.concat(o) : p = -1, o.length && F());
|
|
3095
|
+
}
|
|
3096
|
+
function F() {
|
|
3097
|
+
if (!A) {
|
|
3098
|
+
var n = h(r);
|
|
3099
|
+
A = !0;
|
|
3100
|
+
for (var i = o.length; i; ) {
|
|
3101
|
+
for (s = o, o = []; ++p < i; )
|
|
3102
|
+
s && s[p].run();
|
|
3103
|
+
p = -1, i = o.length;
|
|
3104
|
+
}
|
|
3105
|
+
s = null, A = !1, a(n);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
C.nextTick = function(n) {
|
|
3109
|
+
var i = new Array(arguments.length - 1);
|
|
3110
|
+
if (arguments.length > 1)
|
|
3111
|
+
for (var y = 1; y < arguments.length; y++)
|
|
3112
|
+
i[y - 1] = arguments[y];
|
|
3113
|
+
o.push(new w(n, i)), o.length === 1 && !A && h(F);
|
|
3114
|
+
};
|
|
3115
|
+
function w(n, i) {
|
|
3116
|
+
this.fun = n, this.array = i;
|
|
3117
|
+
}
|
|
3118
|
+
w.prototype.run = function() {
|
|
3119
|
+
this.fun.apply(null, this.array);
|
|
3120
|
+
}, C.title = "browser", C.browser = !0, C.env = {}, C.argv = [], C.version = "", C.versions = {};
|
|
3121
|
+
function g() {
|
|
3122
|
+
}
|
|
3123
|
+
C.on = g, C.addListener = g, C.once = g, C.off = g, C.removeListener = g, C.removeAllListeners = g, C.emit = g, C.prependListener = g, C.prependOnceListener = g, C.listeners = function(n) {
|
|
3124
|
+
return [];
|
|
3125
|
+
}, C.binding = function(n) {
|
|
3126
|
+
throw new Error("process.binding is not supported");
|
|
3127
|
+
}, C.cwd = function() {
|
|
3128
|
+
return "/";
|
|
3129
|
+
}, C.chdir = function(n) {
|
|
3130
|
+
throw new Error("process.chdir is not supported");
|
|
3131
|
+
}, C.umask = function() {
|
|
3132
|
+
return 0;
|
|
3133
|
+
};
|
|
3134
|
+
}, {}], 15: [function(x, k, D) {
|
|
3135
|
+
var C = x("escodegen").generate;
|
|
3136
|
+
k.exports = function(l, S) {
|
|
3137
|
+
S || (S = {});
|
|
3138
|
+
var d = {}, f = function h(a, o) {
|
|
3139
|
+
if (a.type === "Literal")
|
|
3140
|
+
return a.value;
|
|
3141
|
+
if (a.type === "UnaryExpression") {
|
|
3142
|
+
var A = h(a.argument);
|
|
3143
|
+
return a.operator === "+" ? +A : a.operator === "-" ? -A : a.operator === "~" ? ~A : a.operator === "!" ? !A : d;
|
|
3144
|
+
} else if (a.type === "ArrayExpression") {
|
|
3145
|
+
for (var s = [], p = 0, r = a.elements.length; p < r; p++) {
|
|
3146
|
+
var F = h(a.elements[p]);
|
|
3147
|
+
if (F === d) return d;
|
|
3148
|
+
s.push(F);
|
|
3149
|
+
}
|
|
3150
|
+
return s;
|
|
3151
|
+
} else if (a.type === "ObjectExpression") {
|
|
3152
|
+
for (var w = {}, p = 0; p < a.properties.length; p++) {
|
|
3153
|
+
var g = a.properties[p], n = g.value === null ? g.value : h(g.value);
|
|
3154
|
+
if (n === d) return d;
|
|
3155
|
+
w[g.key.value || g.key.name] = n;
|
|
3156
|
+
}
|
|
3157
|
+
return w;
|
|
3158
|
+
} else if (a.type === "BinaryExpression" || a.type === "LogicalExpression") {
|
|
3159
|
+
var r = h(a.left);
|
|
3160
|
+
if (r === d) return d;
|
|
3161
|
+
var i = h(a.right);
|
|
3162
|
+
if (i === d) return d;
|
|
3163
|
+
var y = a.operator;
|
|
3164
|
+
return y === "==" ? r == i : y === "===" ? r === i : y === "!=" ? r != i : y === "!==" ? r !== i : y === "+" ? r + i : y === "-" ? r - i : y === "*" ? r * i : y === "/" ? r / i : y === "%" ? r % i : y === "<" ? r < i : y === "<=" ? r <= i : y === ">" ? r > i : y === ">=" ? r >= i : y === "|" ? r | i : y === "&" ? r & i : y === "^" ? r ^ i : y === "&&" ? r && i : y === "||" ? r || i : d;
|
|
3165
|
+
} else {
|
|
3166
|
+
if (a.type === "Identifier")
|
|
3167
|
+
return {}.hasOwnProperty.call(S, a.name) ? S[a.name] : d;
|
|
3168
|
+
if (a.type === "ThisExpression")
|
|
3169
|
+
return {}.hasOwnProperty.call(S, "this") ? S.this : d;
|
|
3170
|
+
if (a.type === "CallExpression") {
|
|
3171
|
+
var m = h(a.callee);
|
|
3172
|
+
if (m === d || typeof m != "function") return d;
|
|
3173
|
+
var O = a.callee.object ? h(a.callee.object) : d;
|
|
3174
|
+
O === d && (O = null);
|
|
3175
|
+
for (var M = [], p = 0, r = a.arguments.length; p < r; p++) {
|
|
3176
|
+
var F = h(a.arguments[p]);
|
|
3177
|
+
if (F === d) return d;
|
|
3178
|
+
M.push(F);
|
|
3179
|
+
}
|
|
3180
|
+
return m.apply(O, M);
|
|
3181
|
+
} else if (a.type === "MemberExpression") {
|
|
3182
|
+
var w = h(a.object);
|
|
3183
|
+
if (w === d || typeof w == "function")
|
|
3184
|
+
return d;
|
|
3185
|
+
if (a.property.type === "Identifier")
|
|
3186
|
+
return w[a.property.name];
|
|
3187
|
+
var g = h(a.property);
|
|
3188
|
+
return g === d ? d : w[g];
|
|
3189
|
+
} else if (a.type === "ConditionalExpression") {
|
|
3190
|
+
var A = h(a.test);
|
|
3191
|
+
return A === d ? d : h(A ? a.consequent : a.alternate);
|
|
3192
|
+
} else if (a.type === "ExpressionStatement") {
|
|
3193
|
+
var A = h(a.expression);
|
|
3194
|
+
return A === d ? d : A;
|
|
3195
|
+
} else {
|
|
3196
|
+
if (a.type === "ReturnStatement")
|
|
3197
|
+
return h(a.argument);
|
|
3198
|
+
if (a.type === "FunctionExpression") {
|
|
3199
|
+
var z = a.body.body, T = {};
|
|
3200
|
+
Object.keys(S).forEach(function(oe) {
|
|
3201
|
+
T[oe] = S[oe];
|
|
3202
|
+
});
|
|
3203
|
+
for (var p = 0; p < a.params.length; p++) {
|
|
3204
|
+
var G = a.params[p];
|
|
3205
|
+
if (G.type == "Identifier")
|
|
3206
|
+
S[G.name] = null;
|
|
3207
|
+
else return d;
|
|
3208
|
+
}
|
|
3209
|
+
for (var p in z)
|
|
3210
|
+
if (h(z[p]) === d)
|
|
3211
|
+
return d;
|
|
3212
|
+
S = T;
|
|
3213
|
+
var $ = Object.keys(S), q = $.map(function(oe) {
|
|
3214
|
+
return S[oe];
|
|
3215
|
+
});
|
|
3216
|
+
return Function($.join(", "), "return " + C(a)).apply(null, q);
|
|
3217
|
+
} else if (a.type === "TemplateLiteral") {
|
|
3218
|
+
for (var J = "", p = 0; p < a.expressions.length; p++)
|
|
3219
|
+
J += h(a.quasis[p]), J += h(a.expressions[p]);
|
|
3220
|
+
return J += h(a.quasis[p]), J;
|
|
3221
|
+
} else if (a.type === "TaggedTemplateExpression") {
|
|
3222
|
+
var ce = h(a.tag), ee = a.quasi, Y = ee.quasis.map(h), fe = ee.expressions.map(h);
|
|
3223
|
+
return ce.apply(null, [Y].concat(fe));
|
|
3224
|
+
} else return a.type === "TemplateElement" ? a.value.cooked : d;
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
}(l);
|
|
3228
|
+
return f === d ? void 0 : f;
|
|
3229
|
+
};
|
|
3230
|
+
}, { escodegen: 12 }], jsonpath: [function(x, k, D) {
|
|
3231
|
+
k.exports = x("./lib/index");
|
|
3232
|
+
}, { "./lib/index": 5 }] }, {}, ["jsonpath"])("jsonpath");
|
|
3233
|
+
});
|
|
3234
|
+
}(He)), He.exports;
|
|
3235
|
+
}
|
|
3236
|
+
var rr = tr();
|
|
3237
|
+
const nr = /* @__PURE__ */ er(rr), lt = (E) => E && E.charAt(0).toUpperCase() + E.slice(1), Re = (E, P, x) => {
|
|
3238
|
+
const { globalDataContext: k, templateContext: D } = P;
|
|
3239
|
+
if (Array.isArray(E.andConditions))
|
|
3240
|
+
return E.andConditions.reduce((d, f) => d && Re(f, P, x), !0);
|
|
3241
|
+
if (Array.isArray(E.orConditions)) {
|
|
3242
|
+
const d = E.orConditions;
|
|
3243
|
+
for (const f of d)
|
|
3244
|
+
if (Re(f, P, x))
|
|
3245
|
+
return !0;
|
|
3246
|
+
return !1;
|
|
3247
|
+
}
|
|
3248
|
+
if (E.when !== void 0 && !ht(E.when))
|
|
3249
|
+
return !1;
|
|
3250
|
+
const C = (d) => ke({
|
|
3251
|
+
globalDataContext: k,
|
|
3252
|
+
templateContext: D,
|
|
3253
|
+
valueToEvaluate: d
|
|
3254
|
+
});
|
|
3255
|
+
let l;
|
|
3256
|
+
if (E.when === void 0 && E.hasOwnProperty("whenDataCountOf")) {
|
|
3257
|
+
let d;
|
|
3258
|
+
switch (E.inContext) {
|
|
3259
|
+
case "root":
|
|
3260
|
+
d = k.getRootContext().templateData;
|
|
3261
|
+
break;
|
|
3262
|
+
case "template":
|
|
3263
|
+
d = D.templateData;
|
|
3264
|
+
break;
|
|
3265
|
+
default:
|
|
3266
|
+
d = k.templateData;
|
|
3267
|
+
break;
|
|
3268
|
+
}
|
|
3269
|
+
l = nr.query(d, E.whenDataCountOf).length;
|
|
3270
|
+
} else
|
|
3271
|
+
l = (() => {
|
|
3272
|
+
if (x) {
|
|
3273
|
+
for (const [d, f] of x)
|
|
3274
|
+
if (E.hasOwnProperty(d))
|
|
3275
|
+
return f({
|
|
3276
|
+
condition: E,
|
|
3277
|
+
templateContexts: P,
|
|
3278
|
+
evaluateAgainstTemplates: (h) => C(h)
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
return C(E.when);
|
|
3282
|
+
})();
|
|
3283
|
+
if (E.hasOwnProperty("isEmpty") || E.hasOwnProperty("isNotEmpty")) {
|
|
3284
|
+
const d = (f) => E.hasOwnProperty("isEmpty") ? E.isEmpty === "not" ? !f : f : !f;
|
|
3285
|
+
if (l === null)
|
|
3286
|
+
return d(!0);
|
|
3287
|
+
switch (typeof l) {
|
|
3288
|
+
case "undefined":
|
|
3289
|
+
return d(!0);
|
|
3290
|
+
case "string":
|
|
3291
|
+
return d(l.length === 0);
|
|
3292
|
+
case "object":
|
|
3293
|
+
return d(Object.keys(l).length === 0);
|
|
3294
|
+
default:
|
|
3295
|
+
return d(!l);
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
const S = E.compareAsDates;
|
|
3299
|
+
if (E.hasOwnProperty("isNot"))
|
|
3300
|
+
return se(S, l) !== se(S, C(E.isNot));
|
|
3301
|
+
if (E.hasOwnProperty("is"))
|
|
3302
|
+
return se(S, l) === se(S, C(E.is));
|
|
3303
|
+
if (E.hasOwnProperty("containsNot") || E.hasOwnProperty("contains")) {
|
|
3304
|
+
const d = E.hasOwnProperty("containsNot"), f = d ? E.containsNot : E.contains, h = se(S, C(f));
|
|
3305
|
+
if (typeof l == "string") {
|
|
3306
|
+
if (typeof h != "string")
|
|
3307
|
+
return d;
|
|
3308
|
+
const a = l.toLowerCase().indexOf(h.toLowerCase()) !== -1;
|
|
3309
|
+
return d ? !a : a;
|
|
3310
|
+
} else
|
|
3311
|
+
for (const a of Object.values(l))
|
|
3312
|
+
if (st.isEqual(se(S, a), h))
|
|
3313
|
+
return !d;
|
|
3314
|
+
return d;
|
|
3315
|
+
}
|
|
3316
|
+
if (E.hasOwnProperty("containedByNot") || E.hasOwnProperty("containedBy")) {
|
|
3317
|
+
const d = E.hasOwnProperty("containedByNot"), f = d ? E.containedByNot : E.containedBy, h = se(S, C(f));
|
|
3318
|
+
if (typeof l == "string") {
|
|
3319
|
+
if (typeof h != "string")
|
|
3320
|
+
return d;
|
|
3321
|
+
const a = h.toLowerCase().indexOf(l.toLowerCase()) !== -1;
|
|
3322
|
+
return d ? !a : a;
|
|
3323
|
+
} else
|
|
3324
|
+
for (const a of Object.values(h))
|
|
3325
|
+
if (st.isEqual(se(S, a), l))
|
|
3326
|
+
return !d;
|
|
3327
|
+
return d;
|
|
3328
|
+
}
|
|
3329
|
+
return E.hasOwnProperty(">") ? se(S, l) > se(S, C(E[">"])) : E.hasOwnProperty(">=") ? se(S, l) >= se(S, C(E[">="])) : E.hasOwnProperty("<") ? se(S, l) < se(S, C(E["<"])) : E.hasOwnProperty("<=") ? se(S, l) <= se(S, C(E["<="])) : !0;
|
|
3330
|
+
}, ur = (E, P) => {
|
|
3331
|
+
const x = [];
|
|
3332
|
+
let k = !1;
|
|
3333
|
+
const D = {};
|
|
3334
|
+
if (!Array.isArray(E))
|
|
3335
|
+
return x;
|
|
3336
|
+
const { globalDataContext: C } = P, l = C.plugins ?? {}, S = (l == null ? void 0 : l.action) ?? {}, d = (l == null ? void 0 : l.reaction) ?? {};
|
|
3337
|
+
if (!S)
|
|
3338
|
+
return x;
|
|
3339
|
+
for (const [f, h] of E.entries()) {
|
|
3340
|
+
const a = (h == null ? void 0 : h.what) ?? void 0;
|
|
3341
|
+
if (!a)
|
|
3342
|
+
continue;
|
|
3343
|
+
let o = S[a] ?? void 0, A = d[a] ?? void 0;
|
|
3344
|
+
if (!o && !A && (o = S[lt(a)]), !o) {
|
|
3345
|
+
if (!A || h.on === void 0 || !Re(h, P))
|
|
3346
|
+
continue;
|
|
3347
|
+
if (h.on === "message") {
|
|
3348
|
+
if (!S.MessageListener)
|
|
3349
|
+
continue;
|
|
3350
|
+
x.push({ ActionComponent: S.MessageListener, actionProps: h, actionIndex: f });
|
|
3351
|
+
continue;
|
|
3352
|
+
}
|
|
3353
|
+
if (h.on === "hashchange") {
|
|
3354
|
+
if (!S.HashChangeListener)
|
|
3355
|
+
continue;
|
|
3356
|
+
x.push({ ActionComponent: S.HashChangeListener, actionProps: h, actionIndex: f });
|
|
3357
|
+
continue;
|
|
3358
|
+
}
|
|
3359
|
+
k = !0;
|
|
3360
|
+
const s = "on" + lt(h.on);
|
|
3361
|
+
Array.isArray(D[s]) || (D[s] = []), D[s].push(h);
|
|
3362
|
+
continue;
|
|
3363
|
+
}
|
|
3364
|
+
Re(h, P) && x.push({ ActionComponent: o, actionProps: h, actionIndex: f });
|
|
3365
|
+
}
|
|
3366
|
+
if (k) {
|
|
3367
|
+
if (!S.ReactOnEvent)
|
|
3368
|
+
return x;
|
|
3369
|
+
x.push({
|
|
3370
|
+
ActionComponent: S.ReactOnEvent,
|
|
3371
|
+
actionProps: D,
|
|
3372
|
+
actionIndex: "_reactOnEvent"
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
return x;
|
|
3376
|
+
}, se = (E, P) => E ? new Date(P) : P, ir = (E) => {
|
|
3377
|
+
const P = Ee(we), x = Ee(be);
|
|
3378
|
+
return E ? ur((E == null ? void 0 : E.actions) ?? [], { globalDataContext: P, templateContext: x }).reverse().reduce((D, { ActionComponent: C, actionProps: l, actionIndex: S }) => /* @__PURE__ */ le(
|
|
3379
|
+
C,
|
|
3380
|
+
{
|
|
3381
|
+
componentProps: E,
|
|
3382
|
+
actionProps: l,
|
|
3383
|
+
actionIndex: S,
|
|
3384
|
+
attributesHolderRef: E.attributesHolderRef,
|
|
3385
|
+
children: D
|
|
3386
|
+
}
|
|
3387
|
+
), (E == null ? void 0 : E.children) ?? null) : null;
|
|
3388
|
+
}, qe = (E) => {
|
|
3389
|
+
if (typeof E != "object" || Object.keys(E).length === 0)
|
|
3390
|
+
return {};
|
|
3391
|
+
const P = {
|
|
3392
|
+
class: "className"
|
|
3393
|
+
// TODO: checked to defaultChecked seems incorrect. Commented out for removal.
|
|
3394
|
+
// "checked": "defaultChecked",
|
|
3395
|
+
}, x = {};
|
|
3396
|
+
for (const [k, D] of Object.entries(E)) {
|
|
3397
|
+
const C = P.hasOwnProperty(k) ? P[k] : k;
|
|
3398
|
+
x[C] = D;
|
|
3399
|
+
}
|
|
3400
|
+
return x;
|
|
3401
|
+
}, ct = ({ props: E, currentData: P, datafield: x, path: k }) => {
|
|
3402
|
+
const D = Ee(we), C = Ee(be), l = Zt(null), S = `${E.tag}`, d = E.extra ?? {}, f = qe(E.attributes), h = qe(P.attributes);
|
|
3403
|
+
for (const A of Object.keys(h)) {
|
|
3404
|
+
if (A.charAt(0) === "+") {
|
|
3405
|
+
const s = A.substring(1);
|
|
3406
|
+
f[s] = (f[s] ?? "").length > 0 ? (
|
|
3407
|
+
// Append using a space.
|
|
3408
|
+
" " + h[A]
|
|
3409
|
+
) : (
|
|
3410
|
+
// Set directly.
|
|
3411
|
+
h[A]
|
|
3412
|
+
);
|
|
3413
|
+
continue;
|
|
3414
|
+
}
|
|
3415
|
+
f[A] = h[A];
|
|
3416
|
+
}
|
|
3417
|
+
const a = pt({ attrs: f, globalDataContext: D, templateContext: C });
|
|
3418
|
+
return /* @__PURE__ */ le(ir, { ...E, attributesHolderRef: l, children: ((A) => A && [
|
|
3419
|
+
"area",
|
|
3420
|
+
"base",
|
|
3421
|
+
"br",
|
|
3422
|
+
"col",
|
|
3423
|
+
"embed",
|
|
3424
|
+
"hr",
|
|
3425
|
+
"img",
|
|
3426
|
+
"input",
|
|
3427
|
+
"link",
|
|
3428
|
+
"meta",
|
|
3429
|
+
"param",
|
|
3430
|
+
"source",
|
|
3431
|
+
"track",
|
|
3432
|
+
"wbr"
|
|
3433
|
+
].indexOf(A) !== -1)(E.tag) ? /* @__PURE__ */ ut(it, { children: [
|
|
3434
|
+
/* @__PURE__ */ le(S, { ref: l, ...a }),
|
|
3435
|
+
Object.keys(d).length ? /* @__PURE__ */ le(ve, { props: d }) : ""
|
|
3436
|
+
] }) : /* @__PURE__ */ ut(it, { children: [
|
|
3437
|
+
/* @__PURE__ */ le(S, { ref: l, ...a, children: E.content && /* @__PURE__ */ le(
|
|
3438
|
+
ve,
|
|
3439
|
+
{
|
|
3440
|
+
currentData: P.content ?? void 0,
|
|
3441
|
+
datafield: "content",
|
|
3442
|
+
path: k + ".content",
|
|
3443
|
+
props: E.content
|
|
3444
|
+
}
|
|
3445
|
+
) }),
|
|
3446
|
+
Object.keys(d).length ? /* @__PURE__ */ le(ve, { props: d }) : ""
|
|
3447
|
+
] }) });
|
|
3448
|
+
}, ft = ({ dataLocation: E, currentPath: P, globalDataContext: x, templateContext: k }) => {
|
|
3449
|
+
if (typeof E != "string" || !(E.startsWith("~.") || E.startsWith("~~.") || E.startsWith("~>") || E.startsWith("~~>")))
|
|
3450
|
+
return E === "~" ? k.templatePath : E === "~~" ? x.templatePath : E;
|
|
3451
|
+
let D;
|
|
3452
|
+
if (E.startsWith("~~."))
|
|
3453
|
+
D = x.templatePath;
|
|
3454
|
+
else if (E.startsWith("~."))
|
|
3455
|
+
D = k.templatePath;
|
|
3456
|
+
else if (E.startsWith("~>") || E.startsWith("~~>")) {
|
|
3457
|
+
const l = E.startsWith("~>") ? "~>" : "~~>", S = E.indexOf("."), d = S === -1 ? E.substring(l.length) : E.substring(l.length, S);
|
|
3458
|
+
if (!k.templatePath.includes(d))
|
|
3459
|
+
throw new Error(
|
|
3460
|
+
d + " not found in the current template path. The current template path is: " + k.templatePath
|
|
3461
|
+
);
|
|
3462
|
+
let f;
|
|
3463
|
+
l === "~>" ? f = k.templatePath.lastIndexOf(d) : f = k.templatePath.indexOf(d), D = k.templatePath.substring(0, f + d.length);
|
|
3464
|
+
} else
|
|
3465
|
+
D = P;
|
|
3466
|
+
const C = E.split(".");
|
|
3467
|
+
return C.shift(), C.length ? D + "." + C.join(".") : D;
|
|
3468
|
+
}, pt = ({ attrs: E, globalDataContext: P, templateContext: x, options: k = {} }) => {
|
|
3469
|
+
const D = {};
|
|
3470
|
+
if (!E)
|
|
3471
|
+
return D;
|
|
3472
|
+
const C = k.normalizeBeforeEvaluation ? qe(E) : E;
|
|
3473
|
+
for (const l of Object.keys(C)) {
|
|
3474
|
+
const S = Ge({
|
|
3475
|
+
globalDataContext: P,
|
|
3476
|
+
templateContext: x,
|
|
3477
|
+
valueToEvaluate: C[l]
|
|
3478
|
+
});
|
|
3479
|
+
S && (D[l] = S);
|
|
3480
|
+
}
|
|
3481
|
+
return D;
|
|
3482
|
+
}, ke = ({ valueToEvaluate: E, globalDataContext: P, templateContext: x }) => {
|
|
3483
|
+
if (!ht(E))
|
|
3484
|
+
return E;
|
|
3485
|
+
if (E === "~")
|
|
3486
|
+
return x.templateData;
|
|
3487
|
+
if (E === "~~")
|
|
3488
|
+
return P.templateData;
|
|
3489
|
+
let k;
|
|
3490
|
+
if (E.startsWith("~~.") ? k = P == null ? void 0 : P.templateData : E.startsWith("~>") || E.startsWith("~~>") ? (E = ft({
|
|
3491
|
+
dataLocation: E,
|
|
3492
|
+
currentPath: x.templatePath,
|
|
3493
|
+
globalDataContext: P,
|
|
3494
|
+
templateContext: x
|
|
3495
|
+
}), k = P == null ? void 0 : P.templateData) : k = x == null ? void 0 : x.templateData, !k)
|
|
3496
|
+
return;
|
|
3497
|
+
const D = E.split(".");
|
|
3498
|
+
for (D.shift(); D.length; )
|
|
3499
|
+
if (typeof k != "object" || (k = k[D.shift()], k === void 0))
|
|
3500
|
+
return;
|
|
3501
|
+
return k;
|
|
3502
|
+
}, Ge = ({
|
|
3503
|
+
valueToEvaluate: E,
|
|
3504
|
+
globalDataContext: P,
|
|
3505
|
+
templateContext: x,
|
|
3506
|
+
evaluationDepth: k = 1
|
|
3507
|
+
}) => {
|
|
3508
|
+
if (k === 0 || k <= -20)
|
|
3509
|
+
return E;
|
|
3510
|
+
let C;
|
|
3511
|
+
if (typeof E == "object") {
|
|
3512
|
+
C = Array.isArray(E) ? [] : {};
|
|
3513
|
+
for (const [l, S] of Object.entries(E)) {
|
|
3514
|
+
const d = ke({
|
|
3515
|
+
globalDataContext: P,
|
|
3516
|
+
templateContext: x,
|
|
3517
|
+
valueToEvaluate: S
|
|
3518
|
+
});
|
|
3519
|
+
(k > 1 || k < 0) && typeof d == "object" && d !== null ? C[l] = Ge({
|
|
3520
|
+
valueToEvaluate: d,
|
|
3521
|
+
globalDataContext: P,
|
|
3522
|
+
templateContext: x,
|
|
3523
|
+
evaluationDepth: k - 1
|
|
3524
|
+
}) : C[l] = d;
|
|
3525
|
+
}
|
|
3526
|
+
} else
|
|
3527
|
+
C = ke({
|
|
3528
|
+
globalDataContext: P,
|
|
3529
|
+
templateContext: x,
|
|
3530
|
+
valueToEvaluate: E
|
|
3531
|
+
}), (k > 1 || k < 0) && typeof C == "object" && C !== null && (C = Ge({
|
|
3532
|
+
valueToEvaluate: C,
|
|
3533
|
+
globalDataContext: P,
|
|
3534
|
+
templateContext: x,
|
|
3535
|
+
evaluationDepth: k - 1
|
|
3536
|
+
}));
|
|
3537
|
+
return C;
|
|
3538
|
+
}, ht = (E) => typeof E != "string" || !(E.startsWith("~.") || E.startsWith("~~.") || E.startsWith("~>") || E.startsWith("~~>") || E === "~" || E === "~~") ? !1 : E, ar = ({ valueToEvaluate: E }) => {
|
|
3539
|
+
const P = Ee(we), x = Ee(be);
|
|
3540
|
+
return ke({
|
|
3541
|
+
globalDataContext: P,
|
|
3542
|
+
templateContext: x,
|
|
3543
|
+
valueToEvaluate: E
|
|
3544
|
+
});
|
|
3545
|
+
}, hr = (E, P = {}) => {
|
|
3546
|
+
const x = Ee(we), k = Ee(be);
|
|
3547
|
+
return pt({
|
|
3548
|
+
attrs: E,
|
|
3549
|
+
globalDataContext: x,
|
|
3550
|
+
templateContext: k,
|
|
3551
|
+
options: P.normalizeBeforeEvaluation === void 0 ? { ...P, normalizeBeforeEvaluation: !0 } : P
|
|
3552
|
+
});
|
|
3553
|
+
};
|
|
3554
|
+
export {
|
|
3555
|
+
ir as A,
|
|
3556
|
+
ct as H,
|
|
3557
|
+
nr as J,
|
|
3558
|
+
ar as T,
|
|
3559
|
+
ve as V,
|
|
3560
|
+
ke as a,
|
|
3561
|
+
Ge as b,
|
|
3562
|
+
ht as c,
|
|
3563
|
+
ft as d,
|
|
3564
|
+
pt as e,
|
|
3565
|
+
Re as i,
|
|
3566
|
+
qe as n,
|
|
3567
|
+
hr as u
|
|
3568
|
+
};
|