1 | function dedent(templ) {
|
2 | var values = [];
|
3 | for (var _i = 1; _i < arguments.length; _i++) {
|
4 | values[_i - 1] = arguments[_i];
|
5 | }
|
6 | var strings = Array.from(typeof templ === "string" ? [templ] : templ);
|
7 | strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
8 | var indentLengths = strings.reduce(function(arr, str2) {
|
9 | var matches = str2.match(/\n([\t ]+|(?!\s).)/g);
|
10 | if (matches) {
|
11 | return arr.concat(matches.map(function(match) {
|
12 | var _a, _b;
|
13 | return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
14 | }));
|
15 | }
|
16 | return arr;
|
17 | }, []);
|
18 | if (indentLengths.length) {
|
19 | var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
|
20 | strings = strings.map(function(str2) {
|
21 | return str2.replace(pattern_1, "\n");
|
22 | });
|
23 | }
|
24 | strings[0] = strings[0].replace(/^\r?\n/, "");
|
25 | var string = strings[0];
|
26 | values.forEach(function(value, i) {
|
27 | var endentations = string.match(/(?:^|\n)( *)$/);
|
28 | var endentation = endentations ? endentations[1] : "";
|
29 | var indentedValue = value;
|
30 | if (typeof value === "string" && value.includes("\n")) {
|
31 | indentedValue = String(value).split("\n").map(function(str2, i2) {
|
32 | return i2 === 0 ? str2 : "" + endentation + str2;
|
33 | }).join("\n");
|
34 | }
|
35 | string += indentedValue + strings[i + 1];
|
36 | });
|
37 | return string;
|
38 | }
|
39 | var SECONDS_A_MINUTE = 60;
|
40 | var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60;
|
41 | var SECONDS_A_DAY = SECONDS_A_HOUR * 24;
|
42 | var SECONDS_A_WEEK = SECONDS_A_DAY * 7;
|
43 | var MILLISECONDS_A_SECOND = 1e3;
|
44 | var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND;
|
45 | var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND;
|
46 | var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND;
|
47 | var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND;
|
48 | var MS = "millisecond";
|
49 | var S = "second";
|
50 | var MIN = "minute";
|
51 | var H = "hour";
|
52 | var D = "day";
|
53 | var W = "week";
|
54 | var M = "month";
|
55 | var Q = "quarter";
|
56 | var Y = "year";
|
57 | var DATE = "date";
|
58 | var FORMAT_DEFAULT = "YYYY-MM-DDTHH:mm:ssZ";
|
59 | var INVALID_DATE_STRING = "Invalid Date";
|
60 | var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
|
61 | var REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
|
62 | const en = {
|
63 | name: "en",
|
64 | weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
65 | months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
66 | ordinal: function ordinal(n) {
|
67 | var s = ["th", "st", "nd", "rd"];
|
68 | var v = n % 100;
|
69 | return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
|
70 | }
|
71 | };
|
72 | var padStart$1 = function padStart(string, length2, pad) {
|
73 | var s = String(string);
|
74 | if (!s || s.length >= length2)
|
75 | return string;
|
76 | return "" + Array(length2 + 1 - s.length).join(pad) + string;
|
77 | };
|
78 | var padZoneStr = function padZoneStr2(instance) {
|
79 | var negMinutes = -instance.utcOffset();
|
80 | var minutes = Math.abs(negMinutes);
|
81 | var hourOffset = Math.floor(minutes / 60);
|
82 | var minuteOffset = minutes % 60;
|
83 | return (negMinutes <= 0 ? "+" : "-") + padStart$1(hourOffset, 2, "0") + ":" + padStart$1(minuteOffset, 2, "0");
|
84 | };
|
85 | var monthDiff = function monthDiff2(a, b) {
|
86 | if (a.date() < b.date())
|
87 | return -monthDiff2(b, a);
|
88 | var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month());
|
89 | var anchor = a.clone().add(wholeMonthDiff, M);
|
90 | var c = b - anchor < 0;
|
91 | var anchor2 = a.clone().add(wholeMonthDiff + (c ? -1 : 1), M);
|
92 | return +(-(wholeMonthDiff + (b - anchor) / (c ? anchor - anchor2 : anchor2 - anchor)) || 0);
|
93 | };
|
94 | var absFloor = function absFloor2(n) {
|
95 | return n < 0 ? Math.ceil(n) || 0 : Math.floor(n);
|
96 | };
|
97 | var prettyUnit = function prettyUnit2(u) {
|
98 | var special = {
|
99 | M,
|
100 | y: Y,
|
101 | w: W,
|
102 | d: D,
|
103 | D: DATE,
|
104 | h: H,
|
105 | m: MIN,
|
106 | s: S,
|
107 | ms: MS,
|
108 | Q
|
109 | };
|
110 | return special[u] || String(u || "").toLowerCase().replace(/s$/, "");
|
111 | };
|
112 | var isUndefined = function isUndefined2(s) {
|
113 | return s === void 0;
|
114 | };
|
115 | const U = {
|
116 | s: padStart$1,
|
117 | z: padZoneStr,
|
118 | m: monthDiff,
|
119 | a: absFloor,
|
120 | p: prettyUnit,
|
121 | u: isUndefined
|
122 | };
|
123 | var L = "en";
|
124 | var Ls = {};
|
125 | Ls[L] = en;
|
126 | var isDayjs = function isDayjs2(d) {
|
127 | return d instanceof Dayjs;
|
128 | };
|
129 | var parseLocale = function parseLocale2(preset, object, isLocal) {
|
130 | var l;
|
131 | if (!preset)
|
132 | return L;
|
133 | if (typeof preset === "string") {
|
134 | var presetLower = preset.toLowerCase();
|
135 | if (Ls[presetLower]) {
|
136 | l = presetLower;
|
137 | }
|
138 | if (object) {
|
139 | Ls[presetLower] = object;
|
140 | l = presetLower;
|
141 | }
|
142 | var presetSplit = preset.split("-");
|
143 | if (!l && presetSplit.length > 1) {
|
144 | return parseLocale2(presetSplit[0]);
|
145 | }
|
146 | } else {
|
147 | var name = preset.name;
|
148 | Ls[name] = preset;
|
149 | l = name;
|
150 | }
|
151 | if (!isLocal && l)
|
152 | L = l;
|
153 | return l || !isLocal && L;
|
154 | };
|
155 | var dayjs = function dayjs2(date, c) {
|
156 | if (isDayjs(date)) {
|
157 | return date.clone();
|
158 | }
|
159 | var cfg = typeof c === "object" ? c : {};
|
160 | cfg.date = date;
|
161 | cfg.args = arguments;
|
162 | return new Dayjs(cfg);
|
163 | };
|
164 | var wrapper = function wrapper2(date, instance) {
|
165 | return dayjs(date, {
|
166 | locale: instance.$L,
|
167 | utc: instance.$u,
|
168 | x: instance.$x,
|
169 | $offset: instance.$offset
|
170 |
|
171 | });
|
172 | };
|
173 | var Utils$1 = U;
|
174 | Utils$1.l = parseLocale;
|
175 | Utils$1.i = isDayjs;
|
176 | Utils$1.w = wrapper;
|
177 | var parseDate = function parseDate2(cfg) {
|
178 | var date = cfg.date, utc = cfg.utc;
|
179 | if (date === null)
|
180 | return new Date(NaN);
|
181 | if (Utils$1.u(date))
|
182 | return new Date();
|
183 | if (date instanceof Date)
|
184 | return new Date(date);
|
185 | if (typeof date === "string" && !/Z$/i.test(date)) {
|
186 | var d = date.match(REGEX_PARSE);
|
187 | if (d) {
|
188 | var m = d[2] - 1 || 0;
|
189 | var ms = (d[7] || "0").substring(0, 3);
|
190 | if (utc) {
|
191 | return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
|
192 | }
|
193 | return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
|
194 | }
|
195 | }
|
196 | return new Date(date);
|
197 | };
|
198 | var Dayjs = function() {
|
199 | function Dayjs2(cfg) {
|
200 | this.$L = parseLocale(cfg.locale, null, true);
|
201 | this.parse(cfg);
|
202 | }
|
203 | var _proto = Dayjs2.prototype;
|
204 | _proto.parse = function parse2(cfg) {
|
205 | this.$d = parseDate(cfg);
|
206 | this.$x = cfg.x || {};
|
207 | this.init();
|
208 | };
|
209 | _proto.init = function init2() {
|
210 | var $d = this.$d;
|
211 | this.$y = $d.getFullYear();
|
212 | this.$M = $d.getMonth();
|
213 | this.$D = $d.getDate();
|
214 | this.$W = $d.getDay();
|
215 | this.$H = $d.getHours();
|
216 | this.$m = $d.getMinutes();
|
217 | this.$s = $d.getSeconds();
|
218 | this.$ms = $d.getMilliseconds();
|
219 | };
|
220 | _proto.$utils = function $utils() {
|
221 | return Utils$1;
|
222 | };
|
223 | _proto.isValid = function isValid() {
|
224 | return !(this.$d.toString() === INVALID_DATE_STRING);
|
225 | };
|
226 | _proto.isSame = function isSame(that, units) {
|
227 | var other = dayjs(that);
|
228 | return this.startOf(units) <= other && other <= this.endOf(units);
|
229 | };
|
230 | _proto.isAfter = function isAfter(that, units) {
|
231 | return dayjs(that) < this.startOf(units);
|
232 | };
|
233 | _proto.isBefore = function isBefore(that, units) {
|
234 | return this.endOf(units) < dayjs(that);
|
235 | };
|
236 | _proto.$g = function $g(input, get2, set2) {
|
237 | if (Utils$1.u(input))
|
238 | return this[get2];
|
239 | return this.set(set2, input);
|
240 | };
|
241 | _proto.unix = function unix() {
|
242 | return Math.floor(this.valueOf() / 1e3);
|
243 | };
|
244 | _proto.valueOf = function valueOf() {
|
245 | return this.$d.getTime();
|
246 | };
|
247 | _proto.startOf = function startOf(units, _startOf) {
|
248 | var _this = this;
|
249 | var isStartOf = !Utils$1.u(_startOf) ? _startOf : true;
|
250 | var unit2 = Utils$1.p(units);
|
251 | var instanceFactory = function instanceFactory2(d, m) {
|
252 | var ins = Utils$1.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this);
|
253 | return isStartOf ? ins : ins.endOf(D);
|
254 | };
|
255 | var instanceFactorySet = function instanceFactorySet2(method, slice2) {
|
256 | var argumentStart = [0, 0, 0, 0];
|
257 | var argumentEnd = [23, 59, 59, 999];
|
258 | return Utils$1.w(_this.toDate()[method].apply(
|
259 |
|
260 | _this.toDate("s"),
|
261 | (isStartOf ? argumentStart : argumentEnd).slice(slice2)
|
262 | ), _this);
|
263 | };
|
264 | var $W = this.$W, $M = this.$M, $D = this.$D;
|
265 | var utcPad = "set" + (this.$u ? "UTC" : "");
|
266 | switch (unit2) {
|
267 | case Y:
|
268 | return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11);
|
269 | case M:
|
270 | return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1);
|
271 | case W: {
|
272 | var weekStart = this.$locale().weekStart || 0;
|
273 | var gap = ($W < weekStart ? $W + 7 : $W) - weekStart;
|
274 | return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M);
|
275 | }
|
276 | case D:
|
277 | case DATE:
|
278 | return instanceFactorySet(utcPad + "Hours", 0);
|
279 | case H:
|
280 | return instanceFactorySet(utcPad + "Minutes", 1);
|
281 | case MIN:
|
282 | return instanceFactorySet(utcPad + "Seconds", 2);
|
283 | case S:
|
284 | return instanceFactorySet(utcPad + "Milliseconds", 3);
|
285 | default:
|
286 | return this.clone();
|
287 | }
|
288 | };
|
289 | _proto.endOf = function endOf(arg) {
|
290 | return this.startOf(arg, false);
|
291 | };
|
292 | _proto.$set = function $set(units, _int) {
|
293 | var _C$D$C$DATE$C$M$C$Y$C;
|
294 | var unit2 = Utils$1.p(units);
|
295 | var utcPad = "set" + (this.$u ? "UTC" : "");
|
296 | var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit2];
|
297 | var arg = unit2 === D ? this.$D + (_int - this.$W) : _int;
|
298 | if (unit2 === M || unit2 === Y) {
|
299 | var date = this.clone().set(DATE, 1);
|
300 | date.$d[name](arg);
|
301 | date.init();
|
302 | this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d;
|
303 | } else if (name)
|
304 | this.$d[name](arg);
|
305 | this.init();
|
306 | return this;
|
307 | };
|
308 | _proto.set = function set2(string, _int2) {
|
309 | return this.clone().$set(string, _int2);
|
310 | };
|
311 | _proto.get = function get2(unit2) {
|
312 | return this[Utils$1.p(unit2)]();
|
313 | };
|
314 | _proto.add = function add(number, units) {
|
315 | var _this2 = this, _C$MIN$C$H$C$S$unit;
|
316 | number = Number(number);
|
317 | var unit2 = Utils$1.p(units);
|
318 | var instanceFactorySet = function instanceFactorySet2(n) {
|
319 | var d = dayjs(_this2);
|
320 | return Utils$1.w(d.date(d.date() + Math.round(n * number)), _this2);
|
321 | };
|
322 | if (unit2 === M) {
|
323 | return this.set(M, this.$M + number);
|
324 | }
|
325 | if (unit2 === Y) {
|
326 | return this.set(Y, this.$y + number);
|
327 | }
|
328 | if (unit2 === D) {
|
329 | return instanceFactorySet(1);
|
330 | }
|
331 | if (unit2 === W) {
|
332 | return instanceFactorySet(7);
|
333 | }
|
334 | var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[MIN] = MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[H] = MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[S] = MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit2] || 1;
|
335 | var nextTimeStamp = this.$d.getTime() + number * step;
|
336 | return Utils$1.w(nextTimeStamp, this);
|
337 | };
|
338 | _proto.subtract = function subtract(number, string) {
|
339 | return this.add(number * -1, string);
|
340 | };
|
341 | _proto.format = function format2(formatStr) {
|
342 | var _this3 = this;
|
343 | var locale = this.$locale();
|
344 | if (!this.isValid())
|
345 | return locale.invalidDate || INVALID_DATE_STRING;
|
346 | var str2 = formatStr || FORMAT_DEFAULT;
|
347 | var zoneStr = Utils$1.z(this);
|
348 | var $H = this.$H, $m = this.$m, $M = this.$M;
|
349 | var weekdays = locale.weekdays, months = locale.months, meridiem = locale.meridiem;
|
350 | var getShort = function getShort2(arr, index, full, length2) {
|
351 | return arr && (arr[index] || arr(_this3, str2)) || full[index].slice(0, length2);
|
352 | };
|
353 | var get$H = function get$H2(num) {
|
354 | return Utils$1.s($H % 12 || 12, num, "0");
|
355 | };
|
356 | var meridiemFunc = meridiem || function(hour, minute, isLowercase) {
|
357 | var m = hour < 12 ? "AM" : "PM";
|
358 | return isLowercase ? m.toLowerCase() : m;
|
359 | };
|
360 | var matches = {
|
361 | YY: String(this.$y).slice(-2),
|
362 | YYYY: this.$y,
|
363 | M: $M + 1,
|
364 | MM: Utils$1.s($M + 1, 2, "0"),
|
365 | MMM: getShort(locale.monthsShort, $M, months, 3),
|
366 | MMMM: getShort(months, $M),
|
367 | D: this.$D,
|
368 | DD: Utils$1.s(this.$D, 2, "0"),
|
369 | d: String(this.$W),
|
370 | dd: getShort(locale.weekdaysMin, this.$W, weekdays, 2),
|
371 | ddd: getShort(locale.weekdaysShort, this.$W, weekdays, 3),
|
372 | dddd: weekdays[this.$W],
|
373 | H: String($H),
|
374 | HH: Utils$1.s($H, 2, "0"),
|
375 | h: get$H(1),
|
376 | hh: get$H(2),
|
377 | a: meridiemFunc($H, $m, true),
|
378 | A: meridiemFunc($H, $m, false),
|
379 | m: String($m),
|
380 | mm: Utils$1.s($m, 2, "0"),
|
381 | s: String(this.$s),
|
382 | ss: Utils$1.s(this.$s, 2, "0"),
|
383 | SSS: Utils$1.s(this.$ms, 3, "0"),
|
384 | Z: zoneStr
|
385 | // 'ZZ' logic below
|
386 | };
|
387 | return str2.replace(REGEX_FORMAT, function(match, $1) {
|
388 | return $1 || matches[match] || zoneStr.replace(":", "");
|
389 | });
|
390 | };
|
391 | _proto.utcOffset = function utcOffset() {
|
392 | return -Math.round(this.$d.getTimezoneOffset() / 15) * 15;
|
393 | };
|
394 | _proto.diff = function diff(input, units, _float) {
|
395 | var _C$Y$C$M$C$Q$C$W$C$D$;
|
396 | var unit2 = Utils$1.p(units);
|
397 | var that = dayjs(input);
|
398 | var zoneDelta = (that.utcOffset() - this.utcOffset()) * MILLISECONDS_A_MINUTE;
|
399 | var diff2 = this - that;
|
400 | var result = Utils$1.m(this, that);
|
401 | result = (_C$Y$C$M$C$Q$C$W$C$D$ = {}, _C$Y$C$M$C$Q$C$W$C$D$[Y] = result / 12, _C$Y$C$M$C$Q$C$W$C$D$[M] = result, _C$Y$C$M$C$Q$C$W$C$D$[Q] = result / 3, _C$Y$C$M$C$Q$C$W$C$D$[W] = (diff2 - zoneDelta) / MILLISECONDS_A_WEEK, _C$Y$C$M$C$Q$C$W$C$D$[D] = (diff2 - zoneDelta) / MILLISECONDS_A_DAY, _C$Y$C$M$C$Q$C$W$C$D$[H] = diff2 / MILLISECONDS_A_HOUR, _C$Y$C$M$C$Q$C$W$C$D$[MIN] = diff2 / MILLISECONDS_A_MINUTE, _C$Y$C$M$C$Q$C$W$C$D$[S] = diff2 / MILLISECONDS_A_SECOND, _C$Y$C$M$C$Q$C$W$C$D$)[unit2] || diff2;
|
402 | return _float ? result : Utils$1.a(result);
|
403 | };
|
404 | _proto.daysInMonth = function daysInMonth() {
|
405 | return this.endOf(M).$D;
|
406 | };
|
407 | _proto.$locale = function $locale() {
|
408 | return Ls[this.$L];
|
409 | };
|
410 | _proto.locale = function locale(preset, object) {
|
411 | if (!preset)
|
412 | return this.$L;
|
413 | var that = this.clone();
|
414 | var nextLocaleName = parseLocale(preset, object, true);
|
415 | if (nextLocaleName)
|
416 | that.$L = nextLocaleName;
|
417 | return that;
|
418 | };
|
419 | _proto.clone = function clone2() {
|
420 | return Utils$1.w(this.$d, this);
|
421 | };
|
422 | _proto.toDate = function toDate() {
|
423 | return new Date(this.valueOf());
|
424 | };
|
425 | _proto.toJSON = function toJSON() {
|
426 | return this.isValid() ? this.toISOString() : null;
|
427 | };
|
428 | _proto.toISOString = function toISOString() {
|
429 | return this.$d.toISOString();
|
430 | };
|
431 | _proto.toString = function toString2() {
|
432 | return this.$d.toUTCString();
|
433 | };
|
434 | return Dayjs2;
|
435 | }();
|
436 | var proto = Dayjs.prototype;
|
437 | dayjs.prototype = proto;
|
438 | [["$ms", MS], ["$s", S], ["$m", MIN], ["$H", H], ["$W", D], ["$M", M], ["$y", Y], ["$D", DATE]].forEach(function(g) {
|
439 | proto[g[1]] = function(input) {
|
440 | return this.$g(input, g[0], g[1]);
|
441 | };
|
442 | });
|
443 | dayjs.extend = function(plugin2, option) {
|
444 | if (!plugin2.$i) {
|
445 | plugin2(option, Dayjs, dayjs);
|
446 | plugin2.$i = true;
|
447 | }
|
448 | return dayjs;
|
449 | };
|
450 | dayjs.locale = parseLocale;
|
451 | dayjs.isDayjs = isDayjs;
|
452 | dayjs.unix = function(timestamp2) {
|
453 | return dayjs(timestamp2 * 1e3);
|
454 | };
|
455 | dayjs.en = Ls[L];
|
456 | dayjs.Ls = Ls;
|
457 | dayjs.p = {};
|
458 | const LEVELS = {
|
459 | trace: 0,
|
460 | debug: 1,
|
461 | info: 2,
|
462 | warn: 3,
|
463 | error: 4,
|
464 | fatal: 5
|
465 | };
|
466 | const log$1 = {
|
467 | trace: (..._args) => {
|
468 | },
|
469 | debug: (..._args) => {
|
470 | },
|
471 | info: (..._args) => {
|
472 | },
|
473 | warn: (..._args) => {
|
474 | },
|
475 | error: (..._args) => {
|
476 | },
|
477 | fatal: (..._args) => {
|
478 | }
|
479 | };
|
480 | const setLogLevel$1 = function(level = "fatal") {
|
481 | let numericLevel = LEVELS.fatal;
|
482 | if (typeof level === "string") {
|
483 | level = level.toLowerCase();
|
484 | if (level in LEVELS) {
|
485 | numericLevel = LEVELS[level];
|
486 | }
|
487 | } else if (typeof level === "number") {
|
488 | numericLevel = level;
|
489 | }
|
490 | log$1.trace = () => {
|
491 | };
|
492 | log$1.debug = () => {
|
493 | };
|
494 | log$1.info = () => {
|
495 | };
|
496 | log$1.warn = () => {
|
497 | };
|
498 | log$1.error = () => {
|
499 | };
|
500 | log$1.fatal = () => {
|
501 | };
|
502 | if (numericLevel <= LEVELS.fatal) {
|
503 | log$1.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
|
504 | }
|
505 | if (numericLevel <= LEVELS.error) {
|
506 | log$1.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
|
507 | }
|
508 | if (numericLevel <= LEVELS.warn) {
|
509 | log$1.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
|
510 | }
|
511 | if (numericLevel <= LEVELS.info) {
|
512 | log$1.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
|
513 | }
|
514 | if (numericLevel <= LEVELS.debug) {
|
515 | log$1.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
|
516 | }
|
517 | if (numericLevel <= LEVELS.trace) {
|
518 | log$1.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
|
519 | }
|
520 | };
|
521 | const format = (level) => {
|
522 | const time = dayjs().format("ss.SSS");
|
523 | return `%c${time} : ${level} : `;
|
524 | };
|
525 | var dist = {};
|
526 | Object.defineProperty(dist, "__esModule", { value: true });
|
527 | var sanitizeUrl_1 = dist.sanitizeUrl = void 0;
|
528 | var invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
|
529 | var htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g;
|
530 | var htmlCtrlEntityRegex = /&(newline|tab);/gi;
|
531 | var ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
|
532 | var urlSchemeRegex = /^.+(:|:)/gim;
|
533 | var relativeFirstCharacters = [".", "/"];
|
534 | function isRelativeUrlWithoutProtocol(url) {
|
535 | return relativeFirstCharacters.indexOf(url[0]) > -1;
|
536 | }
|
537 | function decodeHtmlCharacters(str2) {
|
538 | return str2.replace(htmlEntitiesRegex, function(match, dec) {
|
539 | return String.fromCharCode(dec);
|
540 | });
|
541 | }
|
542 | function sanitizeUrl(url) {
|
543 | var sanitizedUrl = decodeHtmlCharacters(url || "").replace(htmlCtrlEntityRegex, "").replace(ctrlCharactersRegex, "").trim();
|
544 | if (!sanitizedUrl) {
|
545 | return "about:blank";
|
546 | }
|
547 | if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
|
548 | return sanitizedUrl;
|
549 | }
|
550 | var urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
|
551 | if (!urlSchemeParseResults) {
|
552 | return sanitizedUrl;
|
553 | }
|
554 | var urlScheme = urlSchemeParseResults[0];
|
555 | if (invalidProtocolRegex.test(urlScheme)) {
|
556 | return "about:blank";
|
557 | }
|
558 | return sanitizedUrl;
|
559 | }
|
560 | sanitizeUrl_1 = dist.sanitizeUrl = sanitizeUrl;
|
561 | var noop$1 = { value: () => {
|
562 | } };
|
563 | function dispatch() {
|
564 | for (var i = 0, n = arguments.length, _2 = {}, t; i < n; ++i) {
|
565 | if (!(t = arguments[i] + "") || t in _2 || /[\s.]/.test(t))
|
566 | throw new Error("illegal type: " + t);
|
567 | _2[t] = [];
|
568 | }
|
569 | return new Dispatch(_2);
|
570 | }
|
571 | function Dispatch(_2) {
|
572 | this._ = _2;
|
573 | }
|
574 | function parseTypenames$1(typenames, types) {
|
575 | return typenames.trim().split(/^|\s+/).map(function(t) {
|
576 | var name = "", i = t.indexOf(".");
|
577 | if (i >= 0)
|
578 | name = t.slice(i + 1), t = t.slice(0, i);
|
579 | if (t && !types.hasOwnProperty(t))
|
580 | throw new Error("unknown type: " + t);
|
581 | return { type: t, name };
|
582 | });
|
583 | }
|
584 | Dispatch.prototype = dispatch.prototype = {
|
585 | constructor: Dispatch,
|
586 | on: function(typename, callback) {
|
587 | var _2 = this._, T = parseTypenames$1(typename + "", _2), t, i = -1, n = T.length;
|
588 | if (arguments.length < 2) {
|
589 | while (++i < n)
|
590 | if ((t = (typename = T[i]).type) && (t = get$1(_2[t], typename.name)))
|
591 | return t;
|
592 | return;
|
593 | }
|
594 | if (callback != null && typeof callback !== "function")
|
595 | throw new Error("invalid callback: " + callback);
|
596 | while (++i < n) {
|
597 | if (t = (typename = T[i]).type)
|
598 | _2[t] = set$2(_2[t], typename.name, callback);
|
599 | else if (callback == null)
|
600 | for (t in _2)
|
601 | _2[t] = set$2(_2[t], typename.name, null);
|
602 | }
|
603 | return this;
|
604 | },
|
605 | copy: function() {
|
606 | var copy = {}, _2 = this._;
|
607 | for (var t in _2)
|
608 | copy[t] = _2[t].slice();
|
609 | return new Dispatch(copy);
|
610 | },
|
611 | call: function(type2, that) {
|
612 | if ((n = arguments.length - 2) > 0)
|
613 | for (var args = new Array(n), i = 0, n, t; i < n; ++i)
|
614 | args[i] = arguments[i + 2];
|
615 | if (!this._.hasOwnProperty(type2))
|
616 | throw new Error("unknown type: " + type2);
|
617 | for (t = this._[type2], i = 0, n = t.length; i < n; ++i)
|
618 | t[i].value.apply(that, args);
|
619 | },
|
620 | apply: function(type2, that, args) {
|
621 | if (!this._.hasOwnProperty(type2))
|
622 | throw new Error("unknown type: " + type2);
|
623 | for (var t = this._[type2], i = 0, n = t.length; i < n; ++i)
|
624 | t[i].value.apply(that, args);
|
625 | }
|
626 | };
|
627 | function get$1(type2, name) {
|
628 | for (var i = 0, n = type2.length, c; i < n; ++i) {
|
629 | if ((c = type2[i]).name === name) {
|
630 | return c.value;
|
631 | }
|
632 | }
|
633 | }
|
634 | function set$2(type2, name, callback) {
|
635 | for (var i = 0, n = type2.length; i < n; ++i) {
|
636 | if (type2[i].name === name) {
|
637 | type2[i] = noop$1, type2 = type2.slice(0, i).concat(type2.slice(i + 1));
|
638 | break;
|
639 | }
|
640 | }
|
641 | if (callback != null)
|
642 | type2.push({ name, value: callback });
|
643 | return type2;
|
644 | }
|
645 | var xhtml = "http://www.w3.org/1999/xhtml";
|
646 | const namespaces = {
|
647 | svg: "http://www.w3.org/2000/svg",
|
648 | xhtml,
|
649 | xlink: "http://www.w3.org/1999/xlink",
|
650 | xml: "http://www.w3.org/XML/1998/namespace",
|
651 | xmlns: "http://www.w3.org/2000/xmlns/"
|
652 | };
|
653 | function namespace(name) {
|
654 | var prefix = name += "", i = prefix.indexOf(":");
|
655 | if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns")
|
656 | name = name.slice(i + 1);
|
657 | return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name;
|
658 | }
|
659 | function creatorInherit(name) {
|
660 | return function() {
|
661 | var document2 = this.ownerDocument, uri = this.namespaceURI;
|
662 | return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
|
663 | };
|
664 | }
|
665 | function creatorFixed(fullname) {
|
666 | return function() {
|
667 | return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
668 | };
|
669 | }
|
670 | function creator(name) {
|
671 | var fullname = namespace(name);
|
672 | return (fullname.local ? creatorFixed : creatorInherit)(fullname);
|
673 | }
|
674 | function none() {
|
675 | }
|
676 | function selector(selector2) {
|
677 | return selector2 == null ? none : function() {
|
678 | return this.querySelector(selector2);
|
679 | };
|
680 | }
|
681 | function selection_select(select2) {
|
682 | if (typeof select2 !== "function")
|
683 | select2 = selector(select2);
|
684 | for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
685 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node2, subnode, i = 0; i < n; ++i) {
|
686 | if ((node2 = group[i]) && (subnode = select2.call(node2, node2.__data__, i, group))) {
|
687 | if ("__data__" in node2)
|
688 | subnode.__data__ = node2.__data__;
|
689 | subgroup[i] = subnode;
|
690 | }
|
691 | }
|
692 | }
|
693 | return new Selection$1(subgroups, this._parents);
|
694 | }
|
695 | function array(x) {
|
696 | return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
|
697 | }
|
698 | function empty() {
|
699 | return [];
|
700 | }
|
701 | function selectorAll(selector2) {
|
702 | return selector2 == null ? empty : function() {
|
703 | return this.querySelectorAll(selector2);
|
704 | };
|
705 | }
|
706 | function arrayAll(select2) {
|
707 | return function() {
|
708 | return array(select2.apply(this, arguments));
|
709 | };
|
710 | }
|
711 | function selection_selectAll(select2) {
|
712 | if (typeof select2 === "function")
|
713 | select2 = arrayAll(select2);
|
714 | else
|
715 | select2 = selectorAll(select2);
|
716 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
717 | for (var group = groups[j], n = group.length, node2, i = 0; i < n; ++i) {
|
718 | if (node2 = group[i]) {
|
719 | subgroups.push(select2.call(node2, node2.__data__, i, group));
|
720 | parents.push(node2);
|
721 | }
|
722 | }
|
723 | }
|
724 | return new Selection$1(subgroups, parents);
|
725 | }
|
726 | function matcher(selector2) {
|
727 | return function() {
|
728 | return this.matches(selector2);
|
729 | };
|
730 | }
|
731 | function childMatcher(selector2) {
|
732 | return function(node2) {
|
733 | return node2.matches(selector2);
|
734 | };
|
735 | }
|
736 | var find = Array.prototype.find;
|
737 | function childFind(match) {
|
738 | return function() {
|
739 | return find.call(this.children, match);
|
740 | };
|
741 | }
|
742 | function childFirst() {
|
743 | return this.firstElementChild;
|
744 | }
|
745 | function selection_selectChild(match) {
|
746 | return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
|
747 | }
|
748 | var filter = Array.prototype.filter;
|
749 | function children() {
|
750 | return Array.from(this.children);
|
751 | }
|
752 | function childrenFilter(match) {
|
753 | return function() {
|
754 | return filter.call(this.children, match);
|
755 | };
|
756 | }
|
757 | function selection_selectChildren(match) {
|
758 | return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
759 | }
|
760 | function selection_filter(match) {
|
761 | if (typeof match !== "function")
|
762 | match = matcher(match);
|
763 | for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
764 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node2, i = 0; i < n; ++i) {
|
765 | if ((node2 = group[i]) && match.call(node2, node2.__data__, i, group)) {
|
766 | subgroup.push(node2);
|
767 | }
|
768 | }
|
769 | }
|
770 | return new Selection$1(subgroups, this._parents);
|
771 | }
|
772 | function sparse(update) {
|
773 | return new Array(update.length);
|
774 | }
|
775 | function selection_enter() {
|
776 | return new Selection$1(this._enter || this._groups.map(sparse), this._parents);
|
777 | }
|
778 | function EnterNode(parent, datum2) {
|
779 | this.ownerDocument = parent.ownerDocument;
|
780 | this.namespaceURI = parent.namespaceURI;
|
781 | this._next = null;
|
782 | this._parent = parent;
|
783 | this.__data__ = datum2;
|
784 | }
|
785 | EnterNode.prototype = {
|
786 | constructor: EnterNode,
|
787 | appendChild: function(child) {
|
788 | return this._parent.insertBefore(child, this._next);
|
789 | },
|
790 | insertBefore: function(child, next2) {
|
791 | return this._parent.insertBefore(child, next2);
|
792 | },
|
793 | querySelector: function(selector2) {
|
794 | return this._parent.querySelector(selector2);
|
795 | },
|
796 | querySelectorAll: function(selector2) {
|
797 | return this._parent.querySelectorAll(selector2);
|
798 | }
|
799 | };
|
800 | function constant$1(x) {
|
801 | return function() {
|
802 | return x;
|
803 | };
|
804 | }
|
805 | function bindIndex(parent, group, enter, update, exit, data) {
|
806 | var i = 0, node2, groupLength = group.length, dataLength = data.length;
|
807 | for (; i < dataLength; ++i) {
|
808 | if (node2 = group[i]) {
|
809 | node2.__data__ = data[i];
|
810 | update[i] = node2;
|
811 | } else {
|
812 | enter[i] = new EnterNode(parent, data[i]);
|
813 | }
|
814 | }
|
815 | for (; i < groupLength; ++i) {
|
816 | if (node2 = group[i]) {
|
817 | exit[i] = node2;
|
818 | }
|
819 | }
|
820 | }
|
821 | function bindKey(parent, group, enter, update, exit, data, key) {
|
822 | var i, node2, nodeByKeyValue = new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
|
823 | for (i = 0; i < groupLength; ++i) {
|
824 | if (node2 = group[i]) {
|
825 | keyValues[i] = keyValue = key.call(node2, node2.__data__, i, group) + "";
|
826 | if (nodeByKeyValue.has(keyValue)) {
|
827 | exit[i] = node2;
|
828 | } else {
|
829 | nodeByKeyValue.set(keyValue, node2);
|
830 | }
|
831 | }
|
832 | }
|
833 | for (i = 0; i < dataLength; ++i) {
|
834 | keyValue = key.call(parent, data[i], i, data) + "";
|
835 | if (node2 = nodeByKeyValue.get(keyValue)) {
|
836 | update[i] = node2;
|
837 | node2.__data__ = data[i];
|
838 | nodeByKeyValue.delete(keyValue);
|
839 | } else {
|
840 | enter[i] = new EnterNode(parent, data[i]);
|
841 | }
|
842 | }
|
843 | for (i = 0; i < groupLength; ++i) {
|
844 | if ((node2 = group[i]) && nodeByKeyValue.get(keyValues[i]) === node2) {
|
845 | exit[i] = node2;
|
846 | }
|
847 | }
|
848 | }
|
849 | function datum(node2) {
|
850 | return node2.__data__;
|
851 | }
|
852 | function selection_data(value, key) {
|
853 | if (!arguments.length)
|
854 | return Array.from(this, datum);
|
855 | var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
|
856 | if (typeof value !== "function")
|
857 | value = constant$1(value);
|
858 | for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
|
859 | var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
|
860 | bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
861 | for (var i0 = 0, i1 = 0, previous, next2; i0 < dataLength; ++i0) {
|
862 | if (previous = enterGroup[i0]) {
|
863 | if (i0 >= i1)
|
864 | i1 = i0 + 1;
|
865 | while (!(next2 = updateGroup[i1]) && ++i1 < dataLength)
|
866 | ;
|
867 | previous._next = next2 || null;
|
868 | }
|
869 | }
|
870 | }
|
871 | update = new Selection$1(update, parents);
|
872 | update._enter = enter;
|
873 | update._exit = exit;
|
874 | return update;
|
875 | }
|
876 | function arraylike(data) {
|
877 | return typeof data === "object" && "length" in data ? data : Array.from(data);
|
878 | }
|
879 | function selection_exit() {
|
880 | return new Selection$1(this._exit || this._groups.map(sparse), this._parents);
|
881 | }
|
882 | function selection_join(onenter, onupdate, onexit) {
|
883 | var enter = this.enter(), update = this, exit = this.exit();
|
884 | if (typeof onenter === "function") {
|
885 | enter = onenter(enter);
|
886 | if (enter)
|
887 | enter = enter.selection();
|
888 | } else {
|
889 | enter = enter.append(onenter + "");
|
890 | }
|
891 | if (onupdate != null) {
|
892 | update = onupdate(update);
|
893 | if (update)
|
894 | update = update.selection();
|
895 | }
|
896 | if (onexit == null)
|
897 | exit.remove();
|
898 | else
|
899 | onexit(exit);
|
900 | return enter && update ? enter.merge(update).order() : update;
|
901 | }
|
902 | function selection_merge(context) {
|
903 | var selection2 = context.selection ? context.selection() : context;
|
904 | for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
905 | for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node2, i = 0; i < n; ++i) {
|
906 | if (node2 = group0[i] || group1[i]) {
|
907 | merge2[i] = node2;
|
908 | }
|
909 | }
|
910 | }
|
911 | for (; j < m0; ++j) {
|
912 | merges[j] = groups0[j];
|
913 | }
|
914 | return new Selection$1(merges, this._parents);
|
915 | }
|
916 | function selection_order() {
|
917 | for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) {
|
918 | for (var group = groups[j], i = group.length - 1, next2 = group[i], node2; --i >= 0; ) {
|
919 | if (node2 = group[i]) {
|
920 | if (next2 && node2.compareDocumentPosition(next2) ^ 4)
|
921 | next2.parentNode.insertBefore(node2, next2);
|
922 | next2 = node2;
|
923 | }
|
924 | }
|
925 | }
|
926 | return this;
|
927 | }
|
928 | function selection_sort(compare) {
|
929 | if (!compare)
|
930 | compare = ascending;
|
931 | function compareNode(a, b) {
|
932 | return a && b ? compare(a.__data__, b.__data__) : !a - !b;
|
933 | }
|
934 | for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
|
935 | for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node2, i = 0; i < n; ++i) {
|
936 | if (node2 = group[i]) {
|
937 | sortgroup[i] = node2;
|
938 | }
|
939 | }
|
940 | sortgroup.sort(compareNode);
|
941 | }
|
942 | return new Selection$1(sortgroups, this._parents).order();
|
943 | }
|
944 | function ascending(a, b) {
|
945 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
946 | }
|
947 | function selection_call() {
|
948 | var callback = arguments[0];
|
949 | arguments[0] = this;
|
950 | callback.apply(null, arguments);
|
951 | return this;
|
952 | }
|
953 | function selection_nodes() {
|
954 | return Array.from(this);
|
955 | }
|
956 | function selection_node() {
|
957 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
958 | for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
|
959 | var node2 = group[i];
|
960 | if (node2)
|
961 | return node2;
|
962 | }
|
963 | }
|
964 | return null;
|
965 | }
|
966 | function selection_size() {
|
967 | let size = 0;
|
968 | for (const node2 of this)
|
969 | ++size;
|
970 | return size;
|
971 | }
|
972 | function selection_empty() {
|
973 | return !this.node();
|
974 | }
|
975 | function selection_each(callback) {
|
976 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
977 | for (var group = groups[j], i = 0, n = group.length, node2; i < n; ++i) {
|
978 | if (node2 = group[i])
|
979 | callback.call(node2, node2.__data__, i, group);
|
980 | }
|
981 | }
|
982 | return this;
|
983 | }
|
984 | function attrRemove$1(name) {
|
985 | return function() {
|
986 | this.removeAttribute(name);
|
987 | };
|
988 | }
|
989 | function attrRemoveNS$1(fullname) {
|
990 | return function() {
|
991 | this.removeAttributeNS(fullname.space, fullname.local);
|
992 | };
|
993 | }
|
994 | function attrConstant$1(name, value) {
|
995 | return function() {
|
996 | this.setAttribute(name, value);
|
997 | };
|
998 | }
|
999 | function attrConstantNS$1(fullname, value) {
|
1000 | return function() {
|
1001 | this.setAttributeNS(fullname.space, fullname.local, value);
|
1002 | };
|
1003 | }
|
1004 | function attrFunction$1(name, value) {
|
1005 | return function() {
|
1006 | var v = value.apply(this, arguments);
|
1007 | if (v == null)
|
1008 | this.removeAttribute(name);
|
1009 | else
|
1010 | this.setAttribute(name, v);
|
1011 | };
|
1012 | }
|
1013 | function attrFunctionNS$1(fullname, value) {
|
1014 | return function() {
|
1015 | var v = value.apply(this, arguments);
|
1016 | if (v == null)
|
1017 | this.removeAttributeNS(fullname.space, fullname.local);
|
1018 | else
|
1019 | this.setAttributeNS(fullname.space, fullname.local, v);
|
1020 | };
|
1021 | }
|
1022 | function selection_attr(name, value) {
|
1023 | var fullname = namespace(name);
|
1024 | if (arguments.length < 2) {
|
1025 | var node2 = this.node();
|
1026 | return fullname.local ? node2.getAttributeNS(fullname.space, fullname.local) : node2.getAttribute(fullname);
|
1027 | }
|
1028 | return this.each((value == null ? fullname.local ? attrRemoveNS$1 : attrRemove$1 : typeof value === "function" ? fullname.local ? attrFunctionNS$1 : attrFunction$1 : fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, value));
|
1029 | }
|
1030 | function defaultView(node2) {
|
1031 | return node2.ownerDocument && node2.ownerDocument.defaultView || node2.document && node2 || node2.defaultView;
|
1032 | }
|
1033 | function styleRemove$1(name) {
|
1034 | return function() {
|
1035 | this.style.removeProperty(name);
|
1036 | };
|
1037 | }
|
1038 | function styleConstant$1(name, value, priority) {
|
1039 | return function() {
|
1040 | this.style.setProperty(name, value, priority);
|
1041 | };
|
1042 | }
|
1043 | function styleFunction$1(name, value, priority) {
|
1044 | return function() {
|
1045 | var v = value.apply(this, arguments);
|
1046 | if (v == null)
|
1047 | this.style.removeProperty(name);
|
1048 | else
|
1049 | this.style.setProperty(name, v, priority);
|
1050 | };
|
1051 | }
|
1052 | function selection_style(name, value, priority) {
|
1053 | return arguments.length > 1 ? this.each((value == null ? styleRemove$1 : typeof value === "function" ? styleFunction$1 : styleConstant$1)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
|
1054 | }
|
1055 | function styleValue(node2, name) {
|
1056 | return node2.style.getPropertyValue(name) || defaultView(node2).getComputedStyle(node2, null).getPropertyValue(name);
|
1057 | }
|
1058 | function propertyRemove(name) {
|
1059 | return function() {
|
1060 | delete this[name];
|
1061 | };
|
1062 | }
|
1063 | function propertyConstant(name, value) {
|
1064 | return function() {
|
1065 | this[name] = value;
|
1066 | };
|
1067 | }
|
1068 | function propertyFunction(name, value) {
|
1069 | return function() {
|
1070 | var v = value.apply(this, arguments);
|
1071 | if (v == null)
|
1072 | delete this[name];
|
1073 | else
|
1074 | this[name] = v;
|
1075 | };
|
1076 | }
|
1077 | function selection_property(name, value) {
|
1078 | return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
|
1079 | }
|
1080 | function classArray(string) {
|
1081 | return string.trim().split(/^|\s+/);
|
1082 | }
|
1083 | function classList(node2) {
|
1084 | return node2.classList || new ClassList(node2);
|
1085 | }
|
1086 | function ClassList(node2) {
|
1087 | this._node = node2;
|
1088 | this._names = classArray(node2.getAttribute("class") || "");
|
1089 | }
|
1090 | ClassList.prototype = {
|
1091 | add: function(name) {
|
1092 | var i = this._names.indexOf(name);
|
1093 | if (i < 0) {
|
1094 | this._names.push(name);
|
1095 | this._node.setAttribute("class", this._names.join(" "));
|
1096 | }
|
1097 | },
|
1098 | remove: function(name) {
|
1099 | var i = this._names.indexOf(name);
|
1100 | if (i >= 0) {
|
1101 | this._names.splice(i, 1);
|
1102 | this._node.setAttribute("class", this._names.join(" "));
|
1103 | }
|
1104 | },
|
1105 | contains: function(name) {
|
1106 | return this._names.indexOf(name) >= 0;
|
1107 | }
|
1108 | };
|
1109 | function classedAdd(node2, names) {
|
1110 | var list = classList(node2), i = -1, n = names.length;
|
1111 | while (++i < n)
|
1112 | list.add(names[i]);
|
1113 | }
|
1114 | function classedRemove(node2, names) {
|
1115 | var list = classList(node2), i = -1, n = names.length;
|
1116 | while (++i < n)
|
1117 | list.remove(names[i]);
|
1118 | }
|
1119 | function classedTrue(names) {
|
1120 | return function() {
|
1121 | classedAdd(this, names);
|
1122 | };
|
1123 | }
|
1124 | function classedFalse(names) {
|
1125 | return function() {
|
1126 | classedRemove(this, names);
|
1127 | };
|
1128 | }
|
1129 | function classedFunction(names, value) {
|
1130 | return function() {
|
1131 | (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
1132 | };
|
1133 | }
|
1134 | function selection_classed(name, value) {
|
1135 | var names = classArray(name + "");
|
1136 | if (arguments.length < 2) {
|
1137 | var list = classList(this.node()), i = -1, n = names.length;
|
1138 | while (++i < n)
|
1139 | if (!list.contains(names[i]))
|
1140 | return false;
|
1141 | return true;
|
1142 | }
|
1143 | return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
1144 | }
|
1145 | function textRemove() {
|
1146 | this.textContent = "";
|
1147 | }
|
1148 | function textConstant$1(value) {
|
1149 | return function() {
|
1150 | this.textContent = value;
|
1151 | };
|
1152 | }
|
1153 | function textFunction$1(value) {
|
1154 | return function() {
|
1155 | var v = value.apply(this, arguments);
|
1156 | this.textContent = v == null ? "" : v;
|
1157 | };
|
1158 | }
|
1159 | function selection_text(value) {
|
1160 | return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction$1 : textConstant$1)(value)) : this.node().textContent;
|
1161 | }
|
1162 | function htmlRemove() {
|
1163 | this.innerHTML = "";
|
1164 | }
|
1165 | function htmlConstant(value) {
|
1166 | return function() {
|
1167 | this.innerHTML = value;
|
1168 | };
|
1169 | }
|
1170 | function htmlFunction(value) {
|
1171 | return function() {
|
1172 | var v = value.apply(this, arguments);
|
1173 | this.innerHTML = v == null ? "" : v;
|
1174 | };
|
1175 | }
|
1176 | function selection_html(value) {
|
1177 | return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
|
1178 | }
|
1179 | function raise() {
|
1180 | if (this.nextSibling)
|
1181 | this.parentNode.appendChild(this);
|
1182 | }
|
1183 | function selection_raise() {
|
1184 | return this.each(raise);
|
1185 | }
|
1186 | function lower() {
|
1187 | if (this.previousSibling)
|
1188 | this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
1189 | }
|
1190 | function selection_lower() {
|
1191 | return this.each(lower);
|
1192 | }
|
1193 | function selection_append(name) {
|
1194 | var create2 = typeof name === "function" ? name : creator(name);
|
1195 | return this.select(function() {
|
1196 | return this.appendChild(create2.apply(this, arguments));
|
1197 | });
|
1198 | }
|
1199 | function constantNull() {
|
1200 | return null;
|
1201 | }
|
1202 | function selection_insert(name, before) {
|
1203 | var create2 = typeof name === "function" ? name : creator(name), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
1204 | return this.select(function() {
|
1205 | return this.insertBefore(create2.apply(this, arguments), select2.apply(this, arguments) || null);
|
1206 | });
|
1207 | }
|
1208 | function remove() {
|
1209 | var parent = this.parentNode;
|
1210 | if (parent)
|
1211 | parent.removeChild(this);
|
1212 | }
|
1213 | function selection_remove() {
|
1214 | return this.each(remove);
|
1215 | }
|
1216 | function selection_cloneShallow() {
|
1217 | var clone2 = this.cloneNode(false), parent = this.parentNode;
|
1218 | return parent ? parent.insertBefore(clone2, this.nextSibling) : clone2;
|
1219 | }
|
1220 | function selection_cloneDeep() {
|
1221 | var clone2 = this.cloneNode(true), parent = this.parentNode;
|
1222 | return parent ? parent.insertBefore(clone2, this.nextSibling) : clone2;
|
1223 | }
|
1224 | function selection_clone(deep) {
|
1225 | return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
1226 | }
|
1227 | function selection_datum(value) {
|
1228 | return arguments.length ? this.property("__data__", value) : this.node().__data__;
|
1229 | }
|
1230 | function contextListener(listener) {
|
1231 | return function(event) {
|
1232 | listener.call(this, event, this.__data__);
|
1233 | };
|
1234 | }
|
1235 | function parseTypenames(typenames) {
|
1236 | return typenames.trim().split(/^|\s+/).map(function(t) {
|
1237 | var name = "", i = t.indexOf(".");
|
1238 | if (i >= 0)
|
1239 | name = t.slice(i + 1), t = t.slice(0, i);
|
1240 | return { type: t, name };
|
1241 | });
|
1242 | }
|
1243 | function onRemove(typename) {
|
1244 | return function() {
|
1245 | var on = this.__on;
|
1246 | if (!on)
|
1247 | return;
|
1248 | for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
|
1249 | if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
|
1250 | this.removeEventListener(o.type, o.listener, o.options);
|
1251 | } else {
|
1252 | on[++i] = o;
|
1253 | }
|
1254 | }
|
1255 | if (++i)
|
1256 | on.length = i;
|
1257 | else
|
1258 | delete this.__on;
|
1259 | };
|
1260 | }
|
1261 | function onAdd(typename, value, options) {
|
1262 | return function() {
|
1263 | var on = this.__on, o, listener = contextListener(value);
|
1264 | if (on)
|
1265 | for (var j = 0, m = on.length; j < m; ++j) {
|
1266 | if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
1267 | this.removeEventListener(o.type, o.listener, o.options);
|
1268 | this.addEventListener(o.type, o.listener = listener, o.options = options);
|
1269 | o.value = value;
|
1270 | return;
|
1271 | }
|
1272 | }
|
1273 | this.addEventListener(typename.type, listener, options);
|
1274 | o = { type: typename.type, name: typename.name, value, listener, options };
|
1275 | if (!on)
|
1276 | this.__on = [o];
|
1277 | else
|
1278 | on.push(o);
|
1279 | };
|
1280 | }
|
1281 | function selection_on(typename, value, options) {
|
1282 | var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
|
1283 | if (arguments.length < 2) {
|
1284 | var on = this.node().__on;
|
1285 | if (on)
|
1286 | for (var j = 0, m = on.length, o; j < m; ++j) {
|
1287 | for (i = 0, o = on[j]; i < n; ++i) {
|
1288 | if ((t = typenames[i]).type === o.type && t.name === o.name) {
|
1289 | return o.value;
|
1290 | }
|
1291 | }
|
1292 | }
|
1293 | return;
|
1294 | }
|
1295 | on = value ? onAdd : onRemove;
|
1296 | for (i = 0; i < n; ++i)
|
1297 | this.each(on(typenames[i], value, options));
|
1298 | return this;
|
1299 | }
|
1300 | function dispatchEvent(node2, type2, params) {
|
1301 | var window2 = defaultView(node2), event = window2.CustomEvent;
|
1302 | if (typeof event === "function") {
|
1303 | event = new event(type2, params);
|
1304 | } else {
|
1305 | event = window2.document.createEvent("Event");
|
1306 | if (params)
|
1307 | event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail;
|
1308 | else
|
1309 | event.initEvent(type2, false, false);
|
1310 | }
|
1311 | node2.dispatchEvent(event);
|
1312 | }
|
1313 | function dispatchConstant(type2, params) {
|
1314 | return function() {
|
1315 | return dispatchEvent(this, type2, params);
|
1316 | };
|
1317 | }
|
1318 | function dispatchFunction(type2, params) {
|
1319 | return function() {
|
1320 | return dispatchEvent(this, type2, params.apply(this, arguments));
|
1321 | };
|
1322 | }
|
1323 | function selection_dispatch(type2, params) {
|
1324 | return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params));
|
1325 | }
|
1326 | function* selection_iterator() {
|
1327 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
1328 | for (var group = groups[j], i = 0, n = group.length, node2; i < n; ++i) {
|
1329 | if (node2 = group[i])
|
1330 | yield node2;
|
1331 | }
|
1332 | }
|
1333 | }
|
1334 | var root$2 = [null];
|
1335 | function Selection$1(groups, parents) {
|
1336 | this._groups = groups;
|
1337 | this._parents = parents;
|
1338 | }
|
1339 | function selection() {
|
1340 | return new Selection$1([[document.documentElement]], root$2);
|
1341 | }
|
1342 | function selection_selection() {
|
1343 | return this;
|
1344 | }
|
1345 | Selection$1.prototype = selection.prototype = {
|
1346 | constructor: Selection$1,
|
1347 | select: selection_select,
|
1348 | selectAll: selection_selectAll,
|
1349 | selectChild: selection_selectChild,
|
1350 | selectChildren: selection_selectChildren,
|
1351 | filter: selection_filter,
|
1352 | data: selection_data,
|
1353 | enter: selection_enter,
|
1354 | exit: selection_exit,
|
1355 | join: selection_join,
|
1356 | merge: selection_merge,
|
1357 | selection: selection_selection,
|
1358 | order: selection_order,
|
1359 | sort: selection_sort,
|
1360 | call: selection_call,
|
1361 | nodes: selection_nodes,
|
1362 | node: selection_node,
|
1363 | size: selection_size,
|
1364 | empty: selection_empty,
|
1365 | each: selection_each,
|
1366 | attr: selection_attr,
|
1367 | style: selection_style,
|
1368 | property: selection_property,
|
1369 | classed: selection_classed,
|
1370 | text: selection_text,
|
1371 | html: selection_html,
|
1372 | raise: selection_raise,
|
1373 | lower: selection_lower,
|
1374 | append: selection_append,
|
1375 | insert: selection_insert,
|
1376 | remove: selection_remove,
|
1377 | clone: selection_clone,
|
1378 | datum: selection_datum,
|
1379 | on: selection_on,
|
1380 | dispatch: selection_dispatch,
|
1381 | [Symbol.iterator]: selection_iterator
|
1382 | };
|
1383 | function select(selector2) {
|
1384 | return typeof selector2 === "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root$2);
|
1385 | }
|
1386 | function define(constructor, factory, prototype) {
|
1387 | constructor.prototype = factory.prototype = prototype;
|
1388 | prototype.constructor = constructor;
|
1389 | }
|
1390 | function extend$1(parent, definition) {
|
1391 | var prototype = Object.create(parent.prototype);
|
1392 | for (var key in definition)
|
1393 | prototype[key] = definition[key];
|
1394 | return prototype;
|
1395 | }
|
1396 | function Color$2() {
|
1397 | }
|
1398 | var darker = 0.7;
|
1399 | var brighter = 1 / darker;
|
1400 | var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
1401 | var named = {
|
1402 | aliceblue: 15792383,
|
1403 | antiquewhite: 16444375,
|
1404 | aqua: 65535,
|
1405 | aquamarine: 8388564,
|
1406 | azure: 15794175,
|
1407 | beige: 16119260,
|
1408 | bisque: 16770244,
|
1409 | black: 0,
|
1410 | blanchedalmond: 16772045,
|
1411 | blue: 255,
|
1412 | blueviolet: 9055202,
|
1413 | brown: 10824234,
|
1414 | burlywood: 14596231,
|
1415 | cadetblue: 6266528,
|
1416 | chartreuse: 8388352,
|
1417 | chocolate: 13789470,
|
1418 | coral: 16744272,
|
1419 | cornflowerblue: 6591981,
|
1420 | cornsilk: 16775388,
|
1421 | crimson: 14423100,
|
1422 | cyan: 65535,
|
1423 | darkblue: 139,
|
1424 | darkcyan: 35723,
|
1425 | darkgoldenrod: 12092939,
|
1426 | darkgray: 11119017,
|
1427 | darkgreen: 25600,
|
1428 | darkgrey: 11119017,
|
1429 | darkkhaki: 12433259,
|
1430 | darkmagenta: 9109643,
|
1431 | darkolivegreen: 5597999,
|
1432 | darkorange: 16747520,
|
1433 | darkorchid: 10040012,
|
1434 | darkred: 9109504,
|
1435 | darksalmon: 15308410,
|
1436 | darkseagreen: 9419919,
|
1437 | darkslateblue: 4734347,
|
1438 | darkslategray: 3100495,
|
1439 | darkslategrey: 3100495,
|
1440 | darkturquoise: 52945,
|
1441 | darkviolet: 9699539,
|
1442 | deeppink: 16716947,
|
1443 | deepskyblue: 49151,
|
1444 | dimgray: 6908265,
|
1445 | dimgrey: 6908265,
|
1446 | dodgerblue: 2003199,
|
1447 | firebrick: 11674146,
|
1448 | floralwhite: 16775920,
|
1449 | forestgreen: 2263842,
|
1450 | fuchsia: 16711935,
|
1451 | gainsboro: 14474460,
|
1452 | ghostwhite: 16316671,
|
1453 | gold: 16766720,
|
1454 | goldenrod: 14329120,
|
1455 | gray: 8421504,
|
1456 | green: 32768,
|
1457 | greenyellow: 11403055,
|
1458 | grey: 8421504,
|
1459 | honeydew: 15794160,
|
1460 | hotpink: 16738740,
|
1461 | indianred: 13458524,
|
1462 | indigo: 4915330,
|
1463 | ivory: 16777200,
|
1464 | khaki: 15787660,
|
1465 | lavender: 15132410,
|
1466 | lavenderblush: 16773365,
|
1467 | lawngreen: 8190976,
|
1468 | lemonchiffon: 16775885,
|
1469 | lightblue: 11393254,
|
1470 | lightcoral: 15761536,
|
1471 | lightcyan: 14745599,
|
1472 | lightgoldenrodyellow: 16448210,
|
1473 | lightgray: 13882323,
|
1474 | lightgreen: 9498256,
|
1475 | lightgrey: 13882323,
|
1476 | lightpink: 16758465,
|
1477 | lightsalmon: 16752762,
|
1478 | lightseagreen: 2142890,
|
1479 | lightskyblue: 8900346,
|
1480 | lightslategray: 7833753,
|
1481 | lightslategrey: 7833753,
|
1482 | lightsteelblue: 11584734,
|
1483 | lightyellow: 16777184,
|
1484 | lime: 65280,
|
1485 | limegreen: 3329330,
|
1486 | linen: 16445670,
|
1487 | magenta: 16711935,
|
1488 | maroon: 8388608,
|
1489 | mediumaquamarine: 6737322,
|
1490 | mediumblue: 205,
|
1491 | mediumorchid: 12211667,
|
1492 | mediumpurple: 9662683,
|
1493 | mediumseagreen: 3978097,
|
1494 | mediumslateblue: 8087790,
|
1495 | mediumspringgreen: 64154,
|
1496 | mediumturquoise: 4772300,
|
1497 | mediumvioletred: 13047173,
|
1498 | midnightblue: 1644912,
|
1499 | mintcream: 16121850,
|
1500 | mistyrose: 16770273,
|
1501 | moccasin: 16770229,
|
1502 | navajowhite: 16768685,
|
1503 | navy: 128,
|
1504 | oldlace: 16643558,
|
1505 | olive: 8421376,
|
1506 | olivedrab: 7048739,
|
1507 | orange: 16753920,
|
1508 | orangered: 16729344,
|
1509 | orchid: 14315734,
|
1510 | palegoldenrod: 15657130,
|
1511 | palegreen: 10025880,
|
1512 | paleturquoise: 11529966,
|
1513 | palevioletred: 14381203,
|
1514 | papayawhip: 16773077,
|
1515 | peachpuff: 16767673,
|
1516 | peru: 13468991,
|
1517 | pink: 16761035,
|
1518 | plum: 14524637,
|
1519 | powderblue: 11591910,
|
1520 | purple: 8388736,
|
1521 | rebeccapurple: 6697881,
|
1522 | red: 16711680,
|
1523 | rosybrown: 12357519,
|
1524 | royalblue: 4286945,
|
1525 | saddlebrown: 9127187,
|
1526 | salmon: 16416882,
|
1527 | sandybrown: 16032864,
|
1528 | seagreen: 3050327,
|
1529 | seashell: 16774638,
|
1530 | sienna: 10506797,
|
1531 | silver: 12632256,
|
1532 | skyblue: 8900331,
|
1533 | slateblue: 6970061,
|
1534 | slategray: 7372944,
|
1535 | slategrey: 7372944,
|
1536 | snow: 16775930,
|
1537 | springgreen: 65407,
|
1538 | steelblue: 4620980,
|
1539 | tan: 13808780,
|
1540 | teal: 32896,
|
1541 | thistle: 14204888,
|
1542 | tomato: 16737095,
|
1543 | turquoise: 4251856,
|
1544 | violet: 15631086,
|
1545 | wheat: 16113331,
|
1546 | white: 16777215,
|
1547 | whitesmoke: 16119285,
|
1548 | yellow: 16776960,
|
1549 | yellowgreen: 10145074
|
1550 | };
|
1551 | define(Color$2, color, {
|
1552 | copy(channels2) {
|
1553 | return Object.assign(new this.constructor(), this, channels2);
|
1554 | },
|
1555 | displayable() {
|
1556 | return this.rgb().displayable();
|
1557 | },
|
1558 | hex: color_formatHex,
|
1559 |
|
1560 | formatHex: color_formatHex,
|
1561 | formatHex8: color_formatHex8,
|
1562 | formatHsl: color_formatHsl,
|
1563 | formatRgb: color_formatRgb,
|
1564 | toString: color_formatRgb
|
1565 | });
|
1566 | function color_formatHex() {
|
1567 | return this.rgb().formatHex();
|
1568 | }
|
1569 | function color_formatHex8() {
|
1570 | return this.rgb().formatHex8();
|
1571 | }
|
1572 | function color_formatHsl() {
|
1573 | return hslConvert(this).formatHsl();
|
1574 | }
|
1575 | function color_formatRgb() {
|
1576 | return this.rgb().formatRgb();
|
1577 | }
|
1578 | function color(format2) {
|
1579 | var m, l;
|
1580 | format2 = (format2 + "").trim().toLowerCase();
|
1581 | return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba$2(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba$2(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba$2(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba$2(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
1582 | }
|
1583 | function rgbn(n) {
|
1584 | return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
1585 | }
|
1586 | function rgba$2(r, g, b, a) {
|
1587 | if (a <= 0)
|
1588 | r = g = b = NaN;
|
1589 | return new Rgb(r, g, b, a);
|
1590 | }
|
1591 | function rgbConvert(o) {
|
1592 | if (!(o instanceof Color$2))
|
1593 | o = color(o);
|
1594 | if (!o)
|
1595 | return new Rgb();
|
1596 | o = o.rgb();
|
1597 | return new Rgb(o.r, o.g, o.b, o.opacity);
|
1598 | }
|
1599 | function rgb(r, g, b, opacity) {
|
1600 | return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
1601 | }
|
1602 | function Rgb(r, g, b, opacity) {
|
1603 | this.r = +r;
|
1604 | this.g = +g;
|
1605 | this.b = +b;
|
1606 | this.opacity = +opacity;
|
1607 | }
|
1608 | define(Rgb, rgb, extend$1(Color$2, {
|
1609 | brighter(k) {
|
1610 | k = k == null ? brighter : Math.pow(brighter, k);
|
1611 | return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
1612 | },
|
1613 | darker(k) {
|
1614 | k = k == null ? darker : Math.pow(darker, k);
|
1615 | return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
1616 | },
|
1617 | rgb() {
|
1618 | return this;
|
1619 | },
|
1620 | clamp() {
|
1621 | return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
1622 | },
|
1623 | displayable() {
|
1624 | return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
|
1625 | },
|
1626 | hex: rgb_formatHex,
|
1627 |
|
1628 | formatHex: rgb_formatHex,
|
1629 | formatHex8: rgb_formatHex8,
|
1630 | formatRgb: rgb_formatRgb,
|
1631 | toString: rgb_formatRgb
|
1632 | }));
|
1633 | function rgb_formatHex() {
|
1634 | return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
1635 | }
|
1636 | function rgb_formatHex8() {
|
1637 | return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
1638 | }
|
1639 | function rgb_formatRgb() {
|
1640 | const a = clampa(this.opacity);
|
1641 | return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
1642 | }
|
1643 | function clampa(opacity) {
|
1644 | return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
1645 | }
|
1646 | function clampi(value) {
|
1647 | return Math.max(0, Math.min(255, Math.round(value) || 0));
|
1648 | }
|
1649 | function hex(value) {
|
1650 | value = clampi(value);
|
1651 | return (value < 16 ? "0" : "") + value.toString(16);
|
1652 | }
|
1653 | function hsla(h, s, l, a) {
|
1654 | if (a <= 0)
|
1655 | h = s = l = NaN;
|
1656 | else if (l <= 0 || l >= 1)
|
1657 | h = s = NaN;
|
1658 | else if (s <= 0)
|
1659 | h = NaN;
|
1660 | return new Hsl(h, s, l, a);
|
1661 | }
|
1662 | function hslConvert(o) {
|
1663 | if (o instanceof Hsl)
|
1664 | return new Hsl(o.h, o.s, o.l, o.opacity);
|
1665 | if (!(o instanceof Color$2))
|
1666 | o = color(o);
|
1667 | if (!o)
|
1668 | return new Hsl();
|
1669 | if (o instanceof Hsl)
|
1670 | return o;
|
1671 | o = o.rgb();
|
1672 | var r = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r, g, b), max2 = Math.max(r, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
|
1673 | if (s) {
|
1674 | if (r === max2)
|
1675 | h = (g - b) / s + (g < b) * 6;
|
1676 | else if (g === max2)
|
1677 | h = (b - r) / s + 2;
|
1678 | else
|
1679 | h = (r - g) / s + 4;
|
1680 | s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2;
|
1681 | h *= 60;
|
1682 | } else {
|
1683 | s = l > 0 && l < 1 ? 0 : h;
|
1684 | }
|
1685 | return new Hsl(h, s, l, o.opacity);
|
1686 | }
|
1687 | function hsl(h, s, l, opacity) {
|
1688 | return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
1689 | }
|
1690 | function Hsl(h, s, l, opacity) {
|
1691 | this.h = +h;
|
1692 | this.s = +s;
|
1693 | this.l = +l;
|
1694 | this.opacity = +opacity;
|
1695 | }
|
1696 | define(Hsl, hsl, extend$1(Color$2, {
|
1697 | brighter(k) {
|
1698 | k = k == null ? brighter : Math.pow(brighter, k);
|
1699 | return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
1700 | },
|
1701 | darker(k) {
|
1702 | k = k == null ? darker : Math.pow(darker, k);
|
1703 | return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
1704 | },
|
1705 | rgb() {
|
1706 | var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
1707 | return new Rgb(
|
1708 | hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
1709 | hsl2rgb(h, m1, m2),
|
1710 | hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
1711 | this.opacity
|
1712 | );
|
1713 | },
|
1714 | clamp() {
|
1715 | return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
1716 | },
|
1717 | displayable() {
|
1718 | return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
|
1719 | },
|
1720 | formatHsl() {
|
1721 | const a = clampa(this.opacity);
|
1722 | return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
1723 | }
|
1724 | }));
|
1725 | function clamph(value) {
|
1726 | value = (value || 0) % 360;
|
1727 | return value < 0 ? value + 360 : value;
|
1728 | }
|
1729 | function clampt(value) {
|
1730 | return Math.max(0, Math.min(1, value || 0));
|
1731 | }
|
1732 | function hsl2rgb(h, m1, m2) {
|
1733 | return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
1734 | }
|
1735 | const constant = (x) => () => x;
|
1736 | function linear(a, d) {
|
1737 | return function(t) {
|
1738 | return a + t * d;
|
1739 | };
|
1740 | }
|
1741 | function exponential(a, b, y) {
|
1742 | return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
1743 | return Math.pow(a + t * b, y);
|
1744 | };
|
1745 | }
|
1746 | function hue(a, b) {
|
1747 | var d = b - a;
|
1748 | return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
1749 | }
|
1750 | function gamma(y) {
|
1751 | return (y = +y) === 1 ? nogamma : function(a, b) {
|
1752 | return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
1753 | };
|
1754 | }
|
1755 | function nogamma(a, b) {
|
1756 | var d = b - a;
|
1757 | return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
1758 | }
|
1759 | const interpolateRgb = function rgbGamma(y) {
|
1760 | var color2 = gamma(y);
|
1761 | function rgb$1(start2, end) {
|
1762 | var r = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
1763 | return function(t) {
|
1764 | start2.r = r(t);
|
1765 | start2.g = g(t);
|
1766 | start2.b = b(t);
|
1767 | start2.opacity = opacity(t);
|
1768 | return start2 + "";
|
1769 | };
|
1770 | }
|
1771 | rgb$1.gamma = rgbGamma;
|
1772 | return rgb$1;
|
1773 | }(1);
|
1774 | function interpolateNumber(a, b) {
|
1775 | return a = +a, b = +b, function(t) {
|
1776 | return a * (1 - t) + b * t;
|
1777 | };
|
1778 | }
|
1779 | var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
|
1780 | function zero(b) {
|
1781 | return function() {
|
1782 | return b;
|
1783 | };
|
1784 | }
|
1785 | function one(b) {
|
1786 | return function(t) {
|
1787 | return b(t) + "";
|
1788 | };
|
1789 | }
|
1790 | function interpolateString(a, b) {
|
1791 | var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
|
1792 | a = a + "", b = b + "";
|
1793 | while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
|
1794 | if ((bs = bm.index) > bi) {
|
1795 | bs = b.slice(bi, bs);
|
1796 | if (s[i])
|
1797 | s[i] += bs;
|
1798 | else
|
1799 | s[++i] = bs;
|
1800 | }
|
1801 | if ((am = am[0]) === (bm = bm[0])) {
|
1802 | if (s[i])
|
1803 | s[i] += bm;
|
1804 | else
|
1805 | s[++i] = bm;
|
1806 | } else {
|
1807 | s[++i] = null;
|
1808 | q.push({ i, x: interpolateNumber(am, bm) });
|
1809 | }
|
1810 | bi = reB.lastIndex;
|
1811 | }
|
1812 | if (bi < b.length) {
|
1813 | bs = b.slice(bi);
|
1814 | if (s[i])
|
1815 | s[i] += bs;
|
1816 | else
|
1817 | s[++i] = bs;
|
1818 | }
|
1819 | return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
|
1820 | for (var i2 = 0, o; i2 < b; ++i2)
|
1821 | s[(o = q[i2]).i] = o.x(t);
|
1822 | return s.join("");
|
1823 | });
|
1824 | }
|
1825 | var degrees = 180 / Math.PI;
|
1826 | var identity = {
|
1827 | translateX: 0,
|
1828 | translateY: 0,
|
1829 | rotate: 0,
|
1830 | skewX: 0,
|
1831 | scaleX: 1,
|
1832 | scaleY: 1
|
1833 | };
|
1834 | function decompose(a, b, c, d, e, f) {
|
1835 | var scaleX, scaleY, skewX;
|
1836 | if (scaleX = Math.sqrt(a * a + b * b))
|
1837 | a /= scaleX, b /= scaleX;
|
1838 | if (skewX = a * c + b * d)
|
1839 | c -= a * skewX, d -= b * skewX;
|
1840 | if (scaleY = Math.sqrt(c * c + d * d))
|
1841 | c /= scaleY, d /= scaleY, skewX /= scaleY;
|
1842 | if (a * d < b * c)
|
1843 | a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
1844 | return {
|
1845 | translateX: e,
|
1846 | translateY: f,
|
1847 | rotate: Math.atan2(b, a) * degrees,
|
1848 | skewX: Math.atan(skewX) * degrees,
|
1849 | scaleX,
|
1850 | scaleY
|
1851 | };
|
1852 | }
|
1853 | var svgNode;
|
1854 | function parseCss(value) {
|
1855 | const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
1856 | return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
1857 | }
|
1858 | function parseSvg(value) {
|
1859 | if (value == null)
|
1860 | return identity;
|
1861 | if (!svgNode)
|
1862 | svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
1863 | svgNode.setAttribute("transform", value);
|
1864 | if (!(value = svgNode.transform.baseVal.consolidate()))
|
1865 | return identity;
|
1866 | value = value.matrix;
|
1867 | return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
1868 | }
|
1869 | function interpolateTransform(parse2, pxComma, pxParen, degParen) {
|
1870 | function pop(s) {
|
1871 | return s.length ? s.pop() + " " : "";
|
1872 | }
|
1873 | function translate(xa, ya, xb, yb, s, q) {
|
1874 | if (xa !== xb || ya !== yb) {
|
1875 | var i = s.push("translate(", null, pxComma, null, pxParen);
|
1876 | q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
1877 | } else if (xb || yb) {
|
1878 | s.push("translate(" + xb + pxComma + yb + pxParen);
|
1879 | }
|
1880 | }
|
1881 | function rotate(a, b, s, q) {
|
1882 | if (a !== b) {
|
1883 | if (a - b > 180)
|
1884 | b += 360;
|
1885 | else if (b - a > 180)
|
1886 | a += 360;
|
1887 | q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
1888 | } else if (b) {
|
1889 | s.push(pop(s) + "rotate(" + b + degParen);
|
1890 | }
|
1891 | }
|
1892 | function skewX(a, b, s, q) {
|
1893 | if (a !== b) {
|
1894 | q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
1895 | } else if (b) {
|
1896 | s.push(pop(s) + "skewX(" + b + degParen);
|
1897 | }
|
1898 | }
|
1899 | function scale(xa, ya, xb, yb, s, q) {
|
1900 | if (xa !== xb || ya !== yb) {
|
1901 | var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
1902 | q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
1903 | } else if (xb !== 1 || yb !== 1) {
|
1904 | s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
1905 | }
|
1906 | }
|
1907 | return function(a, b) {
|
1908 | var s = [], q = [];
|
1909 | a = parse2(a), b = parse2(b);
|
1910 | translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
1911 | rotate(a.rotate, b.rotate, s, q);
|
1912 | skewX(a.skewX, b.skewX, s, q);
|
1913 | scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
1914 | a = b = null;
|
1915 | return function(t) {
|
1916 | var i = -1, n = q.length, o;
|
1917 | while (++i < n)
|
1918 | s[(o = q[i]).i] = o.x(t);
|
1919 | return s.join("");
|
1920 | };
|
1921 | };
|
1922 | }
|
1923 | var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
1924 | var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
1925 | var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
1926 | setTimeout(f, 17);
|
1927 | };
|
1928 | function now() {
|
1929 | return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
1930 | }
|
1931 | function clearNow() {
|
1932 | clockNow = 0;
|
1933 | }
|
1934 | function Timer() {
|
1935 | this._call = this._time = this._next = null;
|
1936 | }
|
1937 | Timer.prototype = timer.prototype = {
|
1938 | constructor: Timer,
|
1939 | restart: function(callback, delay, time) {
|
1940 | if (typeof callback !== "function")
|
1941 | throw new TypeError("callback is not a function");
|
1942 | time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
1943 | if (!this._next && taskTail !== this) {
|
1944 | if (taskTail)
|
1945 | taskTail._next = this;
|
1946 | else
|
1947 | taskHead = this;
|
1948 | taskTail = this;
|
1949 | }
|
1950 | this._call = callback;
|
1951 | this._time = time;
|
1952 | sleep();
|
1953 | },
|
1954 | stop: function() {
|
1955 | if (this._call) {
|
1956 | this._call = null;
|
1957 | this._time = Infinity;
|
1958 | sleep();
|
1959 | }
|
1960 | }
|
1961 | };
|
1962 | function timer(callback, delay, time) {
|
1963 | var t = new Timer();
|
1964 | t.restart(callback, delay, time);
|
1965 | return t;
|
1966 | }
|
1967 | function timerFlush() {
|
1968 | now();
|
1969 | ++frame;
|
1970 | var t = taskHead, e;
|
1971 | while (t) {
|
1972 | if ((e = clockNow - t._time) >= 0)
|
1973 | t._call.call(void 0, e);
|
1974 | t = t._next;
|
1975 | }
|
1976 | --frame;
|
1977 | }
|
1978 | function wake() {
|
1979 | clockNow = (clockLast = clock.now()) + clockSkew;
|
1980 | frame = timeout$1 = 0;
|
1981 | try {
|
1982 | timerFlush();
|
1983 | } finally {
|
1984 | frame = 0;
|
1985 | nap();
|
1986 | clockNow = 0;
|
1987 | }
|
1988 | }
|
1989 | function poke() {
|
1990 | var now2 = clock.now(), delay = now2 - clockLast;
|
1991 | if (delay > pokeDelay)
|
1992 | clockSkew -= delay, clockLast = now2;
|
1993 | }
|
1994 | function nap() {
|
1995 | var t0, t1 = taskHead, t2, time = Infinity;
|
1996 | while (t1) {
|
1997 | if (t1._call) {
|
1998 | if (time > t1._time)
|
1999 | time = t1._time;
|
2000 | t0 = t1, t1 = t1._next;
|
2001 | } else {
|
2002 | t2 = t1._next, t1._next = null;
|
2003 | t1 = t0 ? t0._next = t2 : taskHead = t2;
|
2004 | }
|
2005 | }
|
2006 | taskTail = t0;
|
2007 | sleep(time);
|
2008 | }
|
2009 | function sleep(time) {
|
2010 | if (frame)
|
2011 | return;
|
2012 | if (timeout$1)
|
2013 | timeout$1 = clearTimeout(timeout$1);
|
2014 | var delay = time - clockNow;
|
2015 | if (delay > 24) {
|
2016 | if (time < Infinity)
|
2017 | timeout$1 = setTimeout(wake, time - clock.now() - clockSkew);
|
2018 | if (interval)
|
2019 | interval = clearInterval(interval);
|
2020 | } else {
|
2021 | if (!interval)
|
2022 | clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
2023 | frame = 1, setFrame(wake);
|
2024 | }
|
2025 | }
|
2026 | function timeout(callback, delay, time) {
|
2027 | var t = new Timer();
|
2028 | delay = delay == null ? 0 : +delay;
|
2029 | t.restart((elapsed) => {
|
2030 | t.stop();
|
2031 | callback(elapsed + delay);
|
2032 | }, delay, time);
|
2033 | return t;
|
2034 | }
|
2035 | var emptyOn = dispatch("start", "end", "cancel", "interrupt");
|
2036 | var emptyTween = [];
|
2037 | var CREATED = 0;
|
2038 | var SCHEDULED = 1;
|
2039 | var STARTING = 2;
|
2040 | var STARTED = 3;
|
2041 | var RUNNING = 4;
|
2042 | var ENDING = 5;
|
2043 | var ENDED = 6;
|
2044 | function schedule(node2, name, id2, index, group, timing) {
|
2045 | var schedules = node2.__transition;
|
2046 | if (!schedules)
|
2047 | node2.__transition = {};
|
2048 | else if (id2 in schedules)
|
2049 | return;
|
2050 | create$1(node2, id2, {
|
2051 | name,
|
2052 | index,
|
2053 |
|
2054 | group,
|
2055 |
|
2056 | on: emptyOn,
|
2057 | tween: emptyTween,
|
2058 | time: timing.time,
|
2059 | delay: timing.delay,
|
2060 | duration: timing.duration,
|
2061 | ease: timing.ease,
|
2062 | timer: null,
|
2063 | state: CREATED
|
2064 | });
|
2065 | }
|
2066 | function init$1(node2, id2) {
|
2067 | var schedule2 = get(node2, id2);
|
2068 | if (schedule2.state > CREATED)
|
2069 | throw new Error("too late; already scheduled");
|
2070 | return schedule2;
|
2071 | }
|
2072 | function set$1(node2, id2) {
|
2073 | var schedule2 = get(node2, id2);
|
2074 | if (schedule2.state > STARTED)
|
2075 | throw new Error("too late; already running");
|
2076 | return schedule2;
|
2077 | }
|
2078 | function get(node2, id2) {
|
2079 | var schedule2 = node2.__transition;
|
2080 | if (!schedule2 || !(schedule2 = schedule2[id2]))
|
2081 | throw new Error("transition not found");
|
2082 | return schedule2;
|
2083 | }
|
2084 | function create$1(node2, id2, self2) {
|
2085 | var schedules = node2.__transition, tween;
|
2086 | schedules[id2] = self2;
|
2087 | self2.timer = timer(schedule2, 0, self2.time);
|
2088 | function schedule2(elapsed) {
|
2089 | self2.state = SCHEDULED;
|
2090 | self2.timer.restart(start2, self2.delay, self2.time);
|
2091 | if (self2.delay <= elapsed)
|
2092 | start2(elapsed - self2.delay);
|
2093 | }
|
2094 | function start2(elapsed) {
|
2095 | var i, j, n, o;
|
2096 | if (self2.state !== SCHEDULED)
|
2097 | return stop();
|
2098 | for (i in schedules) {
|
2099 | o = schedules[i];
|
2100 | if (o.name !== self2.name)
|
2101 | continue;
|
2102 | if (o.state === STARTED)
|
2103 | return timeout(start2);
|
2104 | if (o.state === RUNNING) {
|
2105 | o.state = ENDED;
|
2106 | o.timer.stop();
|
2107 | o.on.call("interrupt", node2, node2.__data__, o.index, o.group);
|
2108 | delete schedules[i];
|
2109 | } else if (+i < id2) {
|
2110 | o.state = ENDED;
|
2111 | o.timer.stop();
|
2112 | o.on.call("cancel", node2, node2.__data__, o.index, o.group);
|
2113 | delete schedules[i];
|
2114 | }
|
2115 | }
|
2116 | timeout(function() {
|
2117 | if (self2.state === STARTED) {
|
2118 | self2.state = RUNNING;
|
2119 | self2.timer.restart(tick, self2.delay, self2.time);
|
2120 | tick(elapsed);
|
2121 | }
|
2122 | });
|
2123 | self2.state = STARTING;
|
2124 | self2.on.call("start", node2, node2.__data__, self2.index, self2.group);
|
2125 | if (self2.state !== STARTING)
|
2126 | return;
|
2127 | self2.state = STARTED;
|
2128 | tween = new Array(n = self2.tween.length);
|
2129 | for (i = 0, j = -1; i < n; ++i) {
|
2130 | if (o = self2.tween[i].value.call(node2, node2.__data__, self2.index, self2.group)) {
|
2131 | tween[++j] = o;
|
2132 | }
|
2133 | }
|
2134 | tween.length = j + 1;
|
2135 | }
|
2136 | function tick(elapsed) {
|
2137 | var t = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop), self2.state = ENDING, 1), i = -1, n = tween.length;
|
2138 | while (++i < n) {
|
2139 | tween[i].call(node2, t);
|
2140 | }
|
2141 | if (self2.state === ENDING) {
|
2142 | self2.on.call("end", node2, node2.__data__, self2.index, self2.group);
|
2143 | stop();
|
2144 | }
|
2145 | }
|
2146 | function stop() {
|
2147 | self2.state = ENDED;
|
2148 | self2.timer.stop();
|
2149 | delete schedules[id2];
|
2150 | for (var i in schedules)
|
2151 | return;
|
2152 | delete node2.__transition;
|
2153 | }
|
2154 | }
|
2155 | function interrupt(node2, name) {
|
2156 | var schedules = node2.__transition, schedule2, active, empty2 = true, i;
|
2157 | if (!schedules)
|
2158 | return;
|
2159 | name = name == null ? null : name + "";
|
2160 | for (i in schedules) {
|
2161 | if ((schedule2 = schedules[i]).name !== name) {
|
2162 | empty2 = false;
|
2163 | continue;
|
2164 | }
|
2165 | active = schedule2.state > STARTING && schedule2.state < ENDING;
|
2166 | schedule2.state = ENDED;
|
2167 | schedule2.timer.stop();
|
2168 | schedule2.on.call(active ? "interrupt" : "cancel", node2, node2.__data__, schedule2.index, schedule2.group);
|
2169 | delete schedules[i];
|
2170 | }
|
2171 | if (empty2)
|
2172 | delete node2.__transition;
|
2173 | }
|
2174 | function selection_interrupt(name) {
|
2175 | return this.each(function() {
|
2176 | interrupt(this, name);
|
2177 | });
|
2178 | }
|
2179 | function tweenRemove(id2, name) {
|
2180 | var tween0, tween1;
|
2181 | return function() {
|
2182 | var schedule2 = set$1(this, id2), tween = schedule2.tween;
|
2183 | if (tween !== tween0) {
|
2184 | tween1 = tween0 = tween;
|
2185 | for (var i = 0, n = tween1.length; i < n; ++i) {
|
2186 | if (tween1[i].name === name) {
|
2187 | tween1 = tween1.slice();
|
2188 | tween1.splice(i, 1);
|
2189 | break;
|
2190 | }
|
2191 | }
|
2192 | }
|
2193 | schedule2.tween = tween1;
|
2194 | };
|
2195 | }
|
2196 | function tweenFunction(id2, name, value) {
|
2197 | var tween0, tween1;
|
2198 | if (typeof value !== "function")
|
2199 | throw new Error();
|
2200 | return function() {
|
2201 | var schedule2 = set$1(this, id2), tween = schedule2.tween;
|
2202 | if (tween !== tween0) {
|
2203 | tween1 = (tween0 = tween).slice();
|
2204 | for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) {
|
2205 | if (tween1[i].name === name) {
|
2206 | tween1[i] = t;
|
2207 | break;
|
2208 | }
|
2209 | }
|
2210 | if (i === n)
|
2211 | tween1.push(t);
|
2212 | }
|
2213 | schedule2.tween = tween1;
|
2214 | };
|
2215 | }
|
2216 | function transition_tween(name, value) {
|
2217 | var id2 = this._id;
|
2218 | name += "";
|
2219 | if (arguments.length < 2) {
|
2220 | var tween = get(this.node(), id2).tween;
|
2221 | for (var i = 0, n = tween.length, t; i < n; ++i) {
|
2222 | if ((t = tween[i]).name === name) {
|
2223 | return t.value;
|
2224 | }
|
2225 | }
|
2226 | return null;
|
2227 | }
|
2228 | return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
|
2229 | }
|
2230 | function tweenValue(transition, name, value) {
|
2231 | var id2 = transition._id;
|
2232 | transition.each(function() {
|
2233 | var schedule2 = set$1(this, id2);
|
2234 | (schedule2.value || (schedule2.value = {}))[name] = value.apply(this, arguments);
|
2235 | });
|
2236 | return function(node2) {
|
2237 | return get(node2, id2).value[name];
|
2238 | };
|
2239 | }
|
2240 | function interpolate(a, b) {
|
2241 | var c;
|
2242 | return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c = color(b)) ? (b = c, interpolateRgb) : interpolateString)(a, b);
|
2243 | }
|
2244 | function attrRemove(name) {
|
2245 | return function() {
|
2246 | this.removeAttribute(name);
|
2247 | };
|
2248 | }
|
2249 | function attrRemoveNS(fullname) {
|
2250 | return function() {
|
2251 | this.removeAttributeNS(fullname.space, fullname.local);
|
2252 | };
|
2253 | }
|
2254 | function attrConstant(name, interpolate2, value1) {
|
2255 | var string00, string1 = value1 + "", interpolate0;
|
2256 | return function() {
|
2257 | var string0 = this.getAttribute(name);
|
2258 | return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
2259 | };
|
2260 | }
|
2261 | function attrConstantNS(fullname, interpolate2, value1) {
|
2262 | var string00, string1 = value1 + "", interpolate0;
|
2263 | return function() {
|
2264 | var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
2265 | return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
2266 | };
|
2267 | }
|
2268 | function attrFunction(name, interpolate2, value) {
|
2269 | var string00, string10, interpolate0;
|
2270 | return function() {
|
2271 | var string0, value1 = value(this), string1;
|
2272 | if (value1 == null)
|
2273 | return void this.removeAttribute(name);
|
2274 | string0 = this.getAttribute(name);
|
2275 | string1 = value1 + "";
|
2276 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
2277 | };
|
2278 | }
|
2279 | function attrFunctionNS(fullname, interpolate2, value) {
|
2280 | var string00, string10, interpolate0;
|
2281 | return function() {
|
2282 | var string0, value1 = value(this), string1;
|
2283 | if (value1 == null)
|
2284 | return void this.removeAttributeNS(fullname.space, fullname.local);
|
2285 | string0 = this.getAttributeNS(fullname.space, fullname.local);
|
2286 | string1 = value1 + "";
|
2287 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
2288 | };
|
2289 | }
|
2290 | function transition_attr(name, value) {
|
2291 | var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
2292 | return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
|
2293 | }
|
2294 | function attrInterpolate(name, i) {
|
2295 | return function(t) {
|
2296 | this.setAttribute(name, i.call(this, t));
|
2297 | };
|
2298 | }
|
2299 | function attrInterpolateNS(fullname, i) {
|
2300 | return function(t) {
|
2301 | this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
2302 | };
|
2303 | }
|
2304 | function attrTweenNS(fullname, value) {
|
2305 | var t0, i0;
|
2306 | function tween() {
|
2307 | var i = value.apply(this, arguments);
|
2308 | if (i !== i0)
|
2309 | t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
2310 | return t0;
|
2311 | }
|
2312 | tween._value = value;
|
2313 | return tween;
|
2314 | }
|
2315 | function attrTween(name, value) {
|
2316 | var t0, i0;
|
2317 | function tween() {
|
2318 | var i = value.apply(this, arguments);
|
2319 | if (i !== i0)
|
2320 | t0 = (i0 = i) && attrInterpolate(name, i);
|
2321 | return t0;
|
2322 | }
|
2323 | tween._value = value;
|
2324 | return tween;
|
2325 | }
|
2326 | function transition_attrTween(name, value) {
|
2327 | var key = "attr." + name;
|
2328 | if (arguments.length < 2)
|
2329 | return (key = this.tween(key)) && key._value;
|
2330 | if (value == null)
|
2331 | return this.tween(key, null);
|
2332 | if (typeof value !== "function")
|
2333 | throw new Error();
|
2334 | var fullname = namespace(name);
|
2335 | return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
2336 | }
|
2337 | function delayFunction(id2, value) {
|
2338 | return function() {
|
2339 | init$1(this, id2).delay = +value.apply(this, arguments);
|
2340 | };
|
2341 | }
|
2342 | function delayConstant(id2, value) {
|
2343 | return value = +value, function() {
|
2344 | init$1(this, id2).delay = value;
|
2345 | };
|
2346 | }
|
2347 | function transition_delay(value) {
|
2348 | var id2 = this._id;
|
2349 | return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get(this.node(), id2).delay;
|
2350 | }
|
2351 | function durationFunction(id2, value) {
|
2352 | return function() {
|
2353 | set$1(this, id2).duration = +value.apply(this, arguments);
|
2354 | };
|
2355 | }
|
2356 | function durationConstant(id2, value) {
|
2357 | return value = +value, function() {
|
2358 | set$1(this, id2).duration = value;
|
2359 | };
|
2360 | }
|
2361 | function transition_duration(value) {
|
2362 | var id2 = this._id;
|
2363 | return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get(this.node(), id2).duration;
|
2364 | }
|
2365 | function easeConstant(id2, value) {
|
2366 | if (typeof value !== "function")
|
2367 | throw new Error();
|
2368 | return function() {
|
2369 | set$1(this, id2).ease = value;
|
2370 | };
|
2371 | }
|
2372 | function transition_ease(value) {
|
2373 | var id2 = this._id;
|
2374 | return arguments.length ? this.each(easeConstant(id2, value)) : get(this.node(), id2).ease;
|
2375 | }
|
2376 | function easeVarying(id2, value) {
|
2377 | return function() {
|
2378 | var v = value.apply(this, arguments);
|
2379 | if (typeof v !== "function")
|
2380 | throw new Error();
|
2381 | set$1(this, id2).ease = v;
|
2382 | };
|
2383 | }
|
2384 | function transition_easeVarying(value) {
|
2385 | if (typeof value !== "function")
|
2386 | throw new Error();
|
2387 | return this.each(easeVarying(this._id, value));
|
2388 | }
|
2389 | function transition_filter(match) {
|
2390 | if (typeof match !== "function")
|
2391 | match = matcher(match);
|
2392 | for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
2393 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node2, i = 0; i < n; ++i) {
|
2394 | if ((node2 = group[i]) && match.call(node2, node2.__data__, i, group)) {
|
2395 | subgroup.push(node2);
|
2396 | }
|
2397 | }
|
2398 | }
|
2399 | return new Transition(subgroups, this._parents, this._name, this._id);
|
2400 | }
|
2401 | function transition_merge(transition) {
|
2402 | if (transition._id !== this._id)
|
2403 | throw new Error();
|
2404 | for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
2405 | for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node2, i = 0; i < n; ++i) {
|
2406 | if (node2 = group0[i] || group1[i]) {
|
2407 | merge2[i] = node2;
|
2408 | }
|
2409 | }
|
2410 | }
|
2411 | for (; j < m0; ++j) {
|
2412 | merges[j] = groups0[j];
|
2413 | }
|
2414 | return new Transition(merges, this._parents, this._name, this._id);
|
2415 | }
|
2416 | function start(name) {
|
2417 | return (name + "").trim().split(/^|\s+/).every(function(t) {
|
2418 | var i = t.indexOf(".");
|
2419 | if (i >= 0)
|
2420 | t = t.slice(0, i);
|
2421 | return !t || t === "start";
|
2422 | });
|
2423 | }
|
2424 | function onFunction(id2, name, listener) {
|
2425 | var on0, on1, sit = start(name) ? init$1 : set$1;
|
2426 | return function() {
|
2427 | var schedule2 = sit(this, id2), on = schedule2.on;
|
2428 | if (on !== on0)
|
2429 | (on1 = (on0 = on).copy()).on(name, listener);
|
2430 | schedule2.on = on1;
|
2431 | };
|
2432 | }
|
2433 | function transition_on(name, listener) {
|
2434 | var id2 = this._id;
|
2435 | return arguments.length < 2 ? get(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
|
2436 | }
|
2437 | function removeFunction(id2) {
|
2438 | return function() {
|
2439 | var parent = this.parentNode;
|
2440 | for (var i in this.__transition)
|
2441 | if (+i !== id2)
|
2442 | return;
|
2443 | if (parent)
|
2444 | parent.removeChild(this);
|
2445 | };
|
2446 | }
|
2447 | function transition_remove() {
|
2448 | return this.on("end.remove", removeFunction(this._id));
|
2449 | }
|
2450 | function transition_select(select2) {
|
2451 | var name = this._name, id2 = this._id;
|
2452 | if (typeof select2 !== "function")
|
2453 | select2 = selector(select2);
|
2454 | for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
2455 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node2, subnode, i = 0; i < n; ++i) {
|
2456 | if ((node2 = group[i]) && (subnode = select2.call(node2, node2.__data__, i, group))) {
|
2457 | if ("__data__" in node2)
|
2458 | subnode.__data__ = node2.__data__;
|
2459 | subgroup[i] = subnode;
|
2460 | schedule(subgroup[i], name, id2, i, subgroup, get(node2, id2));
|
2461 | }
|
2462 | }
|
2463 | }
|
2464 | return new Transition(subgroups, this._parents, name, id2);
|
2465 | }
|
2466 | function transition_selectAll(select2) {
|
2467 | var name = this._name, id2 = this._id;
|
2468 | if (typeof select2 !== "function")
|
2469 | select2 = selectorAll(select2);
|
2470 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
2471 | for (var group = groups[j], n = group.length, node2, i = 0; i < n; ++i) {
|
2472 | if (node2 = group[i]) {
|
2473 | for (var children2 = select2.call(node2, node2.__data__, i, group), child, inherit2 = get(node2, id2), k = 0, l = children2.length; k < l; ++k) {
|
2474 | if (child = children2[k]) {
|
2475 | schedule(child, name, id2, k, children2, inherit2);
|
2476 | }
|
2477 | }
|
2478 | subgroups.push(children2);
|
2479 | parents.push(node2);
|
2480 | }
|
2481 | }
|
2482 | }
|
2483 | return new Transition(subgroups, parents, name, id2);
|
2484 | }
|
2485 | var Selection = selection.prototype.constructor;
|
2486 | function transition_selection() {
|
2487 | return new Selection(this._groups, this._parents);
|
2488 | }
|
2489 | function styleNull(name, interpolate2) {
|
2490 | var string00, string10, interpolate0;
|
2491 | return function() {
|
2492 | var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
|
2493 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1);
|
2494 | };
|
2495 | }
|
2496 | function styleRemove(name) {
|
2497 | return function() {
|
2498 | this.style.removeProperty(name);
|
2499 | };
|
2500 | }
|
2501 | function styleConstant(name, interpolate2, value1) {
|
2502 | var string00, string1 = value1 + "", interpolate0;
|
2503 | return function() {
|
2504 | var string0 = styleValue(this, name);
|
2505 | return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
2506 | };
|
2507 | }
|
2508 | function styleFunction(name, interpolate2, value) {
|
2509 | var string00, string10, interpolate0;
|
2510 | return function() {
|
2511 | var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
|
2512 | if (value1 == null)
|
2513 | string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
|
2514 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
2515 | };
|
2516 | }
|
2517 | function styleMaybeRemove(id2, name) {
|
2518 | var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
|
2519 | return function() {
|
2520 | var schedule2 = set$1(this, id2), on = schedule2.on, listener = schedule2.value[key] == null ? remove2 || (remove2 = styleRemove(name)) : void 0;
|
2521 | if (on !== on0 || listener0 !== listener)
|
2522 | (on1 = (on0 = on).copy()).on(event, listener0 = listener);
|
2523 | schedule2.on = on1;
|
2524 | };
|
2525 | }
|
2526 | function transition_style(name, value, priority) {
|
2527 | var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
2528 | return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove(name)) : typeof value === "function" ? this.styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant(name, i, value), priority).on("end.style." + name, null);
|
2529 | }
|
2530 | function styleInterpolate(name, i, priority) {
|
2531 | return function(t) {
|
2532 | this.style.setProperty(name, i.call(this, t), priority);
|
2533 | };
|
2534 | }
|
2535 | function styleTween(name, value, priority) {
|
2536 | var t, i0;
|
2537 | function tween() {
|
2538 | var i = value.apply(this, arguments);
|
2539 | if (i !== i0)
|
2540 | t = (i0 = i) && styleInterpolate(name, i, priority);
|
2541 | return t;
|
2542 | }
|
2543 | tween._value = value;
|
2544 | return tween;
|
2545 | }
|
2546 | function transition_styleTween(name, value, priority) {
|
2547 | var key = "style." + (name += "");
|
2548 | if (arguments.length < 2)
|
2549 | return (key = this.tween(key)) && key._value;
|
2550 | if (value == null)
|
2551 | return this.tween(key, null);
|
2552 | if (typeof value !== "function")
|
2553 | throw new Error();
|
2554 | return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
2555 | }
|
2556 | function textConstant(value) {
|
2557 | return function() {
|
2558 | this.textContent = value;
|
2559 | };
|
2560 | }
|
2561 | function textFunction(value) {
|
2562 | return function() {
|
2563 | var value1 = value(this);
|
2564 | this.textContent = value1 == null ? "" : value1;
|
2565 | };
|
2566 | }
|
2567 | function transition_text(value) {
|
2568 | return this.tween("text", typeof value === "function" ? textFunction(tweenValue(this, "text", value)) : textConstant(value == null ? "" : value + ""));
|
2569 | }
|
2570 | function textInterpolate(i) {
|
2571 | return function(t) {
|
2572 | this.textContent = i.call(this, t);
|
2573 | };
|
2574 | }
|
2575 | function textTween(value) {
|
2576 | var t0, i0;
|
2577 | function tween() {
|
2578 | var i = value.apply(this, arguments);
|
2579 | if (i !== i0)
|
2580 | t0 = (i0 = i) && textInterpolate(i);
|
2581 | return t0;
|
2582 | }
|
2583 | tween._value = value;
|
2584 | return tween;
|
2585 | }
|
2586 | function transition_textTween(value) {
|
2587 | var key = "text";
|
2588 | if (arguments.length < 1)
|
2589 | return (key = this.tween(key)) && key._value;
|
2590 | if (value == null)
|
2591 | return this.tween(key, null);
|
2592 | if (typeof value !== "function")
|
2593 | throw new Error();
|
2594 | return this.tween(key, textTween(value));
|
2595 | }
|
2596 | function transition_transition() {
|
2597 | var name = this._name, id0 = this._id, id1 = newId();
|
2598 | for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
2599 | for (var group = groups[j], n = group.length, node2, i = 0; i < n; ++i) {
|
2600 | if (node2 = group[i]) {
|
2601 | var inherit2 = get(node2, id0);
|
2602 | schedule(node2, name, id1, i, group, {
|
2603 | time: inherit2.time + inherit2.delay + inherit2.duration,
|
2604 | delay: 0,
|
2605 | duration: inherit2.duration,
|
2606 | ease: inherit2.ease
|
2607 | });
|
2608 | }
|
2609 | }
|
2610 | }
|
2611 | return new Transition(groups, this._parents, name, id1);
|
2612 | }
|
2613 | function transition_end() {
|
2614 | var on0, on1, that = this, id2 = that._id, size = that.size();
|
2615 | return new Promise(function(resolve, reject) {
|
2616 | var cancel = { value: reject }, end = { value: function() {
|
2617 | if (--size === 0)
|
2618 | resolve();
|
2619 | } };
|
2620 | that.each(function() {
|
2621 | var schedule2 = set$1(this, id2), on = schedule2.on;
|
2622 | if (on !== on0) {
|
2623 | on1 = (on0 = on).copy();
|
2624 | on1._.cancel.push(cancel);
|
2625 | on1._.interrupt.push(cancel);
|
2626 | on1._.end.push(end);
|
2627 | }
|
2628 | schedule2.on = on1;
|
2629 | });
|
2630 | if (size === 0)
|
2631 | resolve();
|
2632 | });
|
2633 | }
|
2634 | var id$j = 0;
|
2635 | function Transition(groups, parents, name, id2) {
|
2636 | this._groups = groups;
|
2637 | this._parents = parents;
|
2638 | this._name = name;
|
2639 | this._id = id2;
|
2640 | }
|
2641 | function newId() {
|
2642 | return ++id$j;
|
2643 | }
|
2644 | var selection_prototype = selection.prototype;
|
2645 | Transition.prototype = {
|
2646 | constructor: Transition,
|
2647 | select: transition_select,
|
2648 | selectAll: transition_selectAll,
|
2649 | selectChild: selection_prototype.selectChild,
|
2650 | selectChildren: selection_prototype.selectChildren,
|
2651 | filter: transition_filter,
|
2652 | merge: transition_merge,
|
2653 | selection: transition_selection,
|
2654 | transition: transition_transition,
|
2655 | call: selection_prototype.call,
|
2656 | nodes: selection_prototype.nodes,
|
2657 | node: selection_prototype.node,
|
2658 | size: selection_prototype.size,
|
2659 | empty: selection_prototype.empty,
|
2660 | each: selection_prototype.each,
|
2661 | on: transition_on,
|
2662 | attr: transition_attr,
|
2663 | attrTween: transition_attrTween,
|
2664 | style: transition_style,
|
2665 | styleTween: transition_styleTween,
|
2666 | text: transition_text,
|
2667 | textTween: transition_textTween,
|
2668 | remove: transition_remove,
|
2669 | tween: transition_tween,
|
2670 | delay: transition_delay,
|
2671 | duration: transition_duration,
|
2672 | ease: transition_ease,
|
2673 | easeVarying: transition_easeVarying,
|
2674 | end: transition_end,
|
2675 | [Symbol.iterator]: selection_prototype[Symbol.iterator]
|
2676 | };
|
2677 | function cubicInOut(t) {
|
2678 | return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
2679 | }
|
2680 | var defaultTiming = {
|
2681 | time: null,
|
2682 |
|
2683 | delay: 0,
|
2684 | duration: 250,
|
2685 | ease: cubicInOut
|
2686 | };
|
2687 | function inherit(node2, id2) {
|
2688 | var timing;
|
2689 | while (!(timing = node2.__transition) || !(timing = timing[id2])) {
|
2690 | if (!(node2 = node2.parentNode)) {
|
2691 | throw new Error(`transition ${id2} not found`);
|
2692 | }
|
2693 | }
|
2694 | return timing;
|
2695 | }
|
2696 | function selection_transition(name) {
|
2697 | var id2, timing;
|
2698 | if (name instanceof Transition) {
|
2699 | id2 = name._id, name = name._name;
|
2700 | } else {
|
2701 | id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
2702 | }
|
2703 | for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
2704 | for (var group = groups[j], n = group.length, node2, i = 0; i < n; ++i) {
|
2705 | if (node2 = group[i]) {
|
2706 | schedule(node2, name, id2, i, group, timing || inherit(node2, id2));
|
2707 | }
|
2708 | }
|
2709 | }
|
2710 | return new Transition(groups, this._parents, name, id2);
|
2711 | }
|
2712 | selection.prototype.interrupt = selection_interrupt;
|
2713 | selection.prototype.transition = selection_transition;
|
2714 | const abs$1 = Math.abs;
|
2715 | const atan2 = Math.atan2;
|
2716 | const cos = Math.cos;
|
2717 | const max = Math.max;
|
2718 | const min = Math.min;
|
2719 | const sin = Math.sin;
|
2720 | const sqrt = Math.sqrt;
|
2721 | const epsilon = 1e-12;
|
2722 | const pi = Math.PI;
|
2723 | const halfPi = pi / 2;
|
2724 | const tau = 2 * pi;
|
2725 | function acos(x) {
|
2726 | return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
2727 | }
|
2728 | function asin(x) {
|
2729 | return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
2730 | }
|
2731 | function Linear(context) {
|
2732 | this._context = context;
|
2733 | }
|
2734 | Linear.prototype = {
|
2735 | areaStart: function() {
|
2736 | this._line = 0;
|
2737 | },
|
2738 | areaEnd: function() {
|
2739 | this._line = NaN;
|
2740 | },
|
2741 | lineStart: function() {
|
2742 | this._point = 0;
|
2743 | },
|
2744 | lineEnd: function() {
|
2745 | if (this._line || this._line !== 0 && this._point === 1)
|
2746 | this._context.closePath();
|
2747 | this._line = 1 - this._line;
|
2748 | },
|
2749 | point: function(x, y) {
|
2750 | x = +x, y = +y;
|
2751 | switch (this._point) {
|
2752 | case 0:
|
2753 | this._point = 1;
|
2754 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
2755 | break;
|
2756 | case 1:
|
2757 | this._point = 2;
|
2758 | default:
|
2759 | this._context.lineTo(x, y);
|
2760 | break;
|
2761 | }
|
2762 | }
|
2763 | };
|
2764 | function curveLinear(context) {
|
2765 | return new Linear(context);
|
2766 | }
|
2767 | class Bump {
|
2768 | constructor(context, x) {
|
2769 | this._context = context;
|
2770 | this._x = x;
|
2771 | }
|
2772 | areaStart() {
|
2773 | this._line = 0;
|
2774 | }
|
2775 | areaEnd() {
|
2776 | this._line = NaN;
|
2777 | }
|
2778 | lineStart() {
|
2779 | this._point = 0;
|
2780 | }
|
2781 | lineEnd() {
|
2782 | if (this._line || this._line !== 0 && this._point === 1)
|
2783 | this._context.closePath();
|
2784 | this._line = 1 - this._line;
|
2785 | }
|
2786 | point(x, y) {
|
2787 | x = +x, y = +y;
|
2788 | switch (this._point) {
|
2789 | case 0: {
|
2790 | this._point = 1;
|
2791 | if (this._line)
|
2792 | this._context.lineTo(x, y);
|
2793 | else
|
2794 | this._context.moveTo(x, y);
|
2795 | break;
|
2796 | }
|
2797 | case 1:
|
2798 | this._point = 2;
|
2799 | default: {
|
2800 | if (this._x)
|
2801 | this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);
|
2802 | else
|
2803 | this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);
|
2804 | break;
|
2805 | }
|
2806 | }
|
2807 | this._x0 = x, this._y0 = y;
|
2808 | }
|
2809 | }
|
2810 | function bumpX(context) {
|
2811 | return new Bump(context, true);
|
2812 | }
|
2813 | function bumpY(context) {
|
2814 | return new Bump(context, false);
|
2815 | }
|
2816 | function noop() {
|
2817 | }
|
2818 | function point$3(that, x, y) {
|
2819 | that._context.bezierCurveTo(
|
2820 | (2 * that._x0 + that._x1) / 3,
|
2821 | (2 * that._y0 + that._y1) / 3,
|
2822 | (that._x0 + 2 * that._x1) / 3,
|
2823 | (that._y0 + 2 * that._y1) / 3,
|
2824 | (that._x0 + 4 * that._x1 + x) / 6,
|
2825 | (that._y0 + 4 * that._y1 + y) / 6
|
2826 | );
|
2827 | }
|
2828 | function Basis(context) {
|
2829 | this._context = context;
|
2830 | }
|
2831 | Basis.prototype = {
|
2832 | areaStart: function() {
|
2833 | this._line = 0;
|
2834 | },
|
2835 | areaEnd: function() {
|
2836 | this._line = NaN;
|
2837 | },
|
2838 | lineStart: function() {
|
2839 | this._x0 = this._x1 = this._y0 = this._y1 = NaN;
|
2840 | this._point = 0;
|
2841 | },
|
2842 | lineEnd: function() {
|
2843 | switch (this._point) {
|
2844 | case 3:
|
2845 | point$3(this, this._x1, this._y1);
|
2846 | case 2:
|
2847 | this._context.lineTo(this._x1, this._y1);
|
2848 | break;
|
2849 | }
|
2850 | if (this._line || this._line !== 0 && this._point === 1)
|
2851 | this._context.closePath();
|
2852 | this._line = 1 - this._line;
|
2853 | },
|
2854 | point: function(x, y) {
|
2855 | x = +x, y = +y;
|
2856 | switch (this._point) {
|
2857 | case 0:
|
2858 | this._point = 1;
|
2859 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
2860 | break;
|
2861 | case 1:
|
2862 | this._point = 2;
|
2863 | break;
|
2864 | case 2:
|
2865 | this._point = 3;
|
2866 | this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
|
2867 | default:
|
2868 | point$3(this, x, y);
|
2869 | break;
|
2870 | }
|
2871 | this._x0 = this._x1, this._x1 = x;
|
2872 | this._y0 = this._y1, this._y1 = y;
|
2873 | }
|
2874 | };
|
2875 | function curveBasis(context) {
|
2876 | return new Basis(context);
|
2877 | }
|
2878 | function BasisClosed(context) {
|
2879 | this._context = context;
|
2880 | }
|
2881 | BasisClosed.prototype = {
|
2882 | areaStart: noop,
|
2883 | areaEnd: noop,
|
2884 | lineStart: function() {
|
2885 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
|
2886 | this._point = 0;
|
2887 | },
|
2888 | lineEnd: function() {
|
2889 | switch (this._point) {
|
2890 | case 1: {
|
2891 | this._context.moveTo(this._x2, this._y2);
|
2892 | this._context.closePath();
|
2893 | break;
|
2894 | }
|
2895 | case 2: {
|
2896 | this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
|
2897 | this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
|
2898 | this._context.closePath();
|
2899 | break;
|
2900 | }
|
2901 | case 3: {
|
2902 | this.point(this._x2, this._y2);
|
2903 | this.point(this._x3, this._y3);
|
2904 | this.point(this._x4, this._y4);
|
2905 | break;
|
2906 | }
|
2907 | }
|
2908 | },
|
2909 | point: function(x, y) {
|
2910 | x = +x, y = +y;
|
2911 | switch (this._point) {
|
2912 | case 0:
|
2913 | this._point = 1;
|
2914 | this._x2 = x, this._y2 = y;
|
2915 | break;
|
2916 | case 1:
|
2917 | this._point = 2;
|
2918 | this._x3 = x, this._y3 = y;
|
2919 | break;
|
2920 | case 2:
|
2921 | this._point = 3;
|
2922 | this._x4 = x, this._y4 = y;
|
2923 | this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6);
|
2924 | break;
|
2925 | default:
|
2926 | point$3(this, x, y);
|
2927 | break;
|
2928 | }
|
2929 | this._x0 = this._x1, this._x1 = x;
|
2930 | this._y0 = this._y1, this._y1 = y;
|
2931 | }
|
2932 | };
|
2933 | function curveBasisClosed(context) {
|
2934 | return new BasisClosed(context);
|
2935 | }
|
2936 | function BasisOpen(context) {
|
2937 | this._context = context;
|
2938 | }
|
2939 | BasisOpen.prototype = {
|
2940 | areaStart: function() {
|
2941 | this._line = 0;
|
2942 | },
|
2943 | areaEnd: function() {
|
2944 | this._line = NaN;
|
2945 | },
|
2946 | lineStart: function() {
|
2947 | this._x0 = this._x1 = this._y0 = this._y1 = NaN;
|
2948 | this._point = 0;
|
2949 | },
|
2950 | lineEnd: function() {
|
2951 | if (this._line || this._line !== 0 && this._point === 3)
|
2952 | this._context.closePath();
|
2953 | this._line = 1 - this._line;
|
2954 | },
|
2955 | point: function(x, y) {
|
2956 | x = +x, y = +y;
|
2957 | switch (this._point) {
|
2958 | case 0:
|
2959 | this._point = 1;
|
2960 | break;
|
2961 | case 1:
|
2962 | this._point = 2;
|
2963 | break;
|
2964 | case 2:
|
2965 | this._point = 3;
|
2966 | var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6;
|
2967 | this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
|
2968 | break;
|
2969 | case 3:
|
2970 | this._point = 4;
|
2971 | default:
|
2972 | point$3(this, x, y);
|
2973 | break;
|
2974 | }
|
2975 | this._x0 = this._x1, this._x1 = x;
|
2976 | this._y0 = this._y1, this._y1 = y;
|
2977 | }
|
2978 | };
|
2979 | function curveBasisOpen(context) {
|
2980 | return new BasisOpen(context);
|
2981 | }
|
2982 | function Bundle(context, beta) {
|
2983 | this._basis = new Basis(context);
|
2984 | this._beta = beta;
|
2985 | }
|
2986 | Bundle.prototype = {
|
2987 | lineStart: function() {
|
2988 | this._x = [];
|
2989 | this._y = [];
|
2990 | this._basis.lineStart();
|
2991 | },
|
2992 | lineEnd: function() {
|
2993 | var x = this._x, y = this._y, j = x.length - 1;
|
2994 | if (j > 0) {
|
2995 | var x0 = x[0], y0 = y[0], dx = x[j] - x0, dy = y[j] - y0, i = -1, t;
|
2996 | while (++i <= j) {
|
2997 | t = i / j;
|
2998 | this._basis.point(
|
2999 | this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),
|
3000 | this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)
|
3001 | );
|
3002 | }
|
3003 | }
|
3004 | this._x = this._y = null;
|
3005 | this._basis.lineEnd();
|
3006 | },
|
3007 | point: function(x, y) {
|
3008 | this._x.push(+x);
|
3009 | this._y.push(+y);
|
3010 | }
|
3011 | };
|
3012 | const curveBundle = function custom(beta) {
|
3013 | function bundle(context) {
|
3014 | return beta === 1 ? new Basis(context) : new Bundle(context, beta);
|
3015 | }
|
3016 | bundle.beta = function(beta2) {
|
3017 | return custom(+beta2);
|
3018 | };
|
3019 | return bundle;
|
3020 | }(0.85);
|
3021 | function point$2(that, x, y) {
|
3022 | that._context.bezierCurveTo(
|
3023 | that._x1 + that._k * (that._x2 - that._x0),
|
3024 | that._y1 + that._k * (that._y2 - that._y0),
|
3025 | that._x2 + that._k * (that._x1 - x),
|
3026 | that._y2 + that._k * (that._y1 - y),
|
3027 | that._x2,
|
3028 | that._y2
|
3029 | );
|
3030 | }
|
3031 | function Cardinal(context, tension) {
|
3032 | this._context = context;
|
3033 | this._k = (1 - tension) / 6;
|
3034 | }
|
3035 | Cardinal.prototype = {
|
3036 | areaStart: function() {
|
3037 | this._line = 0;
|
3038 | },
|
3039 | areaEnd: function() {
|
3040 | this._line = NaN;
|
3041 | },
|
3042 | lineStart: function() {
|
3043 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
3044 | this._point = 0;
|
3045 | },
|
3046 | lineEnd: function() {
|
3047 | switch (this._point) {
|
3048 | case 2:
|
3049 | this._context.lineTo(this._x2, this._y2);
|
3050 | break;
|
3051 | case 3:
|
3052 | point$2(this, this._x1, this._y1);
|
3053 | break;
|
3054 | }
|
3055 | if (this._line || this._line !== 0 && this._point === 1)
|
3056 | this._context.closePath();
|
3057 | this._line = 1 - this._line;
|
3058 | },
|
3059 | point: function(x, y) {
|
3060 | x = +x, y = +y;
|
3061 | switch (this._point) {
|
3062 | case 0:
|
3063 | this._point = 1;
|
3064 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
3065 | break;
|
3066 | case 1:
|
3067 | this._point = 2;
|
3068 | this._x1 = x, this._y1 = y;
|
3069 | break;
|
3070 | case 2:
|
3071 | this._point = 3;
|
3072 | default:
|
3073 | point$2(this, x, y);
|
3074 | break;
|
3075 | }
|
3076 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3077 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3078 | }
|
3079 | };
|
3080 | const curveCardinal = function custom2(tension) {
|
3081 | function cardinal(context) {
|
3082 | return new Cardinal(context, tension);
|
3083 | }
|
3084 | cardinal.tension = function(tension2) {
|
3085 | return custom2(+tension2);
|
3086 | };
|
3087 | return cardinal;
|
3088 | }(0);
|
3089 | function CardinalClosed(context, tension) {
|
3090 | this._context = context;
|
3091 | this._k = (1 - tension) / 6;
|
3092 | }
|
3093 | CardinalClosed.prototype = {
|
3094 | areaStart: noop,
|
3095 | areaEnd: noop,
|
3096 | lineStart: function() {
|
3097 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
|
3098 | this._point = 0;
|
3099 | },
|
3100 | lineEnd: function() {
|
3101 | switch (this._point) {
|
3102 | case 1: {
|
3103 | this._context.moveTo(this._x3, this._y3);
|
3104 | this._context.closePath();
|
3105 | break;
|
3106 | }
|
3107 | case 2: {
|
3108 | this._context.lineTo(this._x3, this._y3);
|
3109 | this._context.closePath();
|
3110 | break;
|
3111 | }
|
3112 | case 3: {
|
3113 | this.point(this._x3, this._y3);
|
3114 | this.point(this._x4, this._y4);
|
3115 | this.point(this._x5, this._y5);
|
3116 | break;
|
3117 | }
|
3118 | }
|
3119 | },
|
3120 | point: function(x, y) {
|
3121 | x = +x, y = +y;
|
3122 | switch (this._point) {
|
3123 | case 0:
|
3124 | this._point = 1;
|
3125 | this._x3 = x, this._y3 = y;
|
3126 | break;
|
3127 | case 1:
|
3128 | this._point = 2;
|
3129 | this._context.moveTo(this._x4 = x, this._y4 = y);
|
3130 | break;
|
3131 | case 2:
|
3132 | this._point = 3;
|
3133 | this._x5 = x, this._y5 = y;
|
3134 | break;
|
3135 | default:
|
3136 | point$2(this, x, y);
|
3137 | break;
|
3138 | }
|
3139 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3140 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3141 | }
|
3142 | };
|
3143 | const curveCardinalClosed = function custom3(tension) {
|
3144 | function cardinal(context) {
|
3145 | return new CardinalClosed(context, tension);
|
3146 | }
|
3147 | cardinal.tension = function(tension2) {
|
3148 | return custom3(+tension2);
|
3149 | };
|
3150 | return cardinal;
|
3151 | }(0);
|
3152 | function CardinalOpen(context, tension) {
|
3153 | this._context = context;
|
3154 | this._k = (1 - tension) / 6;
|
3155 | }
|
3156 | CardinalOpen.prototype = {
|
3157 | areaStart: function() {
|
3158 | this._line = 0;
|
3159 | },
|
3160 | areaEnd: function() {
|
3161 | this._line = NaN;
|
3162 | },
|
3163 | lineStart: function() {
|
3164 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
3165 | this._point = 0;
|
3166 | },
|
3167 | lineEnd: function() {
|
3168 | if (this._line || this._line !== 0 && this._point === 3)
|
3169 | this._context.closePath();
|
3170 | this._line = 1 - this._line;
|
3171 | },
|
3172 | point: function(x, y) {
|
3173 | x = +x, y = +y;
|
3174 | switch (this._point) {
|
3175 | case 0:
|
3176 | this._point = 1;
|
3177 | break;
|
3178 | case 1:
|
3179 | this._point = 2;
|
3180 | break;
|
3181 | case 2:
|
3182 | this._point = 3;
|
3183 | this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
3184 | break;
|
3185 | case 3:
|
3186 | this._point = 4;
|
3187 | default:
|
3188 | point$2(this, x, y);
|
3189 | break;
|
3190 | }
|
3191 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3192 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3193 | }
|
3194 | };
|
3195 | const curveCardinalOpen = function custom4(tension) {
|
3196 | function cardinal(context) {
|
3197 | return new CardinalOpen(context, tension);
|
3198 | }
|
3199 | cardinal.tension = function(tension2) {
|
3200 | return custom4(+tension2);
|
3201 | };
|
3202 | return cardinal;
|
3203 | }(0);
|
3204 | function point$1(that, x, y) {
|
3205 | var x1 = that._x1, y1 = that._y1, x2 = that._x2, y2 = that._y2;
|
3206 | if (that._l01_a > epsilon) {
|
3207 | var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a);
|
3208 | x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
|
3209 | y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
|
3210 | }
|
3211 | if (that._l23_a > epsilon) {
|
3212 | var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a);
|
3213 | x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
|
3214 | y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
|
3215 | }
|
3216 | that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
|
3217 | }
|
3218 | function CatmullRom(context, alpha) {
|
3219 | this._context = context;
|
3220 | this._alpha = alpha;
|
3221 | }
|
3222 | CatmullRom.prototype = {
|
3223 | areaStart: function() {
|
3224 | this._line = 0;
|
3225 | },
|
3226 | areaEnd: function() {
|
3227 | this._line = NaN;
|
3228 | },
|
3229 | lineStart: function() {
|
3230 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
3231 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
3232 | },
|
3233 | lineEnd: function() {
|
3234 | switch (this._point) {
|
3235 | case 2:
|
3236 | this._context.lineTo(this._x2, this._y2);
|
3237 | break;
|
3238 | case 3:
|
3239 | this.point(this._x2, this._y2);
|
3240 | break;
|
3241 | }
|
3242 | if (this._line || this._line !== 0 && this._point === 1)
|
3243 | this._context.closePath();
|
3244 | this._line = 1 - this._line;
|
3245 | },
|
3246 | point: function(x, y) {
|
3247 | x = +x, y = +y;
|
3248 | if (this._point) {
|
3249 | var x23 = this._x2 - x, y23 = this._y2 - y;
|
3250 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
3251 | }
|
3252 | switch (this._point) {
|
3253 | case 0:
|
3254 | this._point = 1;
|
3255 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
3256 | break;
|
3257 | case 1:
|
3258 | this._point = 2;
|
3259 | break;
|
3260 | case 2:
|
3261 | this._point = 3;
|
3262 | default:
|
3263 | point$1(this, x, y);
|
3264 | break;
|
3265 | }
|
3266 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
3267 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
3268 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3269 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3270 | }
|
3271 | };
|
3272 | const curveCatmullRom = function custom5(alpha) {
|
3273 | function catmullRom(context) {
|
3274 | return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
|
3275 | }
|
3276 | catmullRom.alpha = function(alpha2) {
|
3277 | return custom5(+alpha2);
|
3278 | };
|
3279 | return catmullRom;
|
3280 | }(0.5);
|
3281 | function CatmullRomClosed(context, alpha) {
|
3282 | this._context = context;
|
3283 | this._alpha = alpha;
|
3284 | }
|
3285 | CatmullRomClosed.prototype = {
|
3286 | areaStart: noop,
|
3287 | areaEnd: noop,
|
3288 | lineStart: function() {
|
3289 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
|
3290 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
3291 | },
|
3292 | lineEnd: function() {
|
3293 | switch (this._point) {
|
3294 | case 1: {
|
3295 | this._context.moveTo(this._x3, this._y3);
|
3296 | this._context.closePath();
|
3297 | break;
|
3298 | }
|
3299 | case 2: {
|
3300 | this._context.lineTo(this._x3, this._y3);
|
3301 | this._context.closePath();
|
3302 | break;
|
3303 | }
|
3304 | case 3: {
|
3305 | this.point(this._x3, this._y3);
|
3306 | this.point(this._x4, this._y4);
|
3307 | this.point(this._x5, this._y5);
|
3308 | break;
|
3309 | }
|
3310 | }
|
3311 | },
|
3312 | point: function(x, y) {
|
3313 | x = +x, y = +y;
|
3314 | if (this._point) {
|
3315 | var x23 = this._x2 - x, y23 = this._y2 - y;
|
3316 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
3317 | }
|
3318 | switch (this._point) {
|
3319 | case 0:
|
3320 | this._point = 1;
|
3321 | this._x3 = x, this._y3 = y;
|
3322 | break;
|
3323 | case 1:
|
3324 | this._point = 2;
|
3325 | this._context.moveTo(this._x4 = x, this._y4 = y);
|
3326 | break;
|
3327 | case 2:
|
3328 | this._point = 3;
|
3329 | this._x5 = x, this._y5 = y;
|
3330 | break;
|
3331 | default:
|
3332 | point$1(this, x, y);
|
3333 | break;
|
3334 | }
|
3335 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
3336 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
3337 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3338 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3339 | }
|
3340 | };
|
3341 | const curveCatmullRomClosed = function custom6(alpha) {
|
3342 | function catmullRom(context) {
|
3343 | return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
|
3344 | }
|
3345 | catmullRom.alpha = function(alpha2) {
|
3346 | return custom6(+alpha2);
|
3347 | };
|
3348 | return catmullRom;
|
3349 | }(0.5);
|
3350 | function CatmullRomOpen(context, alpha) {
|
3351 | this._context = context;
|
3352 | this._alpha = alpha;
|
3353 | }
|
3354 | CatmullRomOpen.prototype = {
|
3355 | areaStart: function() {
|
3356 | this._line = 0;
|
3357 | },
|
3358 | areaEnd: function() {
|
3359 | this._line = NaN;
|
3360 | },
|
3361 | lineStart: function() {
|
3362 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
3363 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
3364 | },
|
3365 | lineEnd: function() {
|
3366 | if (this._line || this._line !== 0 && this._point === 3)
|
3367 | this._context.closePath();
|
3368 | this._line = 1 - this._line;
|
3369 | },
|
3370 | point: function(x, y) {
|
3371 | x = +x, y = +y;
|
3372 | if (this._point) {
|
3373 | var x23 = this._x2 - x, y23 = this._y2 - y;
|
3374 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
3375 | }
|
3376 | switch (this._point) {
|
3377 | case 0:
|
3378 | this._point = 1;
|
3379 | break;
|
3380 | case 1:
|
3381 | this._point = 2;
|
3382 | break;
|
3383 | case 2:
|
3384 | this._point = 3;
|
3385 | this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
3386 | break;
|
3387 | case 3:
|
3388 | this._point = 4;
|
3389 | default:
|
3390 | point$1(this, x, y);
|
3391 | break;
|
3392 | }
|
3393 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
3394 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
3395 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
3396 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
3397 | }
|
3398 | };
|
3399 | const curveCatmullRomOpen = function custom7(alpha) {
|
3400 | function catmullRom(context) {
|
3401 | return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
|
3402 | }
|
3403 | catmullRom.alpha = function(alpha2) {
|
3404 | return custom7(+alpha2);
|
3405 | };
|
3406 | return catmullRom;
|
3407 | }(0.5);
|
3408 | function LinearClosed(context) {
|
3409 | this._context = context;
|
3410 | }
|
3411 | LinearClosed.prototype = {
|
3412 | areaStart: noop,
|
3413 | areaEnd: noop,
|
3414 | lineStart: function() {
|
3415 | this._point = 0;
|
3416 | },
|
3417 | lineEnd: function() {
|
3418 | if (this._point)
|
3419 | this._context.closePath();
|
3420 | },
|
3421 | point: function(x, y) {
|
3422 | x = +x, y = +y;
|
3423 | if (this._point)
|
3424 | this._context.lineTo(x, y);
|
3425 | else
|
3426 | this._point = 1, this._context.moveTo(x, y);
|
3427 | }
|
3428 | };
|
3429 | function curveLinearClosed(context) {
|
3430 | return new LinearClosed(context);
|
3431 | }
|
3432 | function sign(x) {
|
3433 | return x < 0 ? -1 : 1;
|
3434 | }
|
3435 | function slope3(that, x2, y2) {
|
3436 | var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);
|
3437 | return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
|
3438 | }
|
3439 | function slope2(that, t) {
|
3440 | var h = that._x1 - that._x0;
|
3441 | return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
|
3442 | }
|
3443 | function point(that, t0, t1) {
|
3444 | var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
|
3445 | that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
|
3446 | }
|
3447 | function MonotoneX(context) {
|
3448 | this._context = context;
|
3449 | }
|
3450 | MonotoneX.prototype = {
|
3451 | areaStart: function() {
|
3452 | this._line = 0;
|
3453 | },
|
3454 | areaEnd: function() {
|
3455 | this._line = NaN;
|
3456 | },
|
3457 | lineStart: function() {
|
3458 | this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
|
3459 | this._point = 0;
|
3460 | },
|
3461 | lineEnd: function() {
|
3462 | switch (this._point) {
|
3463 | case 2:
|
3464 | this._context.lineTo(this._x1, this._y1);
|
3465 | break;
|
3466 | case 3:
|
3467 | point(this, this._t0, slope2(this, this._t0));
|
3468 | break;
|
3469 | }
|
3470 | if (this._line || this._line !== 0 && this._point === 1)
|
3471 | this._context.closePath();
|
3472 | this._line = 1 - this._line;
|
3473 | },
|
3474 | point: function(x, y) {
|
3475 | var t1 = NaN;
|
3476 | x = +x, y = +y;
|
3477 | if (x === this._x1 && y === this._y1)
|
3478 | return;
|
3479 | switch (this._point) {
|
3480 | case 0:
|
3481 | this._point = 1;
|
3482 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
3483 | break;
|
3484 | case 1:
|
3485 | this._point = 2;
|
3486 | break;
|
3487 | case 2:
|
3488 | this._point = 3;
|
3489 | point(this, slope2(this, t1 = slope3(this, x, y)), t1);
|
3490 | break;
|
3491 | default:
|
3492 | point(this, this._t0, t1 = slope3(this, x, y));
|
3493 | break;
|
3494 | }
|
3495 | this._x0 = this._x1, this._x1 = x;
|
3496 | this._y0 = this._y1, this._y1 = y;
|
3497 | this._t0 = t1;
|
3498 | }
|
3499 | };
|
3500 | function MonotoneY(context) {
|
3501 | this._context = new ReflectContext(context);
|
3502 | }
|
3503 | (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {
|
3504 | MonotoneX.prototype.point.call(this, y, x);
|
3505 | };
|
3506 | function ReflectContext(context) {
|
3507 | this._context = context;
|
3508 | }
|
3509 | ReflectContext.prototype = {
|
3510 | moveTo: function(x, y) {
|
3511 | this._context.moveTo(y, x);
|
3512 | },
|
3513 | closePath: function() {
|
3514 | this._context.closePath();
|
3515 | },
|
3516 | lineTo: function(x, y) {
|
3517 | this._context.lineTo(y, x);
|
3518 | },
|
3519 | bezierCurveTo: function(x1, y1, x2, y2, x, y) {
|
3520 | this._context.bezierCurveTo(y1, x1, y2, x2, y, x);
|
3521 | }
|
3522 | };
|
3523 | function monotoneX(context) {
|
3524 | return new MonotoneX(context);
|
3525 | }
|
3526 | function monotoneY(context) {
|
3527 | return new MonotoneY(context);
|
3528 | }
|
3529 | function Natural(context) {
|
3530 | this._context = context;
|
3531 | }
|
3532 | Natural.prototype = {
|
3533 | areaStart: function() {
|
3534 | this._line = 0;
|
3535 | },
|
3536 | areaEnd: function() {
|
3537 | this._line = NaN;
|
3538 | },
|
3539 | lineStart: function() {
|
3540 | this._x = [];
|
3541 | this._y = [];
|
3542 | },
|
3543 | lineEnd: function() {
|
3544 | var x = this._x, y = this._y, n = x.length;
|
3545 | if (n) {
|
3546 | this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
|
3547 | if (n === 2) {
|
3548 | this._context.lineTo(x[1], y[1]);
|
3549 | } else {
|
3550 | var px = controlPoints(x), py = controlPoints(y);
|
3551 | for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
|
3552 | this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
|
3553 | }
|
3554 | }
|
3555 | }
|
3556 | if (this._line || this._line !== 0 && n === 1)
|
3557 | this._context.closePath();
|
3558 | this._line = 1 - this._line;
|
3559 | this._x = this._y = null;
|
3560 | },
|
3561 | point: function(x, y) {
|
3562 | this._x.push(+x);
|
3563 | this._y.push(+y);
|
3564 | }
|
3565 | };
|
3566 | function controlPoints(x) {
|
3567 | var i, n = x.length - 1, m, a = new Array(n), b = new Array(n), r = new Array(n);
|
3568 | a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
|
3569 | for (i = 1; i < n - 1; ++i)
|
3570 | a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
|
3571 | a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
|
3572 | for (i = 1; i < n; ++i)
|
3573 | m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
|
3574 | a[n - 1] = r[n - 1] / b[n - 1];
|
3575 | for (i = n - 2; i >= 0; --i)
|
3576 | a[i] = (r[i] - a[i + 1]) / b[i];
|
3577 | b[n - 1] = (x[n] + a[n - 1]) / 2;
|
3578 | for (i = 0; i < n - 1; ++i)
|
3579 | b[i] = 2 * x[i + 1] - a[i + 1];
|
3580 | return [a, b];
|
3581 | }
|
3582 | function curveNatural(context) {
|
3583 | return new Natural(context);
|
3584 | }
|
3585 | function Step(context, t) {
|
3586 | this._context = context;
|
3587 | this._t = t;
|
3588 | }
|
3589 | Step.prototype = {
|
3590 | areaStart: function() {
|
3591 | this._line = 0;
|
3592 | },
|
3593 | areaEnd: function() {
|
3594 | this._line = NaN;
|
3595 | },
|
3596 | lineStart: function() {
|
3597 | this._x = this._y = NaN;
|
3598 | this._point = 0;
|
3599 | },
|
3600 | lineEnd: function() {
|
3601 | if (0 < this._t && this._t < 1 && this._point === 2)
|
3602 | this._context.lineTo(this._x, this._y);
|
3603 | if (this._line || this._line !== 0 && this._point === 1)
|
3604 | this._context.closePath();
|
3605 | if (this._line >= 0)
|
3606 | this._t = 1 - this._t, this._line = 1 - this._line;
|
3607 | },
|
3608 | point: function(x, y) {
|
3609 | x = +x, y = +y;
|
3610 | switch (this._point) {
|
3611 | case 0:
|
3612 | this._point = 1;
|
3613 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
3614 | break;
|
3615 | case 1:
|
3616 | this._point = 2;
|
3617 | default: {
|
3618 | if (this._t <= 0) {
|
3619 | this._context.lineTo(this._x, y);
|
3620 | this._context.lineTo(x, y);
|
3621 | } else {
|
3622 | var x1 = this._x * (1 - this._t) + x * this._t;
|
3623 | this._context.lineTo(x1, this._y);
|
3624 | this._context.lineTo(x1, y);
|
3625 | }
|
3626 | break;
|
3627 | }
|
3628 | }
|
3629 | this._x = x, this._y = y;
|
3630 | }
|
3631 | };
|
3632 | function curveStep(context) {
|
3633 | return new Step(context, 0.5);
|
3634 | }
|
3635 | function stepBefore(context) {
|
3636 | return new Step(context, 0);
|
3637 | }
|
3638 | function stepAfter(context) {
|
3639 | return new Step(context, 1);
|
3640 | }
|
3641 | function Transform(k, x, y) {
|
3642 | this.k = k;
|
3643 | this.x = x;
|
3644 | this.y = y;
|
3645 | }
|
3646 | Transform.prototype = {
|
3647 | constructor: Transform,
|
3648 | scale: function(k) {
|
3649 | return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
3650 | },
|
3651 | translate: function(x, y) {
|
3652 | return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
3653 | },
|
3654 | apply: function(point2) {
|
3655 | return [point2[0] * this.k + this.x, point2[1] * this.k + this.y];
|
3656 | },
|
3657 | applyX: function(x) {
|
3658 | return x * this.k + this.x;
|
3659 | },
|
3660 | applyY: function(y) {
|
3661 | return y * this.k + this.y;
|
3662 | },
|
3663 | invert: function(location) {
|
3664 | return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
3665 | },
|
3666 | invertX: function(x) {
|
3667 | return (x - this.x) / this.k;
|
3668 | },
|
3669 | invertY: function(y) {
|
3670 | return (y - this.y) / this.k;
|
3671 | },
|
3672 | rescaleX: function(x) {
|
3673 | return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
3674 | },
|
3675 | rescaleY: function(y) {
|
3676 | return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
3677 | },
|
3678 | toString: function() {
|
3679 | return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
3680 | }
|
3681 | };
|
3682 | Transform.prototype;
|
3683 |
|
3684 | const {
|
3685 | entries,
|
3686 | setPrototypeOf,
|
3687 | isFrozen,
|
3688 | getPrototypeOf,
|
3689 | getOwnPropertyDescriptor
|
3690 | } = Object;
|
3691 | let {
|
3692 | freeze,
|
3693 | seal,
|
3694 | create
|
3695 | } = Object;
|
3696 | let {
|
3697 | apply,
|
3698 | construct
|
3699 | } = typeof Reflect !== "undefined" && Reflect;
|
3700 | if (!apply) {
|
3701 | apply = function apply2(fun, thisValue, args) {
|
3702 | return fun.apply(thisValue, args);
|
3703 | };
|
3704 | }
|
3705 | if (!freeze) {
|
3706 | freeze = function freeze2(x) {
|
3707 | return x;
|
3708 | };
|
3709 | }
|
3710 | if (!seal) {
|
3711 | seal = function seal2(x) {
|
3712 | return x;
|
3713 | };
|
3714 | }
|
3715 | if (!construct) {
|
3716 | construct = function construct2(Func, args) {
|
3717 | return new Func(...args);
|
3718 | };
|
3719 | }
|
3720 | const arrayForEach = unapply(Array.prototype.forEach);
|
3721 | const arrayPop = unapply(Array.prototype.pop);
|
3722 | const arrayPush = unapply(Array.prototype.push);
|
3723 | const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
3724 | const stringToString = unapply(String.prototype.toString);
|
3725 | const stringMatch = unapply(String.prototype.match);
|
3726 | const stringReplace = unapply(String.prototype.replace);
|
3727 | const stringIndexOf = unapply(String.prototype.indexOf);
|
3728 | const stringTrim = unapply(String.prototype.trim);
|
3729 | const regExpTest = unapply(RegExp.prototype.test);
|
3730 | const typeErrorCreate = unconstruct(TypeError);
|
3731 | function unapply(func) {
|
3732 | return function(thisArg) {
|
3733 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
3734 | args[_key - 1] = arguments[_key];
|
3735 | }
|
3736 | return apply(func, thisArg, args);
|
3737 | };
|
3738 | }
|
3739 | function unconstruct(func) {
|
3740 | return function() {
|
3741 | for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
3742 | args[_key2] = arguments[_key2];
|
3743 | }
|
3744 | return construct(func, args);
|
3745 | };
|
3746 | }
|
3747 | function addToSet(set2, array2, transformCaseFunc) {
|
3748 | var _transformCaseFunc;
|
3749 | transformCaseFunc = (_transformCaseFunc = transformCaseFunc) !== null && _transformCaseFunc !== void 0 ? _transformCaseFunc : stringToLowerCase;
|
3750 | if (setPrototypeOf) {
|
3751 | setPrototypeOf(set2, null);
|
3752 | }
|
3753 | let l = array2.length;
|
3754 | while (l--) {
|
3755 | let element = array2[l];
|
3756 | if (typeof element === "string") {
|
3757 | const lcElement = transformCaseFunc(element);
|
3758 | if (lcElement !== element) {
|
3759 | if (!isFrozen(array2)) {
|
3760 | array2[l] = lcElement;
|
3761 | }
|
3762 | element = lcElement;
|
3763 | }
|
3764 | }
|
3765 | set2[element] = true;
|
3766 | }
|
3767 | return set2;
|
3768 | }
|
3769 | function clone(object) {
|
3770 | const newObject = create(null);
|
3771 | for (const [property, value] of entries(object)) {
|
3772 | newObject[property] = value;
|
3773 | }
|
3774 | return newObject;
|
3775 | }
|
3776 | function lookupGetter(object, prop) {
|
3777 | while (object !== null) {
|
3778 | const desc = getOwnPropertyDescriptor(object, prop);
|
3779 | if (desc) {
|
3780 | if (desc.get) {
|
3781 | return unapply(desc.get);
|
3782 | }
|
3783 | if (typeof desc.value === "function") {
|
3784 | return unapply(desc.value);
|
3785 | }
|
3786 | }
|
3787 | object = getPrototypeOf(object);
|
3788 | }
|
3789 | function fallbackValue(element) {
|
3790 | console.warn("fallback value for", element);
|
3791 | return null;
|
3792 | }
|
3793 | return fallbackValue;
|
3794 | }
|
3795 | const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
|
3796 | const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
|
3797 | const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
|
3798 | const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
|
3799 | const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
|
3800 | const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
|
3801 | const text = freeze(["#text"]);
|
3802 | const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
|
3803 | const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
|
3804 | const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
|
3805 | const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
|
3806 | const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
|
3807 | const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
3808 | const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
3809 | const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
|
3810 | const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
|
3811 | const IS_ALLOWED_URI = seal(
|
3812 | /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
3813 |
|
3814 | );
|
3815 | const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
3816 | const ATTR_WHITESPACE = seal(
|
3817 | /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
3818 |
|
3819 | );
|
3820 | const DOCTYPE_NAME = seal(/^html$/i);
|
3821 | var EXPRESSIONS = Object.freeze({
|
3822 | __proto__: null,
|
3823 | MUSTACHE_EXPR,
|
3824 | ERB_EXPR,
|
3825 | TMPLIT_EXPR,
|
3826 | DATA_ATTR,
|
3827 | ARIA_ATTR,
|
3828 | IS_ALLOWED_URI,
|
3829 | IS_SCRIPT_OR_DATA,
|
3830 | ATTR_WHITESPACE,
|
3831 | DOCTYPE_NAME
|
3832 | });
|
3833 | const getGlobal = () => typeof window === "undefined" ? null : window;
|
3834 | const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
|
3835 | if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
|
3836 | return null;
|
3837 | }
|
3838 | let suffix = null;
|
3839 | const ATTR_NAME = "data-tt-policy-suffix";
|
3840 | if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
3841 | suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
3842 | }
|
3843 | const policyName = "dompurify" + (suffix ? "#" + suffix : "");
|
3844 | try {
|
3845 | return trustedTypes.createPolicy(policyName, {
|
3846 | createHTML(html2) {
|
3847 | return html2;
|
3848 | },
|
3849 | createScriptURL(scriptUrl) {
|
3850 | return scriptUrl;
|
3851 | }
|
3852 | });
|
3853 | } catch (_2) {
|
3854 | console.warn("TrustedTypes policy " + policyName + " could not be created.");
|
3855 | return null;
|
3856 | }
|
3857 | };
|
3858 | function createDOMPurify() {
|
3859 | let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
3860 | const DOMPurify = (root2) => createDOMPurify(root2);
|
3861 | DOMPurify.version = "3.0.3";
|
3862 | DOMPurify.removed = [];
|
3863 | if (!window2 || !window2.document || window2.document.nodeType !== 9) {
|
3864 | DOMPurify.isSupported = false;
|
3865 | return DOMPurify;
|
3866 | }
|
3867 | const originalDocument = window2.document;
|
3868 | const currentScript = originalDocument.currentScript;
|
3869 | let {
|
3870 | document: document2
|
3871 | } = window2;
|
3872 | const {
|
3873 | DocumentFragment,
|
3874 | HTMLTemplateElement,
|
3875 | Node,
|
3876 | Element,
|
3877 | NodeFilter,
|
3878 | NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap,
|
3879 | HTMLFormElement,
|
3880 | DOMParser,
|
3881 | trustedTypes
|
3882 | } = window2;
|
3883 | const ElementPrototype = Element.prototype;
|
3884 | const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
3885 | const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
3886 | const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
3887 | const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
3888 | if (typeof HTMLTemplateElement === "function") {
|
3889 | const template = document2.createElement("template");
|
3890 | if (template.content && template.content.ownerDocument) {
|
3891 | document2 = template.content.ownerDocument;
|
3892 | }
|
3893 | }
|
3894 | let trustedTypesPolicy;
|
3895 | let emptyHTML = "";
|
3896 | const {
|
3897 | implementation,
|
3898 | createNodeIterator,
|
3899 | createDocumentFragment,
|
3900 | getElementsByTagName
|
3901 | } = document2;
|
3902 | const {
|
3903 | importNode
|
3904 | } = originalDocument;
|
3905 | let hooks = {};
|
3906 | DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
|
3907 | const {
|
3908 | MUSTACHE_EXPR: MUSTACHE_EXPR2,
|
3909 | ERB_EXPR: ERB_EXPR2,
|
3910 | TMPLIT_EXPR: TMPLIT_EXPR2,
|
3911 | DATA_ATTR: DATA_ATTR2,
|
3912 | ARIA_ATTR: ARIA_ATTR2,
|
3913 | IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
|
3914 | ATTR_WHITESPACE: ATTR_WHITESPACE2
|
3915 | } = EXPRESSIONS;
|
3916 | let {
|
3917 | IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
3918 | } = EXPRESSIONS;
|
3919 | let ALLOWED_TAGS = null;
|
3920 | const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
3921 | let ALLOWED_ATTR = null;
|
3922 | const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
3923 | let CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
|
3924 | tagNameCheck: {
|
3925 | writable: true,
|
3926 | configurable: false,
|
3927 | enumerable: true,
|
3928 | value: null
|
3929 | },
|
3930 | attributeNameCheck: {
|
3931 | writable: true,
|
3932 | configurable: false,
|
3933 | enumerable: true,
|
3934 | value: null
|
3935 | },
|
3936 | allowCustomizedBuiltInElements: {
|
3937 | writable: true,
|
3938 | configurable: false,
|
3939 | enumerable: true,
|
3940 | value: false
|
3941 | }
|
3942 | }));
|
3943 | let FORBID_TAGS = null;
|
3944 | let FORBID_ATTR = null;
|
3945 | let ALLOW_ARIA_ATTR = true;
|
3946 | let ALLOW_DATA_ATTR = true;
|
3947 | let ALLOW_UNKNOWN_PROTOCOLS = false;
|
3948 | let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
3949 | let SAFE_FOR_TEMPLATES = false;
|
3950 | let WHOLE_DOCUMENT = false;
|
3951 | let SET_CONFIG = false;
|
3952 | let FORCE_BODY = false;
|
3953 | let RETURN_DOM = false;
|
3954 | let RETURN_DOM_FRAGMENT = false;
|
3955 | let RETURN_TRUSTED_TYPE = false;
|
3956 | let SANITIZE_DOM = true;
|
3957 | let SANITIZE_NAMED_PROPS = false;
|
3958 | const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
3959 | let KEEP_CONTENT = true;
|
3960 | let IN_PLACE = false;
|
3961 | let USE_PROFILES = {};
|
3962 | let FORBID_CONTENTS = null;
|
3963 | const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
3964 | let DATA_URI_TAGS = null;
|
3965 | const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
|
3966 | let URI_SAFE_ATTRIBUTES = null;
|
3967 | const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
|
3968 | const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
3969 | const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
3970 | const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
3971 | let NAMESPACE = HTML_NAMESPACE;
|
3972 | let IS_EMPTY_INPUT = false;
|
3973 | let ALLOWED_NAMESPACES = null;
|
3974 | const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
3975 | let PARSER_MEDIA_TYPE;
|
3976 | const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
3977 | const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
3978 | let transformCaseFunc;
|
3979 | let CONFIG = null;
|
3980 | const formElement = document2.createElement("form");
|
3981 | const isRegexOrFunction = function isRegexOrFunction2(testValue) {
|
3982 | return testValue instanceof RegExp || testValue instanceof Function;
|
3983 | };
|
3984 | const _parseConfig = function _parseConfig2(cfg) {
|
3985 | if (CONFIG && CONFIG === cfg) {
|
3986 | return;
|
3987 | }
|
3988 | if (!cfg || typeof cfg !== "object") {
|
3989 | cfg = {};
|
3990 | }
|
3991 | cfg = clone(cfg);
|
3992 | PARSER_MEDIA_TYPE =
|
3993 | SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE;
|
3994 | transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
|
3995 | ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
3996 | ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
3997 | ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
3998 | URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? addToSet(
|
3999 | clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
4000 |
|
4001 | cfg.ADD_URI_SAFE_ATTR,
|
4002 |
|
4003 | transformCaseFunc
|
4004 |
|
4005 | ) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
4006 | DATA_URI_TAGS = "ADD_DATA_URI_TAGS" in cfg ? addToSet(
|
4007 | clone(DEFAULT_DATA_URI_TAGS),
|
4008 |
|
4009 | cfg.ADD_DATA_URI_TAGS,
|
4010 |
|
4011 | transformCaseFunc
|
4012 |
|
4013 | ) : DEFAULT_DATA_URI_TAGS;
|
4014 | FORBID_CONTENTS = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
4015 | FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
4016 | FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
4017 | USE_PROFILES = "USE_PROFILES" in cfg ? cfg.USE_PROFILES : false;
|
4018 | ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
|
4019 | ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
|
4020 | ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
|
4021 | ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
|
4022 | SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
|
4023 | WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
|
4024 | RETURN_DOM = cfg.RETURN_DOM || false;
|
4025 | RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
|
4026 | RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
|
4027 | FORCE_BODY = cfg.FORCE_BODY || false;
|
4028 | SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
|
4029 | SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
|
4030 | KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
|
4031 | IN_PLACE = cfg.IN_PLACE || false;
|
4032 | IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
4033 | NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
4034 | CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
4035 | if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
4036 | CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
4037 | }
|
4038 | if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
4039 | CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
4040 | }
|
4041 | if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
|
4042 | CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
4043 | }
|
4044 | if (SAFE_FOR_TEMPLATES) {
|
4045 | ALLOW_DATA_ATTR = false;
|
4046 | }
|
4047 | if (RETURN_DOM_FRAGMENT) {
|
4048 | RETURN_DOM = true;
|
4049 | }
|
4050 | if (USE_PROFILES) {
|
4051 | ALLOWED_TAGS = addToSet({}, [...text]);
|
4052 | ALLOWED_ATTR = [];
|
4053 | if (USE_PROFILES.html === true) {
|
4054 | addToSet(ALLOWED_TAGS, html$1);
|
4055 | addToSet(ALLOWED_ATTR, html);
|
4056 | }
|
4057 | if (USE_PROFILES.svg === true) {
|
4058 | addToSet(ALLOWED_TAGS, svg$1);
|
4059 | addToSet(ALLOWED_ATTR, svg);
|
4060 | addToSet(ALLOWED_ATTR, xml);
|
4061 | }
|
4062 | if (USE_PROFILES.svgFilters === true) {
|
4063 | addToSet(ALLOWED_TAGS, svgFilters);
|
4064 | addToSet(ALLOWED_ATTR, svg);
|
4065 | addToSet(ALLOWED_ATTR, xml);
|
4066 | }
|
4067 | if (USE_PROFILES.mathMl === true) {
|
4068 | addToSet(ALLOWED_TAGS, mathMl$1);
|
4069 | addToSet(ALLOWED_ATTR, mathMl);
|
4070 | addToSet(ALLOWED_ATTR, xml);
|
4071 | }
|
4072 | }
|
4073 | if (cfg.ADD_TAGS) {
|
4074 | if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
4075 | ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
4076 | }
|
4077 | addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
4078 | }
|
4079 | if (cfg.ADD_ATTR) {
|
4080 | if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
4081 | ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
4082 | }
|
4083 | addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
4084 | }
|
4085 | if (cfg.ADD_URI_SAFE_ATTR) {
|
4086 | addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
4087 | }
|
4088 | if (cfg.FORBID_CONTENTS) {
|
4089 | if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
4090 | FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
4091 | }
|
4092 | addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
4093 | }
|
4094 | if (KEEP_CONTENT) {
|
4095 | ALLOWED_TAGS["#text"] = true;
|
4096 | }
|
4097 | if (WHOLE_DOCUMENT) {
|
4098 | addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
|
4099 | }
|
4100 | if (ALLOWED_TAGS.table) {
|
4101 | addToSet(ALLOWED_TAGS, ["tbody"]);
|
4102 | delete FORBID_TAGS.tbody;
|
4103 | }
|
4104 | if (cfg.TRUSTED_TYPES_POLICY) {
|
4105 | if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
|
4106 | throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
4107 | }
|
4108 | if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
|
4109 | throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
4110 | }
|
4111 | trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
4112 | emptyHTML = trustedTypesPolicy.createHTML("");
|
4113 | } else {
|
4114 | if (trustedTypesPolicy === void 0) {
|
4115 | trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
4116 | }
|
4117 | if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
|
4118 | emptyHTML = trustedTypesPolicy.createHTML("");
|
4119 | }
|
4120 | }
|
4121 | if (freeze) {
|
4122 | freeze(cfg);
|
4123 | }
|
4124 | CONFIG = cfg;
|
4125 | };
|
4126 | const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
4127 | const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
|
4128 | const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
4129 | const ALL_SVG_TAGS = addToSet({}, svg$1);
|
4130 | addToSet(ALL_SVG_TAGS, svgFilters);
|
4131 | addToSet(ALL_SVG_TAGS, svgDisallowed);
|
4132 | const ALL_MATHML_TAGS = addToSet({}, mathMl$1);
|
4133 | addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
|
4134 | const _checkValidNamespace = function _checkValidNamespace2(element) {
|
4135 | let parent = getParentNode(element);
|
4136 | if (!parent || !parent.tagName) {
|
4137 | parent = {
|
4138 | namespaceURI: NAMESPACE,
|
4139 | tagName: "template"
|
4140 | };
|
4141 | }
|
4142 | const tagName = stringToLowerCase(element.tagName);
|
4143 | const parentTagName = stringToLowerCase(parent.tagName);
|
4144 | if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
4145 | return false;
|
4146 | }
|
4147 | if (element.namespaceURI === SVG_NAMESPACE) {
|
4148 | if (parent.namespaceURI === HTML_NAMESPACE) {
|
4149 | return tagName === "svg";
|
4150 | }
|
4151 | if (parent.namespaceURI === MATHML_NAMESPACE) {
|
4152 | return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
4153 | }
|
4154 | return Boolean(ALL_SVG_TAGS[tagName]);
|
4155 | }
|
4156 | if (element.namespaceURI === MATHML_NAMESPACE) {
|
4157 | if (parent.namespaceURI === HTML_NAMESPACE) {
|
4158 | return tagName === "math";
|
4159 | }
|
4160 | if (parent.namespaceURI === SVG_NAMESPACE) {
|
4161 | return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
|
4162 | }
|
4163 | return Boolean(ALL_MATHML_TAGS[tagName]);
|
4164 | }
|
4165 | if (element.namespaceURI === HTML_NAMESPACE) {
|
4166 | if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
4167 | return false;
|
4168 | }
|
4169 | if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
4170 | return false;
|
4171 | }
|
4172 | return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
4173 | }
|
4174 | if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
4175 | return true;
|
4176 | }
|
4177 | return false;
|
4178 | };
|
4179 | const _forceRemove = function _forceRemove2(node2) {
|
4180 | arrayPush(DOMPurify.removed, {
|
4181 | element: node2
|
4182 | });
|
4183 | try {
|
4184 | node2.parentNode.removeChild(node2);
|
4185 | } catch (_2) {
|
4186 | node2.remove();
|
4187 | }
|
4188 | };
|
4189 | const _removeAttribute = function _removeAttribute2(name, node2) {
|
4190 | try {
|
4191 | arrayPush(DOMPurify.removed, {
|
4192 | attribute: node2.getAttributeNode(name),
|
4193 | from: node2
|
4194 | });
|
4195 | } catch (_2) {
|
4196 | arrayPush(DOMPurify.removed, {
|
4197 | attribute: null,
|
4198 | from: node2
|
4199 | });
|
4200 | }
|
4201 | node2.removeAttribute(name);
|
4202 | if (name === "is" && !ALLOWED_ATTR[name]) {
|
4203 | if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
4204 | try {
|
4205 | _forceRemove(node2);
|
4206 | } catch (_2) {
|
4207 | }
|
4208 | } else {
|
4209 | try {
|
4210 | node2.setAttribute(name, "");
|
4211 | } catch (_2) {
|
4212 | }
|
4213 | }
|
4214 | }
|
4215 | };
|
4216 | const _initDocument = function _initDocument2(dirty) {
|
4217 | let doc;
|
4218 | let leadingWhitespace;
|
4219 | if (FORCE_BODY) {
|
4220 | dirty = "<remove></remove>" + dirty;
|
4221 | } else {
|
4222 | const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
4223 | leadingWhitespace = matches && matches[0];
|
4224 | }
|
4225 | if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
|
4226 | dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
|
4227 | }
|
4228 | const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
4229 | if (NAMESPACE === HTML_NAMESPACE) {
|
4230 | try {
|
4231 | doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
4232 | } catch (_2) {
|
4233 | }
|
4234 | }
|
4235 | if (!doc || !doc.documentElement) {
|
4236 | doc = implementation.createDocument(NAMESPACE, "template", null);
|
4237 | try {
|
4238 | doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
4239 | } catch (_2) {
|
4240 | }
|
4241 | }
|
4242 | const body = doc.body || doc.documentElement;
|
4243 | if (dirty && leadingWhitespace) {
|
4244 | body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
4245 | }
|
4246 | if (NAMESPACE === HTML_NAMESPACE) {
|
4247 | return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
|
4248 | }
|
4249 | return WHOLE_DOCUMENT ? doc.documentElement : body;
|
4250 | };
|
4251 | const _createIterator = function _createIterator2(root2) {
|
4252 | return createNodeIterator.call(
|
4253 | root2.ownerDocument || root2,
|
4254 | root2,
|
4255 |
|
4256 | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
|
4257 | null,
|
4258 | false
|
4259 | );
|
4260 | };
|
4261 | const _isClobbered = function _isClobbered2(elm) {
|
4262 | return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
|
4263 | };
|
4264 | const _isNode = function _isNode2(object) {
|
4265 | return typeof Node === "object" ? object instanceof Node : object && typeof object === "object" && typeof object.nodeType === "number" && typeof object.nodeName === "string";
|
4266 | };
|
4267 | const _executeHook = function _executeHook2(entryPoint, currentNode, data) {
|
4268 | if (!hooks[entryPoint]) {
|
4269 | return;
|
4270 | }
|
4271 | arrayForEach(hooks[entryPoint], (hook) => {
|
4272 | hook.call(DOMPurify, currentNode, data, CONFIG);
|
4273 | });
|
4274 | };
|
4275 | const _sanitizeElements = function _sanitizeElements2(currentNode) {
|
4276 | let content;
|
4277 | _executeHook("beforeSanitizeElements", currentNode, null);
|
4278 | if (_isClobbered(currentNode)) {
|
4279 | _forceRemove(currentNode);
|
4280 | return true;
|
4281 | }
|
4282 | const tagName = transformCaseFunc(currentNode.nodeName);
|
4283 | _executeHook("uponSanitizeElement", currentNode, {
|
4284 | tagName,
|
4285 | allowedTags: ALLOWED_TAGS
|
4286 | });
|
4287 | if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
4288 | _forceRemove(currentNode);
|
4289 | return true;
|
4290 | }
|
4291 | if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
4292 | if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {
|
4293 | if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName))
|
4294 | return false;
|
4295 | if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))
|
4296 | return false;
|
4297 | }
|
4298 | if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
4299 | const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
4300 | const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
4301 | if (childNodes && parentNode) {
|
4302 | const childCount = childNodes.length;
|
4303 | for (let i = childCount - 1; i >= 0; --i) {
|
4304 | parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
4305 | }
|
4306 | }
|
4307 | }
|
4308 | _forceRemove(currentNode);
|
4309 | return true;
|
4310 | }
|
4311 | if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
4312 | _forceRemove(currentNode);
|
4313 | return true;
|
4314 | }
|
4315 | if ((tagName === "noscript" || tagName === "noembed") && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
|
4316 | _forceRemove(currentNode);
|
4317 | return true;
|
4318 | }
|
4319 | if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
4320 | content = currentNode.textContent;
|
4321 | content = stringReplace(content, MUSTACHE_EXPR2, " ");
|
4322 | content = stringReplace(content, ERB_EXPR2, " ");
|
4323 | content = stringReplace(content, TMPLIT_EXPR2, " ");
|
4324 | if (currentNode.textContent !== content) {
|
4325 | arrayPush(DOMPurify.removed, {
|
4326 | element: currentNode.cloneNode()
|
4327 | });
|
4328 | currentNode.textContent = content;
|
4329 | }
|
4330 | }
|
4331 | _executeHook("afterSanitizeElements", currentNode, null);
|
4332 | return false;
|
4333 | };
|
4334 | const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
|
4335 | if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
|
4336 | return false;
|
4337 | }
|
4338 | if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName))
|
4339 | ;
|
4340 | else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName))
|
4341 | ;
|
4342 | else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
4343 | if (
|
4344 |
|
4345 |
|
4346 |
|
4347 | _basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
4348 |
|
4349 | lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))
|
4350 | )
|
4351 | ;
|
4352 | else {
|
4353 | return false;
|
4354 | }
|
4355 | } else if (URI_SAFE_ATTRIBUTES[lcName])
|
4356 | ;
|
4357 | else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE2, "")))
|
4358 | ;
|
4359 | else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag])
|
4360 | ;
|
4361 | else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value, ATTR_WHITESPACE2, "")))
|
4362 | ;
|
4363 | else if (value) {
|
4364 | return false;
|
4365 | } else
|
4366 | ;
|
4367 | return true;
|
4368 | };
|
4369 | const _basicCustomElementTest = function _basicCustomElementTest2(tagName) {
|
4370 | return tagName.indexOf("-") > 0;
|
4371 | };
|
4372 | const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
|
4373 | let attr;
|
4374 | let value;
|
4375 | let lcName;
|
4376 | let l;
|
4377 | _executeHook("beforeSanitizeAttributes", currentNode, null);
|
4378 | const {
|
4379 | attributes
|
4380 | } = currentNode;
|
4381 | if (!attributes) {
|
4382 | return;
|
4383 | }
|
4384 | const hookEvent = {
|
4385 | attrName: "",
|
4386 | attrValue: "",
|
4387 | keepAttr: true,
|
4388 | allowedAttributes: ALLOWED_ATTR
|
4389 | };
|
4390 | l = attributes.length;
|
4391 | while (l--) {
|
4392 | attr = attributes[l];
|
4393 | const {
|
4394 | name,
|
4395 | namespaceURI
|
4396 | } = attr;
|
4397 | value = name === "value" ? attr.value : stringTrim(attr.value);
|
4398 | lcName = transformCaseFunc(name);
|
4399 | hookEvent.attrName = lcName;
|
4400 | hookEvent.attrValue = value;
|
4401 | hookEvent.keepAttr = true;
|
4402 | hookEvent.forceKeepAttr = void 0;
|
4403 | _executeHook("uponSanitizeAttribute", currentNode, hookEvent);
|
4404 | value = hookEvent.attrValue;
|
4405 | if (hookEvent.forceKeepAttr) {
|
4406 | continue;
|
4407 | }
|
4408 | _removeAttribute(name, currentNode);
|
4409 | if (!hookEvent.keepAttr) {
|
4410 | continue;
|
4411 | }
|
4412 | if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
4413 | _removeAttribute(name, currentNode);
|
4414 | continue;
|
4415 | }
|
4416 | if (SAFE_FOR_TEMPLATES) {
|
4417 | value = stringReplace(value, MUSTACHE_EXPR2, " ");
|
4418 | value = stringReplace(value, ERB_EXPR2, " ");
|
4419 | value = stringReplace(value, TMPLIT_EXPR2, " ");
|
4420 | }
|
4421 | const lcTag = transformCaseFunc(currentNode.nodeName);
|
4422 | if (!_isValidAttribute(lcTag, lcName, value)) {
|
4423 | continue;
|
4424 | }
|
4425 | if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
4426 | _removeAttribute(name, currentNode);
|
4427 | value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
4428 | }
|
4429 | if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
|
4430 | if (namespaceURI)
|
4431 | ;
|
4432 | else {
|
4433 | switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
4434 | case "TrustedHTML": {
|
4435 | value = trustedTypesPolicy.createHTML(value);
|
4436 | break;
|
4437 | }
|
4438 | case "TrustedScriptURL": {
|
4439 | value = trustedTypesPolicy.createScriptURL(value);
|
4440 | break;
|
4441 | }
|
4442 | }
|
4443 | }
|
4444 | }
|
4445 | try {
|
4446 | if (namespaceURI) {
|
4447 | currentNode.setAttributeNS(namespaceURI, name, value);
|
4448 | } else {
|
4449 | currentNode.setAttribute(name, value);
|
4450 | }
|
4451 | arrayPop(DOMPurify.removed);
|
4452 | } catch (_2) {
|
4453 | }
|
4454 | }
|
4455 | _executeHook("afterSanitizeAttributes", currentNode, null);
|
4456 | };
|
4457 | const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
|
4458 | let shadowNode;
|
4459 | const shadowIterator = _createIterator(fragment);
|
4460 | _executeHook("beforeSanitizeShadowDOM", fragment, null);
|
4461 | while (shadowNode = shadowIterator.nextNode()) {
|
4462 | _executeHook("uponSanitizeShadowNode", shadowNode, null);
|
4463 | if (_sanitizeElements(shadowNode)) {
|
4464 | continue;
|
4465 | }
|
4466 | if (shadowNode.content instanceof DocumentFragment) {
|
4467 | _sanitizeShadowDOM2(shadowNode.content);
|
4468 | }
|
4469 | _sanitizeAttributes(shadowNode);
|
4470 | }
|
4471 | _executeHook("afterSanitizeShadowDOM", fragment, null);
|
4472 | };
|
4473 | DOMPurify.sanitize = function(dirty) {
|
4474 | let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
4475 | let body;
|
4476 | let importedNode;
|
4477 | let currentNode;
|
4478 | let returnNode;
|
4479 | IS_EMPTY_INPUT = !dirty;
|
4480 | if (IS_EMPTY_INPUT) {
|
4481 | dirty = "<!-->";
|
4482 | }
|
4483 | if (typeof dirty !== "string" && !_isNode(dirty)) {
|
4484 | if (typeof dirty.toString === "function") {
|
4485 | dirty = dirty.toString();
|
4486 | if (typeof dirty !== "string") {
|
4487 | throw typeErrorCreate("dirty is not a string, aborting");
|
4488 | }
|
4489 | } else {
|
4490 | throw typeErrorCreate("toString is not a function");
|
4491 | }
|
4492 | }
|
4493 | if (!DOMPurify.isSupported) {
|
4494 | return dirty;
|
4495 | }
|
4496 | if (!SET_CONFIG) {
|
4497 | _parseConfig(cfg);
|
4498 | }
|
4499 | DOMPurify.removed = [];
|
4500 | if (typeof dirty === "string") {
|
4501 | IN_PLACE = false;
|
4502 | }
|
4503 | if (IN_PLACE) {
|
4504 | if (dirty.nodeName) {
|
4505 | const tagName = transformCaseFunc(dirty.nodeName);
|
4506 | if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
4507 | throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
4508 | }
|
4509 | }
|
4510 | } else if (dirty instanceof Node) {
|
4511 | body = _initDocument("<!---->");
|
4512 | importedNode = body.ownerDocument.importNode(dirty, true);
|
4513 | if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
|
4514 | body = importedNode;
|
4515 | } else if (importedNode.nodeName === "HTML") {
|
4516 | body = importedNode;
|
4517 | } else {
|
4518 | body.appendChild(importedNode);
|
4519 | }
|
4520 | } else {
|
4521 | if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
4522 | dirty.indexOf("<") === -1) {
|
4523 | return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
4524 | }
|
4525 | body = _initDocument(dirty);
|
4526 | if (!body) {
|
4527 | return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
|
4528 | }
|
4529 | }
|
4530 | if (body && FORCE_BODY) {
|
4531 | _forceRemove(body.firstChild);
|
4532 | }
|
4533 | const nodeIterator = _createIterator(IN_PLACE ? dirty : body);
|
4534 | while (currentNode = nodeIterator.nextNode()) {
|
4535 | if (_sanitizeElements(currentNode)) {
|
4536 | continue;
|
4537 | }
|
4538 | if (currentNode.content instanceof DocumentFragment) {
|
4539 | _sanitizeShadowDOM(currentNode.content);
|
4540 | }
|
4541 | _sanitizeAttributes(currentNode);
|
4542 | }
|
4543 | if (IN_PLACE) {
|
4544 | return dirty;
|
4545 | }
|
4546 | if (RETURN_DOM) {
|
4547 | if (RETURN_DOM_FRAGMENT) {
|
4548 | returnNode = createDocumentFragment.call(body.ownerDocument);
|
4549 | while (body.firstChild) {
|
4550 | returnNode.appendChild(body.firstChild);
|
4551 | }
|
4552 | } else {
|
4553 | returnNode = body;
|
4554 | }
|
4555 | if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
|
4556 | returnNode = importNode.call(originalDocument, returnNode, true);
|
4557 | }
|
4558 | return returnNode;
|
4559 | }
|
4560 | let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
4561 | if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
4562 | serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
|
4563 | }
|
4564 | if (SAFE_FOR_TEMPLATES) {
|
4565 | serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR2, " ");
|
4566 | serializedHTML = stringReplace(serializedHTML, ERB_EXPR2, " ");
|
4567 | serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR2, " ");
|
4568 | }
|
4569 | return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
4570 | };
|
4571 | DOMPurify.setConfig = function(cfg) {
|
4572 | _parseConfig(cfg);
|
4573 | SET_CONFIG = true;
|
4574 | };
|
4575 | DOMPurify.clearConfig = function() {
|
4576 | CONFIG = null;
|
4577 | SET_CONFIG = false;
|
4578 | };
|
4579 | DOMPurify.isValidAttribute = function(tag, attr, value) {
|
4580 | if (!CONFIG) {
|
4581 | _parseConfig({});
|
4582 | }
|
4583 | const lcTag = transformCaseFunc(tag);
|
4584 | const lcName = transformCaseFunc(attr);
|
4585 | return _isValidAttribute(lcTag, lcName, value);
|
4586 | };
|
4587 | DOMPurify.addHook = function(entryPoint, hookFunction) {
|
4588 | if (typeof hookFunction !== "function") {
|
4589 | return;
|
4590 | }
|
4591 | hooks[entryPoint] = hooks[entryPoint] || [];
|
4592 | arrayPush(hooks[entryPoint], hookFunction);
|
4593 | };
|
4594 | DOMPurify.removeHook = function(entryPoint) {
|
4595 | if (hooks[entryPoint]) {
|
4596 | return arrayPop(hooks[entryPoint]);
|
4597 | }
|
4598 | };
|
4599 | DOMPurify.removeHooks = function(entryPoint) {
|
4600 | if (hooks[entryPoint]) {
|
4601 | hooks[entryPoint] = [];
|
4602 | }
|
4603 | };
|
4604 | DOMPurify.removeAllHooks = function() {
|
4605 | hooks = {};
|
4606 | };
|
4607 | return DOMPurify;
|
4608 | }
|
4609 | var purify = createDOMPurify();
|
4610 | const lineBreakRegex = /<br\s*\/?>/gi;
|
4611 | const getRows = (s) => {
|
4612 | if (!s) {
|
4613 | return [""];
|
4614 | }
|
4615 | const str2 = breakToPlaceholder(s).replace(/\\n/g, "#br#");
|
4616 | return str2.split("#br#");
|
4617 | };
|
4618 | const removeScript = (txt) => {
|
4619 | return purify.sanitize(txt);
|
4620 | };
|
4621 | const sanitizeMore = (text2, config2) => {
|
4622 | var _a;
|
4623 | if (((_a = config2.flowchart) == null ? void 0 : _a.htmlLabels) !== false) {
|
4624 | const level = config2.securityLevel;
|
4625 | if (level === "antiscript" || level === "strict") {
|
4626 | text2 = removeScript(text2);
|
4627 | } else if (level !== "loose") {
|
4628 | text2 = breakToPlaceholder(text2);
|
4629 | text2 = text2.replace(/</g, "<").replace(/>/g, ">");
|
4630 | text2 = text2.replace(/=/g, "=");
|
4631 | text2 = placeholderToBreak(text2);
|
4632 | }
|
4633 | }
|
4634 | return text2;
|
4635 | };
|
4636 | const sanitizeText$2 = (text2, config2) => {
|
4637 | if (!text2) {
|
4638 | return text2;
|
4639 | }
|
4640 | if (config2.dompurifyConfig) {
|
4641 | text2 = purify.sanitize(sanitizeMore(text2, config2), config2.dompurifyConfig).toString();
|
4642 | } else {
|
4643 | text2 = purify.sanitize(sanitizeMore(text2, config2), {
|
4644 | FORBID_TAGS: ["style"]
|
4645 | }).toString();
|
4646 | }
|
4647 | return text2;
|
4648 | };
|
4649 | const sanitizeTextOrArray = (a, config2) => {
|
4650 | if (typeof a === "string") {
|
4651 | return sanitizeText$2(a, config2);
|
4652 | }
|
4653 | return a.flat().map((x) => sanitizeText$2(x, config2));
|
4654 | };
|
4655 | const hasBreaks = (text2) => {
|
4656 | return lineBreakRegex.test(text2);
|
4657 | };
|
4658 | const splitBreaks = (text2) => {
|
4659 | return text2.split(lineBreakRegex);
|
4660 | };
|
4661 | const placeholderToBreak = (s) => {
|
4662 | return s.replace(/#br#/g, "<br/>");
|
4663 | };
|
4664 | const breakToPlaceholder = (s) => {
|
4665 | return s.replace(lineBreakRegex, "#br#");
|
4666 | };
|
4667 | const getUrl = (useAbsolute) => {
|
4668 | let url = "";
|
4669 | if (useAbsolute) {
|
4670 | url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
|
4671 | url = url.replaceAll(/\(/g, "\\(");
|
4672 | url = url.replaceAll(/\)/g, "\\)");
|
4673 | }
|
4674 | return url;
|
4675 | };
|
4676 | const evaluate = (val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true;
|
4677 | const getMax = function(...values) {
|
4678 | const newValues = values.filter((value) => {
|
4679 | return !isNaN(value);
|
4680 | });
|
4681 | return Math.max(...newValues);
|
4682 | };
|
4683 | const getMin = function(...values) {
|
4684 | const newValues = values.filter((value) => {
|
4685 | return !isNaN(value);
|
4686 | });
|
4687 | return Math.min(...newValues);
|
4688 | };
|
4689 | const parseGenericTypes = function(text2) {
|
4690 | let cleanedText = text2;
|
4691 | if (text2.split("~").length - 1 >= 2) {
|
4692 | let newCleanedText = cleanedText;
|
4693 | do {
|
4694 | cleanedText = newCleanedText;
|
4695 | newCleanedText = cleanedText.replace(/~([^\s,:;]+)~/, "<$1>");
|
4696 | } while (newCleanedText != cleanedText);
|
4697 | return parseGenericTypes(newCleanedText);
|
4698 | } else {
|
4699 | return cleanedText;
|
4700 | }
|
4701 | };
|
4702 | const common$1 = {
|
4703 | getRows,
|
4704 | sanitizeText: sanitizeText$2,
|
4705 | sanitizeTextOrArray,
|
4706 | hasBreaks,
|
4707 | splitBreaks,
|
4708 | lineBreakRegex,
|
4709 | removeScript,
|
4710 | getUrl,
|
4711 | evaluate,
|
4712 | getMax,
|
4713 | getMin
|
4714 | };
|
4715 | const Channel = {
|
4716 |
|
4717 | min: {
|
4718 | r: 0,
|
4719 | g: 0,
|
4720 | b: 0,
|
4721 | s: 0,
|
4722 | l: 0,
|
4723 | a: 0
|
4724 | },
|
4725 | max: {
|
4726 | r: 255,
|
4727 | g: 255,
|
4728 | b: 255,
|
4729 | h: 360,
|
4730 | s: 100,
|
4731 | l: 100,
|
4732 | a: 1
|
4733 | },
|
4734 | clamp: {
|
4735 | r: (r) => r >= 255 ? 255 : r < 0 ? 0 : r,
|
4736 | g: (g) => g >= 255 ? 255 : g < 0 ? 0 : g,
|
4737 | b: (b) => b >= 255 ? 255 : b < 0 ? 0 : b,
|
4738 | h: (h) => h % 360,
|
4739 | s: (s) => s >= 100 ? 100 : s < 0 ? 0 : s,
|
4740 | l: (l) => l >= 100 ? 100 : l < 0 ? 0 : l,
|
4741 | a: (a) => a >= 1 ? 1 : a < 0 ? 0 : a
|
4742 | },
|
4743 |
|
4744 |
|
4745 | toLinear: (c) => {
|
4746 | const n = c / 255;
|
4747 | return c > 0.03928 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92;
|
4748 | },
|
4749 |
|
4750 | hue2rgb: (p, q, t) => {
|
4751 | if (t < 0)
|
4752 | t += 1;
|
4753 | if (t > 1)
|
4754 | t -= 1;
|
4755 | if (t < 1 / 6)
|
4756 | return p + (q - p) * 6 * t;
|
4757 | if (t < 1 / 2)
|
4758 | return q;
|
4759 | if (t < 2 / 3)
|
4760 | return p + (q - p) * (2 / 3 - t) * 6;
|
4761 | return p;
|
4762 | },
|
4763 | hsl2rgb: ({ h, s, l }, channel2) => {
|
4764 | if (!s)
|
4765 | return l * 2.55;
|
4766 | h /= 360;
|
4767 | s /= 100;
|
4768 | l /= 100;
|
4769 | const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
4770 | const p = 2 * l - q;
|
4771 | switch (channel2) {
|
4772 | case "r":
|
4773 | return Channel.hue2rgb(p, q, h + 1 / 3) * 255;
|
4774 | case "g":
|
4775 | return Channel.hue2rgb(p, q, h) * 255;
|
4776 | case "b":
|
4777 | return Channel.hue2rgb(p, q, h - 1 / 3) * 255;
|
4778 | }
|
4779 | },
|
4780 | rgb2hsl: ({ r, g, b }, channel2) => {
|
4781 | r /= 255;
|
4782 | g /= 255;
|
4783 | b /= 255;
|
4784 | const max2 = Math.max(r, g, b);
|
4785 | const min2 = Math.min(r, g, b);
|
4786 | const l = (max2 + min2) / 2;
|
4787 | if (channel2 === "l")
|
4788 | return l * 100;
|
4789 | if (max2 === min2)
|
4790 | return 0;
|
4791 | const d = max2 - min2;
|
4792 | const s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2);
|
4793 | if (channel2 === "s")
|
4794 | return s * 100;
|
4795 | switch (max2) {
|
4796 | case r:
|
4797 | return ((g - b) / d + (g < b ? 6 : 0)) * 60;
|
4798 | case g:
|
4799 | return ((b - r) / d + 2) * 60;
|
4800 | case b:
|
4801 | return ((r - g) / d + 4) * 60;
|
4802 | default:
|
4803 | return -1;
|
4804 | }
|
4805 | }
|
4806 | };
|
4807 | const channel = Channel;
|
4808 | const Lang = {
|
4809 |
|
4810 | clamp: (number, lower2, upper) => {
|
4811 | if (lower2 > upper)
|
4812 | return Math.min(lower2, Math.max(upper, number));
|
4813 | return Math.min(upper, Math.max(lower2, number));
|
4814 | },
|
4815 | round: (number) => {
|
4816 | return Math.round(number * 1e10) / 1e10;
|
4817 | }
|
4818 | };
|
4819 | const lang = Lang;
|
4820 | const Unit = {
|
4821 |
|
4822 | dec2hex: (dec) => {
|
4823 | const hex2 = Math.round(dec).toString(16);
|
4824 | return hex2.length > 1 ? hex2 : `0${hex2}`;
|
4825 | }
|
4826 | };
|
4827 | const unit = Unit;
|
4828 | const Utils = {
|
4829 | channel,
|
4830 | lang,
|
4831 | unit
|
4832 | };
|
4833 | const _ = Utils;
|
4834 | const DEC2HEX = {};
|
4835 | for (let i = 0; i <= 255; i++)
|
4836 | DEC2HEX[i] = _.unit.dec2hex(i);
|
4837 | const TYPE = {
|
4838 | ALL: 0,
|
4839 | RGB: 1,
|
4840 | HSL: 2
|
4841 | };
|
4842 | class Type {
|
4843 | constructor() {
|
4844 | this.type = TYPE.ALL;
|
4845 | }
|
4846 |
|
4847 | get() {
|
4848 | return this.type;
|
4849 | }
|
4850 | set(type2) {
|
4851 | if (this.type && this.type !== type2)
|
4852 | throw new Error("Cannot change both RGB and HSL channels at the same time");
|
4853 | this.type = type2;
|
4854 | }
|
4855 | reset() {
|
4856 | this.type = TYPE.ALL;
|
4857 | }
|
4858 | is(type2) {
|
4859 | return this.type === type2;
|
4860 | }
|
4861 | }
|
4862 | const Type$2 = Type;
|
4863 | class Channels {
|
4864 |
|
4865 | constructor(data, color2) {
|
4866 | this.color = color2;
|
4867 | this.changed = false;
|
4868 | this.data = data;
|
4869 | this.type = new Type$2();
|
4870 | }
|
4871 |
|
4872 | set(data, color2) {
|
4873 | this.color = color2;
|
4874 | this.changed = false;
|
4875 | this.data = data;
|
4876 | this.type.type = TYPE.ALL;
|
4877 | return this;
|
4878 | }
|
4879 |
|
4880 | _ensureHSL() {
|
4881 | const data = this.data;
|
4882 | const { h, s, l } = data;
|
4883 | if (h === void 0)
|
4884 | data.h = _.channel.rgb2hsl(data, "h");
|
4885 | if (s === void 0)
|
4886 | data.s = _.channel.rgb2hsl(data, "s");
|
4887 | if (l === void 0)
|
4888 | data.l = _.channel.rgb2hsl(data, "l");
|
4889 | }
|
4890 | _ensureRGB() {
|
4891 | const data = this.data;
|
4892 | const { r, g, b } = data;
|
4893 | if (r === void 0)
|
4894 | data.r = _.channel.hsl2rgb(data, "r");
|
4895 | if (g === void 0)
|
4896 | data.g = _.channel.hsl2rgb(data, "g");
|
4897 | if (b === void 0)
|
4898 | data.b = _.channel.hsl2rgb(data, "b");
|
4899 | }
|
4900 |
|
4901 | get r() {
|
4902 | const data = this.data;
|
4903 | const r = data.r;
|
4904 | if (!this.type.is(TYPE.HSL) && r !== void 0)
|
4905 | return r;
|
4906 | this._ensureHSL();
|
4907 | return _.channel.hsl2rgb(data, "r");
|
4908 | }
|
4909 | get g() {
|
4910 | const data = this.data;
|
4911 | const g = data.g;
|
4912 | if (!this.type.is(TYPE.HSL) && g !== void 0)
|
4913 | return g;
|
4914 | this._ensureHSL();
|
4915 | return _.channel.hsl2rgb(data, "g");
|
4916 | }
|
4917 | get b() {
|
4918 | const data = this.data;
|
4919 | const b = data.b;
|
4920 | if (!this.type.is(TYPE.HSL) && b !== void 0)
|
4921 | return b;
|
4922 | this._ensureHSL();
|
4923 | return _.channel.hsl2rgb(data, "b");
|
4924 | }
|
4925 | get h() {
|
4926 | const data = this.data;
|
4927 | const h = data.h;
|
4928 | if (!this.type.is(TYPE.RGB) && h !== void 0)
|
4929 | return h;
|
4930 | this._ensureRGB();
|
4931 | return _.channel.rgb2hsl(data, "h");
|
4932 | }
|
4933 | get s() {
|
4934 | const data = this.data;
|
4935 | const s = data.s;
|
4936 | if (!this.type.is(TYPE.RGB) && s !== void 0)
|
4937 | return s;
|
4938 | this._ensureRGB();
|
4939 | return _.channel.rgb2hsl(data, "s");
|
4940 | }
|
4941 | get l() {
|
4942 | const data = this.data;
|
4943 | const l = data.l;
|
4944 | if (!this.type.is(TYPE.RGB) && l !== void 0)
|
4945 | return l;
|
4946 | this._ensureRGB();
|
4947 | return _.channel.rgb2hsl(data, "l");
|
4948 | }
|
4949 | get a() {
|
4950 | return this.data.a;
|
4951 | }
|
4952 |
|
4953 | set r(r) {
|
4954 | this.type.set(TYPE.RGB);
|
4955 | this.changed = true;
|
4956 | this.data.r = r;
|
4957 | }
|
4958 | set g(g) {
|
4959 | this.type.set(TYPE.RGB);
|
4960 | this.changed = true;
|
4961 | this.data.g = g;
|
4962 | }
|
4963 | set b(b) {
|
4964 | this.type.set(TYPE.RGB);
|
4965 | this.changed = true;
|
4966 | this.data.b = b;
|
4967 | }
|
4968 | set h(h) {
|
4969 | this.type.set(TYPE.HSL);
|
4970 | this.changed = true;
|
4971 | this.data.h = h;
|
4972 | }
|
4973 | set s(s) {
|
4974 | this.type.set(TYPE.HSL);
|
4975 | this.changed = true;
|
4976 | this.data.s = s;
|
4977 | }
|
4978 | set l(l) {
|
4979 | this.type.set(TYPE.HSL);
|
4980 | this.changed = true;
|
4981 | this.data.l = l;
|
4982 | }
|
4983 | set a(a) {
|
4984 | this.changed = true;
|
4985 | this.data.a = a;
|
4986 | }
|
4987 | }
|
4988 | const Channels$1 = Channels;
|
4989 | const channels = new Channels$1({ r: 0, g: 0, b: 0, a: 0 }, "transparent");
|
4990 | const ChannelsReusable = channels;
|
4991 | const Hex = {
|
4992 |
|
4993 | re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,
|
4994 |
|
4995 | parse: (color2) => {
|
4996 | if (color2.charCodeAt(0) !== 35)
|
4997 | return;
|
4998 | const match = color2.match(Hex.re);
|
4999 | if (!match)
|
5000 | return;
|
5001 | const hex2 = match[1];
|
5002 | const dec = parseInt(hex2, 16);
|
5003 | const length2 = hex2.length;
|
5004 | const hasAlpha = length2 % 4 === 0;
|
5005 | const isFullLength = length2 > 4;
|
5006 | const multiplier = isFullLength ? 1 : 17;
|
5007 | const bits = isFullLength ? 8 : 4;
|
5008 | const bitsOffset = hasAlpha ? 0 : -1;
|
5009 | const mask = isFullLength ? 255 : 15;
|
5010 | return ChannelsReusable.set({
|
5011 | r: (dec >> bits * (bitsOffset + 3) & mask) * multiplier,
|
5012 | g: (dec >> bits * (bitsOffset + 2) & mask) * multiplier,
|
5013 | b: (dec >> bits * (bitsOffset + 1) & mask) * multiplier,
|
5014 | a: hasAlpha ? (dec & mask) * multiplier / 255 : 1
|
5015 | }, color2);
|
5016 | },
|
5017 | stringify: (channels2) => {
|
5018 | const { r, g, b, a } = channels2;
|
5019 | if (a < 1) {
|
5020 | return `#${DEC2HEX[Math.round(r)]}${DEC2HEX[Math.round(g)]}${DEC2HEX[Math.round(b)]}${DEC2HEX[Math.round(a * 255)]}`;
|
5021 | } else {
|
5022 | return `#${DEC2HEX[Math.round(r)]}${DEC2HEX[Math.round(g)]}${DEC2HEX[Math.round(b)]}`;
|
5023 | }
|
5024 | }
|
5025 | };
|
5026 | const Hex$1 = Hex;
|
5027 | const HSL = {
|
5028 |
|
5029 | re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,
|
5030 | hueRe: /^(.+?)(deg|grad|rad|turn)$/i,
|
5031 |
|
5032 | _hue2deg: (hue2) => {
|
5033 | const match = hue2.match(HSL.hueRe);
|
5034 | if (match) {
|
5035 | const [, number, unit2] = match;
|
5036 | switch (unit2) {
|
5037 | case "grad":
|
5038 | return _.channel.clamp.h(parseFloat(number) * 0.9);
|
5039 | case "rad":
|
5040 | return _.channel.clamp.h(parseFloat(number) * 180 / Math.PI);
|
5041 | case "turn":
|
5042 | return _.channel.clamp.h(parseFloat(number) * 360);
|
5043 | }
|
5044 | }
|
5045 | return _.channel.clamp.h(parseFloat(hue2));
|
5046 | },
|
5047 |
|
5048 | parse: (color2) => {
|
5049 | const charCode = color2.charCodeAt(0);
|
5050 | if (charCode !== 104 && charCode !== 72)
|
5051 | return;
|
5052 | const match = color2.match(HSL.re);
|
5053 | if (!match)
|
5054 | return;
|
5055 | const [, h, s, l, a, isAlphaPercentage] = match;
|
5056 | return ChannelsReusable.set({
|
5057 | h: HSL._hue2deg(h),
|
5058 | s: _.channel.clamp.s(parseFloat(s)),
|
5059 | l: _.channel.clamp.l(parseFloat(l)),
|
5060 | a: a ? _.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1
|
5061 | }, color2);
|
5062 | },
|
5063 | stringify: (channels2) => {
|
5064 | const { h, s, l, a } = channels2;
|
5065 | if (a < 1) {
|
5066 | return `hsla(${_.lang.round(h)}, ${_.lang.round(s)}%, ${_.lang.round(l)}%, ${a})`;
|
5067 | } else {
|
5068 | return `hsl(${_.lang.round(h)}, ${_.lang.round(s)}%, ${_.lang.round(l)}%)`;
|
5069 | }
|
5070 | }
|
5071 | };
|
5072 | const HSL$1 = HSL;
|
5073 | const Keyword = {
|
5074 |
|
5075 | colors: {
|
5076 | aliceblue: "#f0f8ff",
|
5077 | antiquewhite: "#faebd7",
|
5078 | aqua: "#00ffff",
|
5079 | aquamarine: "#7fffd4",
|
5080 | azure: "#f0ffff",
|
5081 | beige: "#f5f5dc",
|
5082 | bisque: "#ffe4c4",
|
5083 | black: "#000000",
|
5084 | blanchedalmond: "#ffebcd",
|
5085 | blue: "#0000ff",
|
5086 | blueviolet: "#8a2be2",
|
5087 | brown: "#a52a2a",
|
5088 | burlywood: "#deb887",
|
5089 | cadetblue: "#5f9ea0",
|
5090 | chartreuse: "#7fff00",
|
5091 | chocolate: "#d2691e",
|
5092 | coral: "#ff7f50",
|
5093 | cornflowerblue: "#6495ed",
|
5094 | cornsilk: "#fff8dc",
|
5095 | crimson: "#dc143c",
|
5096 | cyanaqua: "#00ffff",
|
5097 | darkblue: "#00008b",
|
5098 | darkcyan: "#008b8b",
|
5099 | darkgoldenrod: "#b8860b",
|
5100 | darkgray: "#a9a9a9",
|
5101 | darkgreen: "#006400",
|
5102 | darkgrey: "#a9a9a9",
|
5103 | darkkhaki: "#bdb76b",
|
5104 | darkmagenta: "#8b008b",
|
5105 | darkolivegreen: "#556b2f",
|
5106 | darkorange: "#ff8c00",
|
5107 | darkorchid: "#9932cc",
|
5108 | darkred: "#8b0000",
|
5109 | darksalmon: "#e9967a",
|
5110 | darkseagreen: "#8fbc8f",
|
5111 | darkslateblue: "#483d8b",
|
5112 | darkslategray: "#2f4f4f",
|
5113 | darkslategrey: "#2f4f4f",
|
5114 | darkturquoise: "#00ced1",
|
5115 | darkviolet: "#9400d3",
|
5116 | deeppink: "#ff1493",
|
5117 | deepskyblue: "#00bfff",
|
5118 | dimgray: "#696969",
|
5119 | dimgrey: "#696969",
|
5120 | dodgerblue: "#1e90ff",
|
5121 | firebrick: "#b22222",
|
5122 | floralwhite: "#fffaf0",
|
5123 | forestgreen: "#228b22",
|
5124 | fuchsia: "#ff00ff",
|
5125 | gainsboro: "#dcdcdc",
|
5126 | ghostwhite: "#f8f8ff",
|
5127 | gold: "#ffd700",
|
5128 | goldenrod: "#daa520",
|
5129 | gray: "#808080",
|
5130 | green: "#008000",
|
5131 | greenyellow: "#adff2f",
|
5132 | grey: "#808080",
|
5133 | honeydew: "#f0fff0",
|
5134 | hotpink: "#ff69b4",
|
5135 | indianred: "#cd5c5c",
|
5136 | indigo: "#4b0082",
|
5137 | ivory: "#fffff0",
|
5138 | khaki: "#f0e68c",
|
5139 | lavender: "#e6e6fa",
|
5140 | lavenderblush: "#fff0f5",
|
5141 | lawngreen: "#7cfc00",
|
5142 | lemonchiffon: "#fffacd",
|
5143 | lightblue: "#add8e6",
|
5144 | lightcoral: "#f08080",
|
5145 | lightcyan: "#e0ffff",
|
5146 | lightgoldenrodyellow: "#fafad2",
|
5147 | lightgray: "#d3d3d3",
|
5148 | lightgreen: "#90ee90",
|
5149 | lightgrey: "#d3d3d3",
|
5150 | lightpink: "#ffb6c1",
|
5151 | lightsalmon: "#ffa07a",
|
5152 | lightseagreen: "#20b2aa",
|
5153 | lightskyblue: "#87cefa",
|
5154 | lightslategray: "#778899",
|
5155 | lightslategrey: "#778899",
|
5156 | lightsteelblue: "#b0c4de",
|
5157 | lightyellow: "#ffffe0",
|
5158 | lime: "#00ff00",
|
5159 | limegreen: "#32cd32",
|
5160 | linen: "#faf0e6",
|
5161 | magenta: "#ff00ff",
|
5162 | maroon: "#800000",
|
5163 | mediumaquamarine: "#66cdaa",
|
5164 | mediumblue: "#0000cd",
|
5165 | mediumorchid: "#ba55d3",
|
5166 | mediumpurple: "#9370db",
|
5167 | mediumseagreen: "#3cb371",
|
5168 | mediumslateblue: "#7b68ee",
|
5169 | mediumspringgreen: "#00fa9a",
|
5170 | mediumturquoise: "#48d1cc",
|
5171 | mediumvioletred: "#c71585",
|
5172 | midnightblue: "#191970",
|
5173 | mintcream: "#f5fffa",
|
5174 | mistyrose: "#ffe4e1",
|
5175 | moccasin: "#ffe4b5",
|
5176 | navajowhite: "#ffdead",
|
5177 | navy: "#000080",
|
5178 | oldlace: "#fdf5e6",
|
5179 | olive: "#808000",
|
5180 | olivedrab: "#6b8e23",
|
5181 | orange: "#ffa500",
|
5182 | orangered: "#ff4500",
|
5183 | orchid: "#da70d6",
|
5184 | palegoldenrod: "#eee8aa",
|
5185 | palegreen: "#98fb98",
|
5186 | paleturquoise: "#afeeee",
|
5187 | palevioletred: "#db7093",
|
5188 | papayawhip: "#ffefd5",
|
5189 | peachpuff: "#ffdab9",
|
5190 | peru: "#cd853f",
|
5191 | pink: "#ffc0cb",
|
5192 | plum: "#dda0dd",
|
5193 | powderblue: "#b0e0e6",
|
5194 | purple: "#800080",
|
5195 | rebeccapurple: "#663399",
|
5196 | red: "#ff0000",
|
5197 | rosybrown: "#bc8f8f",
|
5198 | royalblue: "#4169e1",
|
5199 | saddlebrown: "#8b4513",
|
5200 | salmon: "#fa8072",
|
5201 | sandybrown: "#f4a460",
|
5202 | seagreen: "#2e8b57",
|
5203 | seashell: "#fff5ee",
|
5204 | sienna: "#a0522d",
|
5205 | silver: "#c0c0c0",
|
5206 | skyblue: "#87ceeb",
|
5207 | slateblue: "#6a5acd",
|
5208 | slategray: "#708090",
|
5209 | slategrey: "#708090",
|
5210 | snow: "#fffafa",
|
5211 | springgreen: "#00ff7f",
|
5212 | tan: "#d2b48c",
|
5213 | teal: "#008080",
|
5214 | thistle: "#d8bfd8",
|
5215 | transparent: "#00000000",
|
5216 | turquoise: "#40e0d0",
|
5217 | violet: "#ee82ee",
|
5218 | wheat: "#f5deb3",
|
5219 | white: "#ffffff",
|
5220 | whitesmoke: "#f5f5f5",
|
5221 | yellow: "#ffff00",
|
5222 | yellowgreen: "#9acd32"
|
5223 | },
|
5224 |
|
5225 | parse: (color2) => {
|
5226 | color2 = color2.toLowerCase();
|
5227 | const hex2 = Keyword.colors[color2];
|
5228 | if (!hex2)
|
5229 | return;
|
5230 | return Hex$1.parse(hex2);
|
5231 | },
|
5232 | stringify: (channels2) => {
|
5233 | const hex2 = Hex$1.stringify(channels2);
|
5234 | for (const name in Keyword.colors) {
|
5235 | if (Keyword.colors[name] === hex2)
|
5236 | return name;
|
5237 | }
|
5238 | return;
|
5239 | }
|
5240 | };
|
5241 | const Keyword$1 = Keyword;
|
5242 | const RGB = {
|
5243 |
|
5244 | re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,
|
5245 |
|
5246 | parse: (color2) => {
|
5247 | const charCode = color2.charCodeAt(0);
|
5248 | if (charCode !== 114 && charCode !== 82)
|
5249 | return;
|
5250 | const match = color2.match(RGB.re);
|
5251 | if (!match)
|
5252 | return;
|
5253 | const [, r, isRedPercentage, g, isGreenPercentage, b, isBluePercentage, a, isAlphaPercentage] = match;
|
5254 | return ChannelsReusable.set({
|
5255 | r: _.channel.clamp.r(isRedPercentage ? parseFloat(r) * 2.55 : parseFloat(r)),
|
5256 | g: _.channel.clamp.g(isGreenPercentage ? parseFloat(g) * 2.55 : parseFloat(g)),
|
5257 | b: _.channel.clamp.b(isBluePercentage ? parseFloat(b) * 2.55 : parseFloat(b)),
|
5258 | a: a ? _.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1
|
5259 | }, color2);
|
5260 | },
|
5261 | stringify: (channels2) => {
|
5262 | const { r, g, b, a } = channels2;
|
5263 | if (a < 1) {
|
5264 | return `rgba(${_.lang.round(r)}, ${_.lang.round(g)}, ${_.lang.round(b)}, ${_.lang.round(a)})`;
|
5265 | } else {
|
5266 | return `rgb(${_.lang.round(r)}, ${_.lang.round(g)}, ${_.lang.round(b)})`;
|
5267 | }
|
5268 | }
|
5269 | };
|
5270 | const RGB$1 = RGB;
|
5271 | const Color = {
|
5272 |
|
5273 | format: {
|
5274 | keyword: Keyword$1,
|
5275 | hex: Hex$1,
|
5276 | rgb: RGB$1,
|
5277 | rgba: RGB$1,
|
5278 | hsl: HSL$1,
|
5279 | hsla: HSL$1
|
5280 | },
|
5281 |
|
5282 | parse: (color2) => {
|
5283 | if (typeof color2 !== "string")
|
5284 | return color2;
|
5285 | const channels2 = Hex$1.parse(color2) || RGB$1.parse(color2) || HSL$1.parse(color2) || Keyword$1.parse(color2);
|
5286 | if (channels2)
|
5287 | return channels2;
|
5288 | throw new Error(`Unsupported color format: "${color2}"`);
|
5289 | },
|
5290 | stringify: (channels2) => {
|
5291 | if (!channels2.changed && channels2.color)
|
5292 | return channels2.color;
|
5293 | if (channels2.type.is(TYPE.HSL) || channels2.data.r === void 0) {
|
5294 | return HSL$1.stringify(channels2);
|
5295 | } else if (channels2.a < 1 || !Number.isInteger(channels2.r) || !Number.isInteger(channels2.g) || !Number.isInteger(channels2.b)) {
|
5296 | return RGB$1.stringify(channels2);
|
5297 | } else {
|
5298 | return Hex$1.stringify(channels2);
|
5299 | }
|
5300 | }
|
5301 | };
|
5302 | const Color$1 = Color;
|
5303 | const change = (color2, channels2) => {
|
5304 | const ch = Color$1.parse(color2);
|
5305 | for (const c in channels2) {
|
5306 | ch[c] = _.channel.clamp[c](channels2[c]);
|
5307 | }
|
5308 | return Color$1.stringify(ch);
|
5309 | };
|
5310 | const change$1 = change;
|
5311 | const rgba = (r, g, b = 0, a = 1) => {
|
5312 | if (typeof r !== "number")
|
5313 | return change$1(r, { a: g });
|
5314 | const channels2 = ChannelsReusable.set({
|
5315 | r: _.channel.clamp.r(r),
|
5316 | g: _.channel.clamp.g(g),
|
5317 | b: _.channel.clamp.b(b),
|
5318 | a: _.channel.clamp.a(a)
|
5319 | });
|
5320 | return Color$1.stringify(channels2);
|
5321 | };
|
5322 | const rgba$1 = rgba;
|
5323 | const luminance = (color2) => {
|
5324 | const { r, g, b } = Color$1.parse(color2);
|
5325 | const luminance2 = 0.2126 * _.channel.toLinear(r) + 0.7152 * _.channel.toLinear(g) + 0.0722 * _.channel.toLinear(b);
|
5326 | return _.lang.round(luminance2);
|
5327 | };
|
5328 | const luminance$1 = luminance;
|
5329 | const isLight = (color2) => {
|
5330 | return luminance$1(color2) >= 0.5;
|
5331 | };
|
5332 | const isLight$1 = isLight;
|
5333 | const isDark = (color2) => {
|
5334 | return !isLight$1(color2);
|
5335 | };
|
5336 | const isDark$1 = isDark;
|
5337 | const adjustChannel = (color2, channel2, amount) => {
|
5338 | const channels2 = Color$1.parse(color2);
|
5339 | const amountCurrent = channels2[channel2];
|
5340 | const amountNext = _.channel.clamp[channel2](amountCurrent + amount);
|
5341 | if (amountCurrent !== amountNext)
|
5342 | channels2[channel2] = amountNext;
|
5343 | return Color$1.stringify(channels2);
|
5344 | };
|
5345 | const adjustChannel$1 = adjustChannel;
|
5346 | const lighten = (color2, amount) => {
|
5347 | return adjustChannel$1(color2, "l", amount);
|
5348 | };
|
5349 | const lighten$1 = lighten;
|
5350 | const darken = (color2, amount) => {
|
5351 | return adjustChannel$1(color2, "l", -amount);
|
5352 | };
|
5353 | const darken$1 = darken;
|
5354 | const adjust = (color2, channels2) => {
|
5355 | const ch = Color$1.parse(color2);
|
5356 | const changes = {};
|
5357 | for (const c in channels2) {
|
5358 | if (!channels2[c])
|
5359 | continue;
|
5360 | changes[c] = ch[c] + channels2[c];
|
5361 | }
|
5362 | return change$1(color2, changes);
|
5363 | };
|
5364 | const adjust$1 = adjust;
|
5365 | const mix = (color1, color2, weight = 50) => {
|
5366 | const { r: r1, g: g1, b: b1, a: a1 } = Color$1.parse(color1);
|
5367 | const { r: r2, g: g2, b: b2, a: a2 } = Color$1.parse(color2);
|
5368 | const weightScale = weight / 100;
|
5369 | const weightNormalized = weightScale * 2 - 1;
|
5370 | const alphaDelta = a1 - a2;
|
5371 | const weight1combined = weightNormalized * alphaDelta === -1 ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta);
|
5372 | const weight1 = (weight1combined + 1) / 2;
|
5373 | const weight2 = 1 - weight1;
|
5374 | const r = r1 * weight1 + r2 * weight2;
|
5375 | const g = g1 * weight1 + g2 * weight2;
|
5376 | const b = b1 * weight1 + b2 * weight2;
|
5377 | const a = a1 * weightScale + a2 * (1 - weightScale);
|
5378 | return rgba$1(r, g, b, a);
|
5379 | };
|
5380 | const mix$1 = mix;
|
5381 | const invert = (color2, weight = 100) => {
|
5382 | const inverse = Color$1.parse(color2);
|
5383 | inverse.r = 255 - inverse.r;
|
5384 | inverse.g = 255 - inverse.g;
|
5385 | inverse.b = 255 - inverse.b;
|
5386 | return mix$1(inverse, color2, weight);
|
5387 | };
|
5388 | const invert$1 = invert;
|
5389 | const mkBorder = (col, darkMode) => darkMode ? adjust$1(col, { s: -40, l: 10 }) : adjust$1(col, { s: -40, l: -10 });
|
5390 | const oldAttributeBackgroundColorOdd = "#ffffff";
|
5391 | const oldAttributeBackgroundColorEven = "#f2f2f2";
|
5392 | let Theme$4 = class Theme {
|
5393 | constructor() {
|
5394 | this.background = "#f4f4f4";
|
5395 | this.primaryColor = "#fff4dd";
|
5396 | this.noteBkgColor = "#fff5ad";
|
5397 | this.noteTextColor = "#333";
|
5398 | this.THEME_COLOR_LIMIT = 12;
|
5399 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
5400 | this.fontSize = "16px";
|
5401 | }
|
5402 | updateColors() {
|
5403 | this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333");
|
5404 | this.secondaryColor = this.secondaryColor || adjust$1(this.primaryColor, { h: -120 });
|
5405 | this.tertiaryColor = this.tertiaryColor || adjust$1(this.primaryColor, { h: 180, l: 5 });
|
5406 | this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);
|
5407 | this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);
|
5408 | this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);
|
5409 | this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);
|
5410 | this.noteBkgColor = this.noteBkgColor || "#fff5ad";
|
5411 | this.noteTextColor = this.noteTextColor || "#333";
|
5412 | this.secondaryTextColor = this.secondaryTextColor || invert$1(this.secondaryColor);
|
5413 | this.tertiaryTextColor = this.tertiaryTextColor || invert$1(this.tertiaryColor);
|
5414 | this.lineColor = this.lineColor || invert$1(this.background);
|
5415 | this.arrowheadColor = this.arrowheadColor || invert$1(this.background);
|
5416 | this.textColor = this.textColor || this.primaryTextColor;
|
5417 | this.border2 = this.border2 || this.tertiaryBorderColor;
|
5418 | this.nodeBkg = this.nodeBkg || this.primaryColor;
|
5419 | this.mainBkg = this.mainBkg || this.primaryColor;
|
5420 | this.nodeBorder = this.nodeBorder || this.primaryBorderColor;
|
5421 | this.clusterBkg = this.clusterBkg || this.tertiaryColor;
|
5422 | this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;
|
5423 | this.defaultLinkColor = this.defaultLinkColor || this.lineColor;
|
5424 | this.titleColor = this.titleColor || this.tertiaryTextColor;
|
5425 | this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor);
|
5426 | this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;
|
5427 | this.actorBorder = this.actorBorder || this.primaryBorderColor;
|
5428 | this.actorBkg = this.actorBkg || this.mainBkg;
|
5429 | this.actorTextColor = this.actorTextColor || this.primaryTextColor;
|
5430 | this.actorLineColor = this.actorLineColor || "grey";
|
5431 | this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;
|
5432 | this.signalColor = this.signalColor || this.textColor;
|
5433 | this.signalTextColor = this.signalTextColor || this.textColor;
|
5434 | this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;
|
5435 | this.labelTextColor = this.labelTextColor || this.actorTextColor;
|
5436 | this.loopTextColor = this.loopTextColor || this.actorTextColor;
|
5437 | this.activationBorderColor = this.activationBorderColor || darken$1(this.secondaryColor, 10);
|
5438 | this.activationBkgColor = this.activationBkgColor || this.secondaryColor;
|
5439 | this.sequenceNumberColor = this.sequenceNumberColor || invert$1(this.lineColor);
|
5440 | this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;
|
5441 | this.altSectionBkgColor = this.altSectionBkgColor || "white";
|
5442 | this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;
|
5443 | this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;
|
5444 | this.excludeBkgColor = this.excludeBkgColor || "#eeeeee";
|
5445 | this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;
|
5446 | this.taskBkgColor = this.taskBkgColor || this.primaryColor;
|
5447 | this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;
|
5448 | this.activeTaskBkgColor = this.activeTaskBkgColor || lighten$1(this.primaryColor, 23);
|
5449 | this.gridColor = this.gridColor || "lightgrey";
|
5450 | this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey";
|
5451 | this.doneTaskBorderColor = this.doneTaskBorderColor || "grey";
|
5452 | this.critBorderColor = this.critBorderColor || "#ff8888";
|
5453 | this.critBkgColor = this.critBkgColor || "red";
|
5454 | this.todayLineColor = this.todayLineColor || "red";
|
5455 | this.taskTextColor = this.taskTextColor || this.textColor;
|
5456 | this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;
|
5457 | this.taskTextLightColor = this.taskTextLightColor || this.textColor;
|
5458 | this.taskTextColor = this.taskTextColor || this.primaryTextColor;
|
5459 | this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;
|
5460 | this.taskTextClickableColor = this.taskTextClickableColor || "#003163";
|
5461 | this.personBorder = this.personBorder || this.primaryBorderColor;
|
5462 | this.personBkg = this.personBkg || this.mainBkg;
|
5463 | this.transitionColor = this.transitionColor || this.lineColor;
|
5464 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
5465 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
5466 | this.stateBkg = this.stateBkg || this.mainBkg;
|
5467 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
5468 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
5469 | this.altBackground = this.altBackground || this.tertiaryColor;
|
5470 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
5471 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
5472 | this.innerEndBackground = this.nodeBorder;
|
5473 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
5474 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
5475 | this.transitionColor = this.transitionColor || this.lineColor;
|
5476 | this.specialStateColor = this.lineColor;
|
5477 | this.cScale0 = this.cScale0 || this.primaryColor;
|
5478 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
5479 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
5480 | this.cScale3 = this.cScale3 || adjust$1(this.primaryColor, { h: 30 });
|
5481 | this.cScale4 = this.cScale4 || adjust$1(this.primaryColor, { h: 60 });
|
5482 | this.cScale5 = this.cScale5 || adjust$1(this.primaryColor, { h: 90 });
|
5483 | this.cScale6 = this.cScale6 || adjust$1(this.primaryColor, { h: 120 });
|
5484 | this.cScale7 = this.cScale7 || adjust$1(this.primaryColor, { h: 150 });
|
5485 | this.cScale8 = this.cScale8 || adjust$1(this.primaryColor, { h: 210, l: 150 });
|
5486 | this.cScale9 = this.cScale9 || adjust$1(this.primaryColor, { h: 270 });
|
5487 | this.cScale10 = this.cScale10 || adjust$1(this.primaryColor, { h: 300 });
|
5488 | this.cScale11 = this.cScale11 || adjust$1(this.primaryColor, { h: 330 });
|
5489 | if (this.darkMode) {
|
5490 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5491 | this["cScale" + i] = darken$1(this["cScale" + i], 75);
|
5492 | }
|
5493 | } else {
|
5494 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5495 | this["cScale" + i] = darken$1(this["cScale" + i], 25);
|
5496 | }
|
5497 | }
|
5498 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5499 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert$1(this["cScale" + i]);
|
5500 | }
|
5501 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5502 | if (this.darkMode) {
|
5503 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten$1(this["cScale" + i], 10);
|
5504 | } else {
|
5505 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken$1(this["cScale" + i], 10);
|
5506 | }
|
5507 | }
|
5508 | this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
|
5509 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5510 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
5511 | }
|
5512 | const multiplier = this.darkMode ? -4 : -1;
|
5513 | for (let i = 0; i < 5; i++) {
|
5514 | this["surface" + i] = this["surface" + i] || adjust$1(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i * 3) });
|
5515 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust$1(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i * 3) });
|
5516 | }
|
5517 | this.classText = this.classText || this.textColor;
|
5518 | this.fillType0 = this.fillType0 || this.primaryColor;
|
5519 | this.fillType1 = this.fillType1 || this.secondaryColor;
|
5520 | this.fillType2 = this.fillType2 || adjust$1(this.primaryColor, { h: 64 });
|
5521 | this.fillType3 = this.fillType3 || adjust$1(this.secondaryColor, { h: 64 });
|
5522 | this.fillType4 = this.fillType4 || adjust$1(this.primaryColor, { h: -64 });
|
5523 | this.fillType5 = this.fillType5 || adjust$1(this.secondaryColor, { h: -64 });
|
5524 | this.fillType6 = this.fillType6 || adjust$1(this.primaryColor, { h: 128 });
|
5525 | this.fillType7 = this.fillType7 || adjust$1(this.secondaryColor, { h: 128 });
|
5526 | this.pie1 = this.pie1 || this.primaryColor;
|
5527 | this.pie2 = this.pie2 || this.secondaryColor;
|
5528 | this.pie3 = this.pie3 || this.tertiaryColor;
|
5529 | this.pie4 = this.pie4 || adjust$1(this.primaryColor, { l: -10 });
|
5530 | this.pie5 = this.pie5 || adjust$1(this.secondaryColor, { l: -10 });
|
5531 | this.pie6 = this.pie6 || adjust$1(this.tertiaryColor, { l: -10 });
|
5532 | this.pie7 = this.pie7 || adjust$1(this.primaryColor, { h: 60, l: -10 });
|
5533 | this.pie8 = this.pie8 || adjust$1(this.primaryColor, { h: -60, l: -10 });
|
5534 | this.pie9 = this.pie9 || adjust$1(this.primaryColor, { h: 120, l: 0 });
|
5535 | this.pie10 = this.pie10 || adjust$1(this.primaryColor, { h: 60, l: -20 });
|
5536 | this.pie11 = this.pie11 || adjust$1(this.primaryColor, { h: -60, l: -20 });
|
5537 | this.pie12 = this.pie12 || adjust$1(this.primaryColor, { h: 120, l: -10 });
|
5538 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
5539 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
5540 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
5541 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
5542 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
5543 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
5544 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
5545 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
5546 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
5547 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
5548 | this.pieOpacity = this.pieOpacity || "0.7";
|
5549 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
5550 | this.quadrant2Fill = this.quadrant2Fill || adjust$1(this.primaryColor, { r: 5, g: 5, b: 5 });
|
5551 | this.quadrant3Fill = this.quadrant3Fill || adjust$1(this.primaryColor, { r: 10, g: 10, b: 10 });
|
5552 | this.quadrant4Fill = this.quadrant4Fill || adjust$1(this.primaryColor, { r: 15, g: 15, b: 15 });
|
5553 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
5554 | this.quadrant2TextFill = this.quadrant2TextFill || adjust$1(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
5555 | this.quadrant3TextFill = this.quadrant3TextFill || adjust$1(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
5556 | this.quadrant4TextFill = this.quadrant4TextFill || adjust$1(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
5557 | this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill);
|
5558 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
5559 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
5560 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
5561 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
5562 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
5563 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
5564 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
5565 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
5566 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
5567 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
5568 | this.relationColor = this.relationColor || this.lineColor;
|
5569 | this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor);
|
5570 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
5571 | this.git0 = this.git0 || this.primaryColor;
|
5572 | this.git1 = this.git1 || this.secondaryColor;
|
5573 | this.git2 = this.git2 || this.tertiaryColor;
|
5574 | this.git3 = this.git3 || adjust$1(this.primaryColor, { h: -30 });
|
5575 | this.git4 = this.git4 || adjust$1(this.primaryColor, { h: -60 });
|
5576 | this.git5 = this.git5 || adjust$1(this.primaryColor, { h: -90 });
|
5577 | this.git6 = this.git6 || adjust$1(this.primaryColor, { h: 60 });
|
5578 | this.git7 = this.git7 || adjust$1(this.primaryColor, { h: 120 });
|
5579 | if (this.darkMode) {
|
5580 | this.git0 = lighten$1(this.git0, 25);
|
5581 | this.git1 = lighten$1(this.git1, 25);
|
5582 | this.git2 = lighten$1(this.git2, 25);
|
5583 | this.git3 = lighten$1(this.git3, 25);
|
5584 | this.git4 = lighten$1(this.git4, 25);
|
5585 | this.git5 = lighten$1(this.git5, 25);
|
5586 | this.git6 = lighten$1(this.git6, 25);
|
5587 | this.git7 = lighten$1(this.git7, 25);
|
5588 | } else {
|
5589 | this.git0 = darken$1(this.git0, 25);
|
5590 | this.git1 = darken$1(this.git1, 25);
|
5591 | this.git2 = darken$1(this.git2, 25);
|
5592 | this.git3 = darken$1(this.git3, 25);
|
5593 | this.git4 = darken$1(this.git4, 25);
|
5594 | this.git5 = darken$1(this.git5, 25);
|
5595 | this.git6 = darken$1(this.git6, 25);
|
5596 | this.git7 = darken$1(this.git7, 25);
|
5597 | }
|
5598 | this.gitInv0 = this.gitInv0 || invert$1(this.git0);
|
5599 | this.gitInv1 = this.gitInv1 || invert$1(this.git1);
|
5600 | this.gitInv2 = this.gitInv2 || invert$1(this.git2);
|
5601 | this.gitInv3 = this.gitInv3 || invert$1(this.git3);
|
5602 | this.gitInv4 = this.gitInv4 || invert$1(this.git4);
|
5603 | this.gitInv5 = this.gitInv5 || invert$1(this.git5);
|
5604 | this.gitInv6 = this.gitInv6 || invert$1(this.git6);
|
5605 | this.gitInv7 = this.gitInv7 || invert$1(this.git7);
|
5606 | this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
5607 | this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
5608 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
5609 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor;
|
5610 | this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor;
|
5611 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor;
|
5612 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor;
|
5613 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor;
|
5614 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor;
|
5615 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
5616 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
5617 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
5618 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
5619 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
5620 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
5621 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
5622 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
5623 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
5624 | }
|
5625 | calculate(overrides) {
|
5626 | if (typeof overrides !== "object") {
|
5627 | this.updateColors();
|
5628 | return;
|
5629 | }
|
5630 | const keys = Object.keys(overrides);
|
5631 | keys.forEach((k) => {
|
5632 | this[k] = overrides[k];
|
5633 | });
|
5634 | this.updateColors();
|
5635 | keys.forEach((k) => {
|
5636 | this[k] = overrides[k];
|
5637 | });
|
5638 | }
|
5639 | };
|
5640 | const getThemeVariables$4 = (userOverrides) => {
|
5641 | const theme2 = new Theme$4();
|
5642 | theme2.calculate(userOverrides);
|
5643 | return theme2;
|
5644 | };
|
5645 | let Theme$3 = class Theme2 {
|
5646 | constructor() {
|
5647 | this.background = "#333";
|
5648 | this.primaryColor = "#1f2020";
|
5649 | this.secondaryColor = lighten$1(this.primaryColor, 16);
|
5650 | this.tertiaryColor = adjust$1(this.primaryColor, { h: -160 });
|
5651 | this.primaryBorderColor = invert$1(this.background);
|
5652 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
5653 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
5654 | this.primaryTextColor = invert$1(this.primaryColor);
|
5655 | this.secondaryTextColor = invert$1(this.secondaryColor);
|
5656 | this.tertiaryTextColor = invert$1(this.tertiaryColor);
|
5657 | this.lineColor = invert$1(this.background);
|
5658 | this.textColor = invert$1(this.background);
|
5659 | this.mainBkg = "#1f2020";
|
5660 | this.secondBkg = "calculated";
|
5661 | this.mainContrastColor = "lightgrey";
|
5662 | this.darkTextColor = lighten$1(invert$1("#323D47"), 10);
|
5663 | this.lineColor = "calculated";
|
5664 | this.border1 = "#81B1DB";
|
5665 | this.border2 = rgba$1(255, 255, 255, 0.25);
|
5666 | this.arrowheadColor = "calculated";
|
5667 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
5668 | this.fontSize = "16px";
|
5669 | this.labelBackground = "#181818";
|
5670 | this.textColor = "#ccc";
|
5671 | this.THEME_COLOR_LIMIT = 12;
|
5672 | this.nodeBkg = "calculated";
|
5673 | this.nodeBorder = "calculated";
|
5674 | this.clusterBkg = "calculated";
|
5675 | this.clusterBorder = "calculated";
|
5676 | this.defaultLinkColor = "calculated";
|
5677 | this.titleColor = "#F9FFFE";
|
5678 | this.edgeLabelBackground = "calculated";
|
5679 | this.actorBorder = "calculated";
|
5680 | this.actorBkg = "calculated";
|
5681 | this.actorTextColor = "calculated";
|
5682 | this.actorLineColor = "calculated";
|
5683 | this.signalColor = "calculated";
|
5684 | this.signalTextColor = "calculated";
|
5685 | this.labelBoxBkgColor = "calculated";
|
5686 | this.labelBoxBorderColor = "calculated";
|
5687 | this.labelTextColor = "calculated";
|
5688 | this.loopTextColor = "calculated";
|
5689 | this.noteBorderColor = "calculated";
|
5690 | this.noteBkgColor = "#fff5ad";
|
5691 | this.noteTextColor = "calculated";
|
5692 | this.activationBorderColor = "calculated";
|
5693 | this.activationBkgColor = "calculated";
|
5694 | this.sequenceNumberColor = "black";
|
5695 | this.sectionBkgColor = darken$1("#EAE8D9", 30);
|
5696 | this.altSectionBkgColor = "calculated";
|
5697 | this.sectionBkgColor2 = "#EAE8D9";
|
5698 | this.excludeBkgColor = darken$1(this.sectionBkgColor, 10);
|
5699 | this.taskBorderColor = rgba$1(255, 255, 255, 70);
|
5700 | this.taskBkgColor = "calculated";
|
5701 | this.taskTextColor = "calculated";
|
5702 | this.taskTextLightColor = "calculated";
|
5703 | this.taskTextOutsideColor = "calculated";
|
5704 | this.taskTextClickableColor = "#003163";
|
5705 | this.activeTaskBorderColor = rgba$1(255, 255, 255, 50);
|
5706 | this.activeTaskBkgColor = "#81B1DB";
|
5707 | this.gridColor = "calculated";
|
5708 | this.doneTaskBkgColor = "calculated";
|
5709 | this.doneTaskBorderColor = "grey";
|
5710 | this.critBorderColor = "#E83737";
|
5711 | this.critBkgColor = "#E83737";
|
5712 | this.taskTextDarkColor = "calculated";
|
5713 | this.todayLineColor = "#DB5757";
|
5714 | this.personBorder = this.primaryBorderColor;
|
5715 | this.personBkg = this.mainBkg;
|
5716 | this.labelColor = "calculated";
|
5717 | this.errorBkgColor = "#a44141";
|
5718 | this.errorTextColor = "#ddd";
|
5719 | }
|
5720 | updateColors() {
|
5721 | this.secondBkg = lighten$1(this.mainBkg, 16);
|
5722 | this.lineColor = this.mainContrastColor;
|
5723 | this.arrowheadColor = this.mainContrastColor;
|
5724 | this.nodeBkg = this.mainBkg;
|
5725 | this.nodeBorder = this.border1;
|
5726 | this.clusterBkg = this.secondBkg;
|
5727 | this.clusterBorder = this.border2;
|
5728 | this.defaultLinkColor = this.lineColor;
|
5729 | this.edgeLabelBackground = lighten$1(this.labelBackground, 25);
|
5730 | this.actorBorder = this.border1;
|
5731 | this.actorBkg = this.mainBkg;
|
5732 | this.actorTextColor = this.mainContrastColor;
|
5733 | this.actorLineColor = this.mainContrastColor;
|
5734 | this.signalColor = this.mainContrastColor;
|
5735 | this.signalTextColor = this.mainContrastColor;
|
5736 | this.labelBoxBkgColor = this.actorBkg;
|
5737 | this.labelBoxBorderColor = this.actorBorder;
|
5738 | this.labelTextColor = this.mainContrastColor;
|
5739 | this.loopTextColor = this.mainContrastColor;
|
5740 | this.noteBorderColor = this.secondaryBorderColor;
|
5741 | this.noteBkgColor = this.secondBkg;
|
5742 | this.noteTextColor = this.secondaryTextColor;
|
5743 | this.activationBorderColor = this.border1;
|
5744 | this.activationBkgColor = this.secondBkg;
|
5745 | this.altSectionBkgColor = this.background;
|
5746 | this.taskBkgColor = lighten$1(this.mainBkg, 23);
|
5747 | this.taskTextColor = this.darkTextColor;
|
5748 | this.taskTextLightColor = this.mainContrastColor;
|
5749 | this.taskTextOutsideColor = this.taskTextLightColor;
|
5750 | this.gridColor = this.mainContrastColor;
|
5751 | this.doneTaskBkgColor = this.mainContrastColor;
|
5752 | this.taskTextDarkColor = this.darkTextColor;
|
5753 | this.transitionColor = this.transitionColor || this.lineColor;
|
5754 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
5755 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
5756 | this.stateBkg = this.stateBkg || this.mainBkg;
|
5757 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
5758 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
5759 | this.altBackground = this.altBackground || "#555";
|
5760 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
5761 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
5762 | this.innerEndBackground = this.primaryBorderColor;
|
5763 | this.specialStateColor = "#f4f4f4";
|
5764 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
5765 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
5766 | this.fillType0 = this.primaryColor;
|
5767 | this.fillType1 = this.secondaryColor;
|
5768 | this.fillType2 = adjust$1(this.primaryColor, { h: 64 });
|
5769 | this.fillType3 = adjust$1(this.secondaryColor, { h: 64 });
|
5770 | this.fillType4 = adjust$1(this.primaryColor, { h: -64 });
|
5771 | this.fillType5 = adjust$1(this.secondaryColor, { h: -64 });
|
5772 | this.fillType6 = adjust$1(this.primaryColor, { h: 128 });
|
5773 | this.fillType7 = adjust$1(this.secondaryColor, { h: 128 });
|
5774 | this.cScale1 = this.cScale1 || "#0b0000";
|
5775 | this.cScale2 = this.cScale2 || "#4d1037";
|
5776 | this.cScale3 = this.cScale3 || "#3f5258";
|
5777 | this.cScale4 = this.cScale4 || "#4f2f1b";
|
5778 | this.cScale5 = this.cScale5 || "#6e0a0a";
|
5779 | this.cScale6 = this.cScale6 || "#3b0048";
|
5780 | this.cScale7 = this.cScale7 || "#995a01";
|
5781 | this.cScale8 = this.cScale8 || "#154706";
|
5782 | this.cScale9 = this.cScale9 || "#161722";
|
5783 | this.cScale10 = this.cScale10 || "#00296f";
|
5784 | this.cScale11 = this.cScale11 || "#01629c";
|
5785 | this.cScale12 = this.cScale12 || "#010029";
|
5786 | this.cScale0 = this.cScale0 || this.primaryColor;
|
5787 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
5788 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
5789 | this.cScale3 = this.cScale3 || adjust$1(this.primaryColor, { h: 30 });
|
5790 | this.cScale4 = this.cScale4 || adjust$1(this.primaryColor, { h: 60 });
|
5791 | this.cScale5 = this.cScale5 || adjust$1(this.primaryColor, { h: 90 });
|
5792 | this.cScale6 = this.cScale6 || adjust$1(this.primaryColor, { h: 120 });
|
5793 | this.cScale7 = this.cScale7 || adjust$1(this.primaryColor, { h: 150 });
|
5794 | this.cScale8 = this.cScale8 || adjust$1(this.primaryColor, { h: 210 });
|
5795 | this.cScale9 = this.cScale9 || adjust$1(this.primaryColor, { h: 270 });
|
5796 | this.cScale10 = this.cScale10 || adjust$1(this.primaryColor, { h: 300 });
|
5797 | this.cScale11 = this.cScale11 || adjust$1(this.primaryColor, { h: 330 });
|
5798 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5799 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert$1(this["cScale" + i]);
|
5800 | }
|
5801 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5802 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten$1(this["cScale" + i], 10);
|
5803 | }
|
5804 | for (let i = 0; i < 5; i++) {
|
5805 | this["surface" + i] = this["surface" + i] || adjust$1(this.mainBkg, { h: 30, s: -30, l: -(-10 + i * 4) });
|
5806 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust$1(this.mainBkg, { h: 30, s: -30, l: -(-7 + i * 4) });
|
5807 | }
|
5808 | this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
5809 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5810 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
5811 | }
|
5812 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
5813 | this["pie" + i] = this["cScale" + i];
|
5814 | }
|
5815 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
5816 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
5817 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
5818 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
5819 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
5820 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
5821 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
5822 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
5823 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
5824 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
5825 | this.pieOpacity = this.pieOpacity || "0.7";
|
5826 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
5827 | this.quadrant2Fill = this.quadrant2Fill || adjust$1(this.primaryColor, { r: 5, g: 5, b: 5 });
|
5828 | this.quadrant3Fill = this.quadrant3Fill || adjust$1(this.primaryColor, { r: 10, g: 10, b: 10 });
|
5829 | this.quadrant4Fill = this.quadrant4Fill || adjust$1(this.primaryColor, { r: 15, g: 15, b: 15 });
|
5830 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
5831 | this.quadrant2TextFill = this.quadrant2TextFill || adjust$1(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
5832 | this.quadrant3TextFill = this.quadrant3TextFill || adjust$1(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
5833 | this.quadrant4TextFill = this.quadrant4TextFill || adjust$1(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
5834 | this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill);
|
5835 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
5836 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
5837 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
5838 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
5839 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
5840 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
5841 | this.classText = this.primaryTextColor;
|
5842 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
5843 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
5844 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
5845 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
5846 | this.relationColor = this.relationColor || this.lineColor;
|
5847 | this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor);
|
5848 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
5849 | this.git0 = lighten$1(this.secondaryColor, 20);
|
5850 | this.git1 = lighten$1(this.pie2 || this.secondaryColor, 20);
|
5851 | this.git2 = lighten$1(this.pie3 || this.tertiaryColor, 20);
|
5852 | this.git3 = lighten$1(this.pie4 || adjust$1(this.primaryColor, { h: -30 }), 20);
|
5853 | this.git4 = lighten$1(this.pie5 || adjust$1(this.primaryColor, { h: -60 }), 20);
|
5854 | this.git5 = lighten$1(this.pie6 || adjust$1(this.primaryColor, { h: -90 }), 10);
|
5855 | this.git6 = lighten$1(this.pie7 || adjust$1(this.primaryColor, { h: 60 }), 10);
|
5856 | this.git7 = lighten$1(this.pie8 || adjust$1(this.primaryColor, { h: 120 }), 20);
|
5857 | this.gitInv0 = this.gitInv0 || invert$1(this.git0);
|
5858 | this.gitInv1 = this.gitInv1 || invert$1(this.git1);
|
5859 | this.gitInv2 = this.gitInv2 || invert$1(this.git2);
|
5860 | this.gitInv3 = this.gitInv3 || invert$1(this.git3);
|
5861 | this.gitInv4 = this.gitInv4 || invert$1(this.git4);
|
5862 | this.gitInv5 = this.gitInv5 || invert$1(this.git5);
|
5863 | this.gitInv6 = this.gitInv6 || invert$1(this.git6);
|
5864 | this.gitInv7 = this.gitInv7 || invert$1(this.git7);
|
5865 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor);
|
5866 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
5867 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
5868 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor);
|
5869 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
5870 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
5871 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
5872 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
5873 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
5874 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
5875 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
5876 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
5877 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
5878 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
5879 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
5880 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || lighten$1(this.background, 12);
|
5881 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten$1(this.background, 2);
|
5882 | }
|
5883 | calculate(overrides) {
|
5884 | if (typeof overrides !== "object") {
|
5885 | this.updateColors();
|
5886 | return;
|
5887 | }
|
5888 | const keys = Object.keys(overrides);
|
5889 | keys.forEach((k) => {
|
5890 | this[k] = overrides[k];
|
5891 | });
|
5892 | this.updateColors();
|
5893 | keys.forEach((k) => {
|
5894 | this[k] = overrides[k];
|
5895 | });
|
5896 | }
|
5897 | };
|
5898 | const getThemeVariables$3 = (userOverrides) => {
|
5899 | const theme2 = new Theme$3();
|
5900 | theme2.calculate(userOverrides);
|
5901 | return theme2;
|
5902 | };
|
5903 | let Theme$2 = class Theme3 {
|
5904 | constructor() {
|
5905 | this.background = "#f4f4f4";
|
5906 | this.primaryColor = "#ECECFF";
|
5907 | this.secondaryColor = adjust$1(this.primaryColor, { h: 120 });
|
5908 | this.secondaryColor = "#ffffde";
|
5909 | this.tertiaryColor = adjust$1(this.primaryColor, { h: -160 });
|
5910 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
5911 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
5912 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
5913 | this.primaryTextColor = invert$1(this.primaryColor);
|
5914 | this.secondaryTextColor = invert$1(this.secondaryColor);
|
5915 | this.tertiaryTextColor = invert$1(this.tertiaryColor);
|
5916 | this.lineColor = invert$1(this.background);
|
5917 | this.textColor = invert$1(this.background);
|
5918 | this.background = "white";
|
5919 | this.mainBkg = "#ECECFF";
|
5920 | this.secondBkg = "#ffffde";
|
5921 | this.lineColor = "#333333";
|
5922 | this.border1 = "#9370DB";
|
5923 | this.border2 = "#aaaa33";
|
5924 | this.arrowheadColor = "#333333";
|
5925 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
5926 | this.fontSize = "16px";
|
5927 | this.labelBackground = "#e8e8e8";
|
5928 | this.textColor = "#333";
|
5929 | this.THEME_COLOR_LIMIT = 12;
|
5930 | this.nodeBkg = "calculated";
|
5931 | this.nodeBorder = "calculated";
|
5932 | this.clusterBkg = "calculated";
|
5933 | this.clusterBorder = "calculated";
|
5934 | this.defaultLinkColor = "calculated";
|
5935 | this.titleColor = "calculated";
|
5936 | this.edgeLabelBackground = "calculated";
|
5937 | this.actorBorder = "calculated";
|
5938 | this.actorBkg = "calculated";
|
5939 | this.actorTextColor = "black";
|
5940 | this.actorLineColor = "grey";
|
5941 | this.signalColor = "calculated";
|
5942 | this.signalTextColor = "calculated";
|
5943 | this.labelBoxBkgColor = "calculated";
|
5944 | this.labelBoxBorderColor = "calculated";
|
5945 | this.labelTextColor = "calculated";
|
5946 | this.loopTextColor = "calculated";
|
5947 | this.noteBorderColor = "calculated";
|
5948 | this.noteBkgColor = "#fff5ad";
|
5949 | this.noteTextColor = "calculated";
|
5950 | this.activationBorderColor = "#666";
|
5951 | this.activationBkgColor = "#f4f4f4";
|
5952 | this.sequenceNumberColor = "white";
|
5953 | this.sectionBkgColor = "calculated";
|
5954 | this.altSectionBkgColor = "calculated";
|
5955 | this.sectionBkgColor2 = "calculated";
|
5956 | this.excludeBkgColor = "#eeeeee";
|
5957 | this.taskBorderColor = "calculated";
|
5958 | this.taskBkgColor = "calculated";
|
5959 | this.taskTextLightColor = "calculated";
|
5960 | this.taskTextColor = this.taskTextLightColor;
|
5961 | this.taskTextDarkColor = "calculated";
|
5962 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
5963 | this.taskTextClickableColor = "calculated";
|
5964 | this.activeTaskBorderColor = "calculated";
|
5965 | this.activeTaskBkgColor = "calculated";
|
5966 | this.gridColor = "calculated";
|
5967 | this.doneTaskBkgColor = "calculated";
|
5968 | this.doneTaskBorderColor = "calculated";
|
5969 | this.critBorderColor = "calculated";
|
5970 | this.critBkgColor = "calculated";
|
5971 | this.todayLineColor = "calculated";
|
5972 | this.sectionBkgColor = rgba$1(102, 102, 255, 0.49);
|
5973 | this.altSectionBkgColor = "white";
|
5974 | this.sectionBkgColor2 = "#fff400";
|
5975 | this.taskBorderColor = "#534fbc";
|
5976 | this.taskBkgColor = "#8a90dd";
|
5977 | this.taskTextLightColor = "white";
|
5978 | this.taskTextColor = "calculated";
|
5979 | this.taskTextDarkColor = "black";
|
5980 | this.taskTextOutsideColor = "calculated";
|
5981 | this.taskTextClickableColor = "#003163";
|
5982 | this.activeTaskBorderColor = "#534fbc";
|
5983 | this.activeTaskBkgColor = "#bfc7ff";
|
5984 | this.gridColor = "lightgrey";
|
5985 | this.doneTaskBkgColor = "lightgrey";
|
5986 | this.doneTaskBorderColor = "grey";
|
5987 | this.critBorderColor = "#ff8888";
|
5988 | this.critBkgColor = "red";
|
5989 | this.todayLineColor = "red";
|
5990 | this.personBorder = this.primaryBorderColor;
|
5991 | this.personBkg = this.mainBkg;
|
5992 | this.labelColor = "black";
|
5993 | this.errorBkgColor = "#552222";
|
5994 | this.errorTextColor = "#552222";
|
5995 | this.updateColors();
|
5996 | }
|
5997 | updateColors() {
|
5998 | this.cScale0 = this.cScale0 || this.primaryColor;
|
5999 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
6000 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
6001 | this.cScale3 = this.cScale3 || adjust$1(this.primaryColor, { h: 30 });
|
6002 | this.cScale4 = this.cScale4 || adjust$1(this.primaryColor, { h: 60 });
|
6003 | this.cScale5 = this.cScale5 || adjust$1(this.primaryColor, { h: 90 });
|
6004 | this.cScale6 = this.cScale6 || adjust$1(this.primaryColor, { h: 120 });
|
6005 | this.cScale7 = this.cScale7 || adjust$1(this.primaryColor, { h: 150 });
|
6006 | this.cScale8 = this.cScale8 || adjust$1(this.primaryColor, { h: 210 });
|
6007 | this.cScale9 = this.cScale9 || adjust$1(this.primaryColor, { h: 270 });
|
6008 | this.cScale10 = this.cScale10 || adjust$1(this.primaryColor, { h: 300 });
|
6009 | this.cScale11 = this.cScale11 || adjust$1(this.primaryColor, { h: 330 });
|
6010 | this["cScalePeer1"] = this["cScalePeer1"] || darken$1(this.secondaryColor, 45);
|
6011 | this["cScalePeer2"] = this["cScalePeer2"] || darken$1(this.tertiaryColor, 40);
|
6012 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6013 | this["cScale" + i] = darken$1(this["cScale" + i], 10);
|
6014 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken$1(this["cScale" + i], 25);
|
6015 | }
|
6016 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6017 | this["cScaleInv" + i] = this["cScaleInv" + i] || adjust$1(this["cScale" + i], { h: 180 });
|
6018 | }
|
6019 | for (let i = 0; i < 5; i++) {
|
6020 | this["surface" + i] = this["surface" + i] || adjust$1(this.mainBkg, { h: 30, l: -(5 + i * 5) });
|
6021 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust$1(this.mainBkg, { h: 30, l: -(7 + i * 5) });
|
6022 | }
|
6023 | this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
|
6024 | if (this.labelTextColor !== "calculated") {
|
6025 | this.cScaleLabel0 = this.cScaleLabel0 || invert$1(this.labelTextColor);
|
6026 | this.cScaleLabel3 = this.cScaleLabel3 || invert$1(this.labelTextColor);
|
6027 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6028 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.labelTextColor;
|
6029 | }
|
6030 | }
|
6031 | this.nodeBkg = this.mainBkg;
|
6032 | this.nodeBorder = this.border1;
|
6033 | this.clusterBkg = this.secondBkg;
|
6034 | this.clusterBorder = this.border2;
|
6035 | this.defaultLinkColor = this.lineColor;
|
6036 | this.titleColor = this.textColor;
|
6037 | this.edgeLabelBackground = this.labelBackground;
|
6038 | this.actorBorder = lighten$1(this.border1, 23);
|
6039 | this.actorBkg = this.mainBkg;
|
6040 | this.labelBoxBkgColor = this.actorBkg;
|
6041 | this.signalColor = this.textColor;
|
6042 | this.signalTextColor = this.textColor;
|
6043 | this.labelBoxBorderColor = this.actorBorder;
|
6044 | this.labelTextColor = this.actorTextColor;
|
6045 | this.loopTextColor = this.actorTextColor;
|
6046 | this.noteBorderColor = this.border2;
|
6047 | this.noteTextColor = this.actorTextColor;
|
6048 | this.taskTextColor = this.taskTextLightColor;
|
6049 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
6050 | this.transitionColor = this.transitionColor || this.lineColor;
|
6051 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
6052 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
6053 | this.stateBkg = this.stateBkg || this.mainBkg;
|
6054 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
6055 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
6056 | this.altBackground = this.altBackground || "#f0f0f0";
|
6057 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
6058 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
6059 | this.innerEndBackground = this.nodeBorder;
|
6060 | this.specialStateColor = this.lineColor;
|
6061 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
6062 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
6063 | this.transitionColor = this.transitionColor || this.lineColor;
|
6064 | this.classText = this.primaryTextColor;
|
6065 | this.fillType0 = this.primaryColor;
|
6066 | this.fillType1 = this.secondaryColor;
|
6067 | this.fillType2 = adjust$1(this.primaryColor, { h: 64 });
|
6068 | this.fillType3 = adjust$1(this.secondaryColor, { h: 64 });
|
6069 | this.fillType4 = adjust$1(this.primaryColor, { h: -64 });
|
6070 | this.fillType5 = adjust$1(this.secondaryColor, { h: -64 });
|
6071 | this.fillType6 = adjust$1(this.primaryColor, { h: 128 });
|
6072 | this.fillType7 = adjust$1(this.secondaryColor, { h: 128 });
|
6073 | this.pie1 = this.pie1 || this.primaryColor;
|
6074 | this.pie2 = this.pie2 || this.secondaryColor;
|
6075 | this.pie3 = this.pie3 || adjust$1(this.tertiaryColor, { l: -40 });
|
6076 | this.pie4 = this.pie4 || adjust$1(this.primaryColor, { l: -10 });
|
6077 | this.pie5 = this.pie5 || adjust$1(this.secondaryColor, { l: -30 });
|
6078 | this.pie6 = this.pie6 || adjust$1(this.tertiaryColor, { l: -20 });
|
6079 | this.pie7 = this.pie7 || adjust$1(this.primaryColor, { h: 60, l: -20 });
|
6080 | this.pie8 = this.pie8 || adjust$1(this.primaryColor, { h: -60, l: -40 });
|
6081 | this.pie9 = this.pie9 || adjust$1(this.primaryColor, { h: 120, l: -40 });
|
6082 | this.pie10 = this.pie10 || adjust$1(this.primaryColor, { h: 60, l: -40 });
|
6083 | this.pie11 = this.pie11 || adjust$1(this.primaryColor, { h: -90, l: -40 });
|
6084 | this.pie12 = this.pie12 || adjust$1(this.primaryColor, { h: 120, l: -30 });
|
6085 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
6086 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
6087 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
6088 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
6089 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
6090 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
6091 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
6092 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
6093 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
6094 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
6095 | this.pieOpacity = this.pieOpacity || "0.7";
|
6096 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
6097 | this.quadrant2Fill = this.quadrant2Fill || adjust$1(this.primaryColor, { r: 5, g: 5, b: 5 });
|
6098 | this.quadrant3Fill = this.quadrant3Fill || adjust$1(this.primaryColor, { r: 10, g: 10, b: 10 });
|
6099 | this.quadrant4Fill = this.quadrant4Fill || adjust$1(this.primaryColor, { r: 15, g: 15, b: 15 });
|
6100 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
6101 | this.quadrant2TextFill = this.quadrant2TextFill || adjust$1(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
6102 | this.quadrant3TextFill = this.quadrant3TextFill || adjust$1(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
6103 | this.quadrant4TextFill = this.quadrant4TextFill || adjust$1(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
6104 | this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill);
|
6105 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
6106 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
6107 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
6108 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
6109 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
6110 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
6111 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
6112 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
6113 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
6114 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
6115 | this.relationColor = this.relationColor || this.lineColor;
|
6116 | this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;
|
6117 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
6118 | this.git0 = this.git0 || this.primaryColor;
|
6119 | this.git1 = this.git1 || this.secondaryColor;
|
6120 | this.git2 = this.git2 || this.tertiaryColor;
|
6121 | this.git3 = this.git3 || adjust$1(this.primaryColor, { h: -30 });
|
6122 | this.git4 = this.git4 || adjust$1(this.primaryColor, { h: -60 });
|
6123 | this.git5 = this.git5 || adjust$1(this.primaryColor, { h: -90 });
|
6124 | this.git6 = this.git6 || adjust$1(this.primaryColor, { h: 60 });
|
6125 | this.git7 = this.git7 || adjust$1(this.primaryColor, { h: 120 });
|
6126 | if (this.darkMode) {
|
6127 | this.git0 = lighten$1(this.git0, 25);
|
6128 | this.git1 = lighten$1(this.git1, 25);
|
6129 | this.git2 = lighten$1(this.git2, 25);
|
6130 | this.git3 = lighten$1(this.git3, 25);
|
6131 | this.git4 = lighten$1(this.git4, 25);
|
6132 | this.git5 = lighten$1(this.git5, 25);
|
6133 | this.git6 = lighten$1(this.git6, 25);
|
6134 | this.git7 = lighten$1(this.git7, 25);
|
6135 | } else {
|
6136 | this.git0 = darken$1(this.git0, 25);
|
6137 | this.git1 = darken$1(this.git1, 25);
|
6138 | this.git2 = darken$1(this.git2, 25);
|
6139 | this.git3 = darken$1(this.git3, 25);
|
6140 | this.git4 = darken$1(this.git4, 25);
|
6141 | this.git5 = darken$1(this.git5, 25);
|
6142 | this.git6 = darken$1(this.git6, 25);
|
6143 | this.git7 = darken$1(this.git7, 25);
|
6144 | }
|
6145 | this.gitInv0 = this.gitInv0 || darken$1(invert$1(this.git0), 25);
|
6146 | this.gitInv1 = this.gitInv1 || invert$1(this.git1);
|
6147 | this.gitInv2 = this.gitInv2 || invert$1(this.git2);
|
6148 | this.gitInv3 = this.gitInv3 || invert$1(this.git3);
|
6149 | this.gitInv4 = this.gitInv4 || invert$1(this.git4);
|
6150 | this.gitInv5 = this.gitInv5 || invert$1(this.git5);
|
6151 | this.gitInv6 = this.gitInv6 || invert$1(this.git6);
|
6152 | this.gitInv7 = this.gitInv7 || invert$1(this.git7);
|
6153 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor);
|
6154 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
6155 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
6156 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor);
|
6157 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
6158 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
6159 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
6160 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
6161 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
6162 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
6163 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
6164 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
6165 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
6166 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
6167 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
6168 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
6169 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
6170 | }
|
6171 | calculate(overrides) {
|
6172 | if (typeof overrides !== "object") {
|
6173 | this.updateColors();
|
6174 | return;
|
6175 | }
|
6176 | const keys = Object.keys(overrides);
|
6177 | keys.forEach((k) => {
|
6178 | this[k] = overrides[k];
|
6179 | });
|
6180 | this.updateColors();
|
6181 | keys.forEach((k) => {
|
6182 | this[k] = overrides[k];
|
6183 | });
|
6184 | }
|
6185 | };
|
6186 | const getThemeVariables$2 = (userOverrides) => {
|
6187 | const theme2 = new Theme$2();
|
6188 | theme2.calculate(userOverrides);
|
6189 | return theme2;
|
6190 | };
|
6191 | let Theme$1 = class Theme4 {
|
6192 | constructor() {
|
6193 | this.background = "#f4f4f4";
|
6194 | this.primaryColor = "#cde498";
|
6195 | this.secondaryColor = "#cdffb2";
|
6196 | this.background = "white";
|
6197 | this.mainBkg = "#cde498";
|
6198 | this.secondBkg = "#cdffb2";
|
6199 | this.lineColor = "green";
|
6200 | this.border1 = "#13540c";
|
6201 | this.border2 = "#6eaa49";
|
6202 | this.arrowheadColor = "green";
|
6203 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
6204 | this.fontSize = "16px";
|
6205 | this.tertiaryColor = lighten$1("#cde498", 10);
|
6206 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
6207 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
6208 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
6209 | this.primaryTextColor = invert$1(this.primaryColor);
|
6210 | this.secondaryTextColor = invert$1(this.secondaryColor);
|
6211 | this.tertiaryTextColor = invert$1(this.primaryColor);
|
6212 | this.lineColor = invert$1(this.background);
|
6213 | this.textColor = invert$1(this.background);
|
6214 | this.THEME_COLOR_LIMIT = 12;
|
6215 | this.nodeBkg = "calculated";
|
6216 | this.nodeBorder = "calculated";
|
6217 | this.clusterBkg = "calculated";
|
6218 | this.clusterBorder = "calculated";
|
6219 | this.defaultLinkColor = "calculated";
|
6220 | this.titleColor = "#333";
|
6221 | this.edgeLabelBackground = "#e8e8e8";
|
6222 | this.actorBorder = "calculated";
|
6223 | this.actorBkg = "calculated";
|
6224 | this.actorTextColor = "black";
|
6225 | this.actorLineColor = "grey";
|
6226 | this.signalColor = "#333";
|
6227 | this.signalTextColor = "#333";
|
6228 | this.labelBoxBkgColor = "calculated";
|
6229 | this.labelBoxBorderColor = "#326932";
|
6230 | this.labelTextColor = "calculated";
|
6231 | this.loopTextColor = "calculated";
|
6232 | this.noteBorderColor = "calculated";
|
6233 | this.noteBkgColor = "#fff5ad";
|
6234 | this.noteTextColor = "calculated";
|
6235 | this.activationBorderColor = "#666";
|
6236 | this.activationBkgColor = "#f4f4f4";
|
6237 | this.sequenceNumberColor = "white";
|
6238 | this.sectionBkgColor = "#6eaa49";
|
6239 | this.altSectionBkgColor = "white";
|
6240 | this.sectionBkgColor2 = "#6eaa49";
|
6241 | this.excludeBkgColor = "#eeeeee";
|
6242 | this.taskBorderColor = "calculated";
|
6243 | this.taskBkgColor = "#487e3a";
|
6244 | this.taskTextLightColor = "white";
|
6245 | this.taskTextColor = "calculated";
|
6246 | this.taskTextDarkColor = "black";
|
6247 | this.taskTextOutsideColor = "calculated";
|
6248 | this.taskTextClickableColor = "#003163";
|
6249 | this.activeTaskBorderColor = "calculated";
|
6250 | this.activeTaskBkgColor = "calculated";
|
6251 | this.gridColor = "lightgrey";
|
6252 | this.doneTaskBkgColor = "lightgrey";
|
6253 | this.doneTaskBorderColor = "grey";
|
6254 | this.critBorderColor = "#ff8888";
|
6255 | this.critBkgColor = "red";
|
6256 | this.todayLineColor = "red";
|
6257 | this.personBorder = this.primaryBorderColor;
|
6258 | this.personBkg = this.mainBkg;
|
6259 | this.labelColor = "black";
|
6260 | this.errorBkgColor = "#552222";
|
6261 | this.errorTextColor = "#552222";
|
6262 | }
|
6263 | updateColors() {
|
6264 | this.actorBorder = darken$1(this.mainBkg, 20);
|
6265 | this.actorBkg = this.mainBkg;
|
6266 | this.labelBoxBkgColor = this.actorBkg;
|
6267 | this.labelTextColor = this.actorTextColor;
|
6268 | this.loopTextColor = this.actorTextColor;
|
6269 | this.noteBorderColor = this.border2;
|
6270 | this.noteTextColor = this.actorTextColor;
|
6271 | this.cScale0 = this.cScale0 || this.primaryColor;
|
6272 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
6273 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
6274 | this.cScale3 = this.cScale3 || adjust$1(this.primaryColor, { h: 30 });
|
6275 | this.cScale4 = this.cScale4 || adjust$1(this.primaryColor, { h: 60 });
|
6276 | this.cScale5 = this.cScale5 || adjust$1(this.primaryColor, { h: 90 });
|
6277 | this.cScale6 = this.cScale6 || adjust$1(this.primaryColor, { h: 120 });
|
6278 | this.cScale7 = this.cScale7 || adjust$1(this.primaryColor, { h: 150 });
|
6279 | this.cScale8 = this.cScale8 || adjust$1(this.primaryColor, { h: 210 });
|
6280 | this.cScale9 = this.cScale9 || adjust$1(this.primaryColor, { h: 270 });
|
6281 | this.cScale10 = this.cScale10 || adjust$1(this.primaryColor, { h: 300 });
|
6282 | this.cScale11 = this.cScale11 || adjust$1(this.primaryColor, { h: 330 });
|
6283 | this["cScalePeer1"] = this["cScalePeer1"] || darken$1(this.secondaryColor, 45);
|
6284 | this["cScalePeer2"] = this["cScalePeer2"] || darken$1(this.tertiaryColor, 40);
|
6285 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6286 | this["cScale" + i] = darken$1(this["cScale" + i], 10);
|
6287 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken$1(this["cScale" + i], 25);
|
6288 | }
|
6289 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6290 | this["cScaleInv" + i] = this["cScaleInv" + i] || adjust$1(this["cScale" + i], { h: 180 });
|
6291 | }
|
6292 | this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
|
6293 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6294 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
6295 | }
|
6296 | for (let i = 0; i < 5; i++) {
|
6297 | this["surface" + i] = this["surface" + i] || adjust$1(this.mainBkg, { h: 30, s: -30, l: -(5 + i * 5) });
|
6298 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust$1(this.mainBkg, { h: 30, s: -30, l: -(8 + i * 5) });
|
6299 | }
|
6300 | this.nodeBkg = this.mainBkg;
|
6301 | this.nodeBorder = this.border1;
|
6302 | this.clusterBkg = this.secondBkg;
|
6303 | this.clusterBorder = this.border2;
|
6304 | this.defaultLinkColor = this.lineColor;
|
6305 | this.taskBorderColor = this.border1;
|
6306 | this.taskTextColor = this.taskTextLightColor;
|
6307 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
6308 | this.activeTaskBorderColor = this.taskBorderColor;
|
6309 | this.activeTaskBkgColor = this.mainBkg;
|
6310 | this.transitionColor = this.transitionColor || this.lineColor;
|
6311 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
6312 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
6313 | this.stateBkg = this.stateBkg || this.mainBkg;
|
6314 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
6315 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
6316 | this.altBackground = this.altBackground || "#f0f0f0";
|
6317 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
6318 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
6319 | this.innerEndBackground = this.primaryBorderColor;
|
6320 | this.specialStateColor = this.lineColor;
|
6321 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
6322 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
6323 | this.transitionColor = this.transitionColor || this.lineColor;
|
6324 | this.classText = this.primaryTextColor;
|
6325 | this.fillType0 = this.primaryColor;
|
6326 | this.fillType1 = this.secondaryColor;
|
6327 | this.fillType2 = adjust$1(this.primaryColor, { h: 64 });
|
6328 | this.fillType3 = adjust$1(this.secondaryColor, { h: 64 });
|
6329 | this.fillType4 = adjust$1(this.primaryColor, { h: -64 });
|
6330 | this.fillType5 = adjust$1(this.secondaryColor, { h: -64 });
|
6331 | this.fillType6 = adjust$1(this.primaryColor, { h: 128 });
|
6332 | this.fillType7 = adjust$1(this.secondaryColor, { h: 128 });
|
6333 | this.pie1 = this.pie1 || this.primaryColor;
|
6334 | this.pie2 = this.pie2 || this.secondaryColor;
|
6335 | this.pie3 = this.pie3 || this.tertiaryColor;
|
6336 | this.pie4 = this.pie4 || adjust$1(this.primaryColor, { l: -30 });
|
6337 | this.pie5 = this.pie5 || adjust$1(this.secondaryColor, { l: -30 });
|
6338 | this.pie6 = this.pie6 || adjust$1(this.tertiaryColor, { h: 40, l: -40 });
|
6339 | this.pie7 = this.pie7 || adjust$1(this.primaryColor, { h: 60, l: -10 });
|
6340 | this.pie8 = this.pie8 || adjust$1(this.primaryColor, { h: -60, l: -10 });
|
6341 | this.pie9 = this.pie9 || adjust$1(this.primaryColor, { h: 120, l: 0 });
|
6342 | this.pie10 = this.pie10 || adjust$1(this.primaryColor, { h: 60, l: -50 });
|
6343 | this.pie11 = this.pie11 || adjust$1(this.primaryColor, { h: -60, l: -50 });
|
6344 | this.pie12 = this.pie12 || adjust$1(this.primaryColor, { h: 120, l: -50 });
|
6345 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
6346 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
6347 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
6348 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
6349 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
6350 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
6351 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
6352 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
6353 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
6354 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
6355 | this.pieOpacity = this.pieOpacity || "0.7";
|
6356 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
6357 | this.quadrant2Fill = this.quadrant2Fill || adjust$1(this.primaryColor, { r: 5, g: 5, b: 5 });
|
6358 | this.quadrant3Fill = this.quadrant3Fill || adjust$1(this.primaryColor, { r: 10, g: 10, b: 10 });
|
6359 | this.quadrant4Fill = this.quadrant4Fill || adjust$1(this.primaryColor, { r: 15, g: 15, b: 15 });
|
6360 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
6361 | this.quadrant2TextFill = this.quadrant2TextFill || adjust$1(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
6362 | this.quadrant3TextFill = this.quadrant3TextFill || adjust$1(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
6363 | this.quadrant4TextFill = this.quadrant4TextFill || adjust$1(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
6364 | this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill);
|
6365 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
6366 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
6367 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
6368 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
6369 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
6370 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
6371 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
6372 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
6373 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
6374 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
6375 | this.relationColor = this.relationColor || this.lineColor;
|
6376 | this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
|
6377 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
6378 | this.git0 = this.git0 || this.primaryColor;
|
6379 | this.git1 = this.git1 || this.secondaryColor;
|
6380 | this.git2 = this.git2 || this.tertiaryColor;
|
6381 | this.git3 = this.git3 || adjust$1(this.primaryColor, { h: -30 });
|
6382 | this.git4 = this.git4 || adjust$1(this.primaryColor, { h: -60 });
|
6383 | this.git5 = this.git5 || adjust$1(this.primaryColor, { h: -90 });
|
6384 | this.git6 = this.git6 || adjust$1(this.primaryColor, { h: 60 });
|
6385 | this.git7 = this.git7 || adjust$1(this.primaryColor, { h: 120 });
|
6386 | if (this.darkMode) {
|
6387 | this.git0 = lighten$1(this.git0, 25);
|
6388 | this.git1 = lighten$1(this.git1, 25);
|
6389 | this.git2 = lighten$1(this.git2, 25);
|
6390 | this.git3 = lighten$1(this.git3, 25);
|
6391 | this.git4 = lighten$1(this.git4, 25);
|
6392 | this.git5 = lighten$1(this.git5, 25);
|
6393 | this.git6 = lighten$1(this.git6, 25);
|
6394 | this.git7 = lighten$1(this.git7, 25);
|
6395 | } else {
|
6396 | this.git0 = darken$1(this.git0, 25);
|
6397 | this.git1 = darken$1(this.git1, 25);
|
6398 | this.git2 = darken$1(this.git2, 25);
|
6399 | this.git3 = darken$1(this.git3, 25);
|
6400 | this.git4 = darken$1(this.git4, 25);
|
6401 | this.git5 = darken$1(this.git5, 25);
|
6402 | this.git6 = darken$1(this.git6, 25);
|
6403 | this.git7 = darken$1(this.git7, 25);
|
6404 | }
|
6405 | this.gitInv0 = this.gitInv0 || invert$1(this.git0);
|
6406 | this.gitInv1 = this.gitInv1 || invert$1(this.git1);
|
6407 | this.gitInv2 = this.gitInv2 || invert$1(this.git2);
|
6408 | this.gitInv3 = this.gitInv3 || invert$1(this.git3);
|
6409 | this.gitInv4 = this.gitInv4 || invert$1(this.git4);
|
6410 | this.gitInv5 = this.gitInv5 || invert$1(this.git5);
|
6411 | this.gitInv6 = this.gitInv6 || invert$1(this.git6);
|
6412 | this.gitInv7 = this.gitInv7 || invert$1(this.git7);
|
6413 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor);
|
6414 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
6415 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
6416 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor);
|
6417 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
6418 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
6419 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
6420 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
6421 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
6422 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
6423 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
6424 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
6425 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
6426 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
6427 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
6428 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
6429 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
6430 | }
|
6431 | calculate(overrides) {
|
6432 | if (typeof overrides !== "object") {
|
6433 | this.updateColors();
|
6434 | return;
|
6435 | }
|
6436 | const keys = Object.keys(overrides);
|
6437 | keys.forEach((k) => {
|
6438 | this[k] = overrides[k];
|
6439 | });
|
6440 | this.updateColors();
|
6441 | keys.forEach((k) => {
|
6442 | this[k] = overrides[k];
|
6443 | });
|
6444 | }
|
6445 | };
|
6446 | const getThemeVariables$1 = (userOverrides) => {
|
6447 | const theme2 = new Theme$1();
|
6448 | theme2.calculate(userOverrides);
|
6449 | return theme2;
|
6450 | };
|
6451 | class Theme5 {
|
6452 | constructor() {
|
6453 | this.primaryColor = "#eee";
|
6454 | this.contrast = "#707070";
|
6455 | this.secondaryColor = lighten$1(this.contrast, 55);
|
6456 | this.background = "#ffffff";
|
6457 | this.tertiaryColor = adjust$1(this.primaryColor, { h: -160 });
|
6458 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
6459 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
6460 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
6461 | this.primaryTextColor = invert$1(this.primaryColor);
|
6462 | this.secondaryTextColor = invert$1(this.secondaryColor);
|
6463 | this.tertiaryTextColor = invert$1(this.tertiaryColor);
|
6464 | this.lineColor = invert$1(this.background);
|
6465 | this.textColor = invert$1(this.background);
|
6466 | this.mainBkg = "#eee";
|
6467 | this.secondBkg = "calculated";
|
6468 | this.lineColor = "#666";
|
6469 | this.border1 = "#999";
|
6470 | this.border2 = "calculated";
|
6471 | this.note = "#ffa";
|
6472 | this.text = "#333";
|
6473 | this.critical = "#d42";
|
6474 | this.done = "#bbb";
|
6475 | this.arrowheadColor = "#333333";
|
6476 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
6477 | this.fontSize = "16px";
|
6478 | this.THEME_COLOR_LIMIT = 12;
|
6479 | this.nodeBkg = "calculated";
|
6480 | this.nodeBorder = "calculated";
|
6481 | this.clusterBkg = "calculated";
|
6482 | this.clusterBorder = "calculated";
|
6483 | this.defaultLinkColor = "calculated";
|
6484 | this.titleColor = "calculated";
|
6485 | this.edgeLabelBackground = "white";
|
6486 | this.actorBorder = "calculated";
|
6487 | this.actorBkg = "calculated";
|
6488 | this.actorTextColor = "calculated";
|
6489 | this.actorLineColor = "calculated";
|
6490 | this.signalColor = "calculated";
|
6491 | this.signalTextColor = "calculated";
|
6492 | this.labelBoxBkgColor = "calculated";
|
6493 | this.labelBoxBorderColor = "calculated";
|
6494 | this.labelTextColor = "calculated";
|
6495 | this.loopTextColor = "calculated";
|
6496 | this.noteBorderColor = "calculated";
|
6497 | this.noteBkgColor = "calculated";
|
6498 | this.noteTextColor = "calculated";
|
6499 | this.activationBorderColor = "#666";
|
6500 | this.activationBkgColor = "#f4f4f4";
|
6501 | this.sequenceNumberColor = "white";
|
6502 | this.sectionBkgColor = "calculated";
|
6503 | this.altSectionBkgColor = "white";
|
6504 | this.sectionBkgColor2 = "calculated";
|
6505 | this.excludeBkgColor = "#eeeeee";
|
6506 | this.taskBorderColor = "calculated";
|
6507 | this.taskBkgColor = "calculated";
|
6508 | this.taskTextLightColor = "white";
|
6509 | this.taskTextColor = "calculated";
|
6510 | this.taskTextDarkColor = "calculated";
|
6511 | this.taskTextOutsideColor = "calculated";
|
6512 | this.taskTextClickableColor = "#003163";
|
6513 | this.activeTaskBorderColor = "calculated";
|
6514 | this.activeTaskBkgColor = "calculated";
|
6515 | this.gridColor = "calculated";
|
6516 | this.doneTaskBkgColor = "calculated";
|
6517 | this.doneTaskBorderColor = "calculated";
|
6518 | this.critBkgColor = "calculated";
|
6519 | this.critBorderColor = "calculated";
|
6520 | this.todayLineColor = "calculated";
|
6521 | this.personBorder = this.primaryBorderColor;
|
6522 | this.personBkg = this.mainBkg;
|
6523 | this.labelColor = "black";
|
6524 | this.errorBkgColor = "#552222";
|
6525 | this.errorTextColor = "#552222";
|
6526 | }
|
6527 | updateColors() {
|
6528 | this.secondBkg = lighten$1(this.contrast, 55);
|
6529 | this.border2 = this.contrast;
|
6530 | this.actorBorder = lighten$1(this.border1, 23);
|
6531 | this.actorBkg = this.mainBkg;
|
6532 | this.actorTextColor = this.text;
|
6533 | this.actorLineColor = this.lineColor;
|
6534 | this.signalColor = this.text;
|
6535 | this.signalTextColor = this.text;
|
6536 | this.labelBoxBkgColor = this.actorBkg;
|
6537 | this.labelBoxBorderColor = this.actorBorder;
|
6538 | this.labelTextColor = this.text;
|
6539 | this.loopTextColor = this.text;
|
6540 | this.noteBorderColor = "#999";
|
6541 | this.noteBkgColor = "#666";
|
6542 | this.noteTextColor = "#fff";
|
6543 | this.cScale0 = this.cScale0 || "#555";
|
6544 | this.cScale1 = this.cScale1 || "#F4F4F4";
|
6545 | this.cScale2 = this.cScale2 || "#555";
|
6546 | this.cScale3 = this.cScale3 || "#BBB";
|
6547 | this.cScale4 = this.cScale4 || "#777";
|
6548 | this.cScale5 = this.cScale5 || "#999";
|
6549 | this.cScale6 = this.cScale6 || "#DDD";
|
6550 | this.cScale7 = this.cScale7 || "#FFF";
|
6551 | this.cScale8 = this.cScale8 || "#DDD";
|
6552 | this.cScale9 = this.cScale9 || "#BBB";
|
6553 | this.cScale10 = this.cScale10 || "#999";
|
6554 | this.cScale11 = this.cScale11 || "#777";
|
6555 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6556 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert$1(this["cScale" + i]);
|
6557 | }
|
6558 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6559 | if (this.darkMode) {
|
6560 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten$1(this["cScale" + i], 10);
|
6561 | } else {
|
6562 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken$1(this["cScale" + i], 10);
|
6563 | }
|
6564 | }
|
6565 | this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
6566 | this["cScaleLabel0"] = this["cScaleLabel0"] || this.cScale1;
|
6567 | this["cScaleLabel2"] = this["cScaleLabel2"] || this.cScale1;
|
6568 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6569 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
6570 | }
|
6571 | for (let i = 0; i < 5; i++) {
|
6572 | this["surface" + i] = this["surface" + i] || adjust$1(this.mainBkg, { l: -(5 + i * 5) });
|
6573 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust$1(this.mainBkg, { l: -(8 + i * 5) });
|
6574 | }
|
6575 | this.nodeBkg = this.mainBkg;
|
6576 | this.nodeBorder = this.border1;
|
6577 | this.clusterBkg = this.secondBkg;
|
6578 | this.clusterBorder = this.border2;
|
6579 | this.defaultLinkColor = this.lineColor;
|
6580 | this.titleColor = this.text;
|
6581 | this.sectionBkgColor = lighten$1(this.contrast, 30);
|
6582 | this.sectionBkgColor2 = lighten$1(this.contrast, 30);
|
6583 | this.taskBorderColor = darken$1(this.contrast, 10);
|
6584 | this.taskBkgColor = this.contrast;
|
6585 | this.taskTextColor = this.taskTextLightColor;
|
6586 | this.taskTextDarkColor = this.text;
|
6587 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
6588 | this.activeTaskBorderColor = this.taskBorderColor;
|
6589 | this.activeTaskBkgColor = this.mainBkg;
|
6590 | this.gridColor = lighten$1(this.border1, 30);
|
6591 | this.doneTaskBkgColor = this.done;
|
6592 | this.doneTaskBorderColor = this.lineColor;
|
6593 | this.critBkgColor = this.critical;
|
6594 | this.critBorderColor = darken$1(this.critBkgColor, 10);
|
6595 | this.todayLineColor = this.critBkgColor;
|
6596 | this.transitionColor = this.transitionColor || "#000";
|
6597 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
6598 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
6599 | this.stateBkg = this.stateBkg || this.mainBkg;
|
6600 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
6601 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
6602 | this.altBackground = this.altBackground || "#f4f4f4";
|
6603 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
6604 | this.stateBorder = this.stateBorder || "#000";
|
6605 | this.innerEndBackground = this.primaryBorderColor;
|
6606 | this.specialStateColor = "#222";
|
6607 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
6608 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
6609 | this.classText = this.primaryTextColor;
|
6610 | this.fillType0 = this.primaryColor;
|
6611 | this.fillType1 = this.secondaryColor;
|
6612 | this.fillType2 = adjust$1(this.primaryColor, { h: 64 });
|
6613 | this.fillType3 = adjust$1(this.secondaryColor, { h: 64 });
|
6614 | this.fillType4 = adjust$1(this.primaryColor, { h: -64 });
|
6615 | this.fillType5 = adjust$1(this.secondaryColor, { h: -64 });
|
6616 | this.fillType6 = adjust$1(this.primaryColor, { h: 128 });
|
6617 | this.fillType7 = adjust$1(this.secondaryColor, { h: 128 });
|
6618 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
6619 | this["pie" + i] = this["cScale" + i];
|
6620 | }
|
6621 | this.pie12 = this.pie0;
|
6622 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
6623 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
6624 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
6625 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
6626 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
6627 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
6628 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
6629 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
6630 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
6631 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
6632 | this.pieOpacity = this.pieOpacity || "0.7";
|
6633 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
6634 | this.quadrant2Fill = this.quadrant2Fill || adjust$1(this.primaryColor, { r: 5, g: 5, b: 5 });
|
6635 | this.quadrant3Fill = this.quadrant3Fill || adjust$1(this.primaryColor, { r: 10, g: 10, b: 10 });
|
6636 | this.quadrant4Fill = this.quadrant4Fill || adjust$1(this.primaryColor, { r: 15, g: 15, b: 15 });
|
6637 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
6638 | this.quadrant2TextFill = this.quadrant2TextFill || adjust$1(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
6639 | this.quadrant3TextFill = this.quadrant3TextFill || adjust$1(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
6640 | this.quadrant4TextFill = this.quadrant4TextFill || adjust$1(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
6641 | this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill);
|
6642 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
6643 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
6644 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
6645 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
6646 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
6647 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
6648 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
6649 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
6650 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
6651 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
6652 | this.relationColor = this.relationColor || this.lineColor;
|
6653 | this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
|
6654 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
6655 | this.git0 = darken$1(this.pie1, 25) || this.primaryColor;
|
6656 | this.git1 = this.pie2 || this.secondaryColor;
|
6657 | this.git2 = this.pie3 || this.tertiaryColor;
|
6658 | this.git3 = this.pie4 || adjust$1(this.primaryColor, { h: -30 });
|
6659 | this.git4 = this.pie5 || adjust$1(this.primaryColor, { h: -60 });
|
6660 | this.git5 = this.pie6 || adjust$1(this.primaryColor, { h: -90 });
|
6661 | this.git6 = this.pie7 || adjust$1(this.primaryColor, { h: 60 });
|
6662 | this.git7 = this.pie8 || adjust$1(this.primaryColor, { h: 120 });
|
6663 | this.gitInv0 = this.gitInv0 || invert$1(this.git0);
|
6664 | this.gitInv1 = this.gitInv1 || invert$1(this.git1);
|
6665 | this.gitInv2 = this.gitInv2 || invert$1(this.git2);
|
6666 | this.gitInv3 = this.gitInv3 || invert$1(this.git3);
|
6667 | this.gitInv4 = this.gitInv4 || invert$1(this.git4);
|
6668 | this.gitInv5 = this.gitInv5 || invert$1(this.git5);
|
6669 | this.gitInv6 = this.gitInv6 || invert$1(this.git6);
|
6670 | this.gitInv7 = this.gitInv7 || invert$1(this.git7);
|
6671 | this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
6672 | this.gitBranchLabel0 = this.branchLabelColor;
|
6673 | this.gitBranchLabel1 = "white";
|
6674 | this.gitBranchLabel2 = this.branchLabelColor;
|
6675 | this.gitBranchLabel3 = "white";
|
6676 | this.gitBranchLabel4 = this.branchLabelColor;
|
6677 | this.gitBranchLabel5 = this.branchLabelColor;
|
6678 | this.gitBranchLabel6 = this.branchLabelColor;
|
6679 | this.gitBranchLabel7 = this.branchLabelColor;
|
6680 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
6681 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
6682 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
6683 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
6684 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
6685 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
6686 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
6687 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
6688 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
6689 | }
|
6690 | calculate(overrides) {
|
6691 | if (typeof overrides !== "object") {
|
6692 | this.updateColors();
|
6693 | return;
|
6694 | }
|
6695 | const keys = Object.keys(overrides);
|
6696 | keys.forEach((k) => {
|
6697 | this[k] = overrides[k];
|
6698 | });
|
6699 | this.updateColors();
|
6700 | keys.forEach((k) => {
|
6701 | this[k] = overrides[k];
|
6702 | });
|
6703 | }
|
6704 | }
|
6705 | const getThemeVariables = (userOverrides) => {
|
6706 | const theme2 = new Theme5();
|
6707 | theme2.calculate(userOverrides);
|
6708 | return theme2;
|
6709 | };
|
6710 | const theme = {
|
6711 | base: {
|
6712 | getThemeVariables: getThemeVariables$4
|
6713 | },
|
6714 | dark: {
|
6715 | getThemeVariables: getThemeVariables$3
|
6716 | },
|
6717 | default: {
|
6718 | getThemeVariables: getThemeVariables$2
|
6719 | },
|
6720 | forest: {
|
6721 | getThemeVariables: getThemeVariables$1
|
6722 | },
|
6723 | neutral: {
|
6724 | getThemeVariables
|
6725 | }
|
6726 | };
|
6727 | const config = {
|
6728 | |
6729 |
|
6730 |
|
6731 |
|
6732 |
|
6733 |
|
6734 |
|
6735 |
|
6736 |
|
6737 |
|
6738 |
|
6739 |
|
6740 |
|
6741 |
|
6742 |
|
6743 |
|
6744 |
|
6745 |
|
6746 | theme: "default",
|
6747 | themeVariables: theme["default"].getThemeVariables(),
|
6748 | themeCSS: void 0,
|
6749 |
|
6750 | maxTextSize: 5e4,
|
6751 | darkMode: false,
|
6752 | |
6753 |
|
6754 |
|
6755 |
|
6756 |
|
6757 |
|
6758 |
|
6759 | fontFamily: '"trebuchet ms", verdana, arial, sans-serif;',
|
6760 | |
6761 |
|
6762 |
|
6763 |
|
6764 |
|
6765 |
|
6766 |
|
6767 |
|
6768 |
|
6769 |
|
6770 |
|
6771 |
|
6772 |
|
6773 |
|
6774 | logLevel: 5,
|
6775 | |
6776 |
|
6777 |
|
6778 |
|
6779 |
|
6780 |
|
6781 |
|
6782 |
|
6783 |
|
6784 |
|
6785 |
|
6786 |
|
6787 |
|
6788 |
|
6789 |
|
6790 | securityLevel: "strict",
|
6791 | |
6792 |
|
6793 |
|
6794 |
|
6795 |
|
6796 |
|
6797 |
|
6798 | startOnLoad: true,
|
6799 | |
6800 |
|
6801 |
|
6802 |
|
6803 |
|
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 |
|
6809 |
|
6810 | arrowMarkerAbsolute: false,
|
6811 | |
6812 |
|
6813 |
|
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 |
|
6819 |
|
6820 |
|
6821 | secure: ["secure", "securityLevel", "startOnLoad", "maxTextSize"],
|
6822 | |
6823 |
|
6824 |
|
6825 |
|
6826 |
|
6827 |
|
6828 |
|
6829 |
|
6830 |
|
6831 |
|
6832 |
|
6833 |
|
6834 | deterministicIds: false,
|
6835 | |
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 | deterministicIDSeed: void 0,
|
6841 |
|
6842 | flowchart: {
|
6843 | |
6844 |
|
6845 |
|
6846 |
|
6847 |
|
6848 |
|
6849 |
|
6850 |
|
6851 |
|
6852 | titleTopMargin: 25,
|
6853 | |
6854 |
|
6855 |
|
6856 |
|
6857 |
|
6858 |
|
6859 |
|
6860 |
|
6861 |
|
6862 |
|
6863 |
|
6864 |
|
6865 | diagramPadding: 8,
|
6866 | |
6867 |
|
6868 |
|
6869 |
|
6870 |
|
6871 |
|
6872 |
|
6873 | htmlLabels: true,
|
6874 | |
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 |
|
6884 |
|
6885 |
|
6886 | nodeSpacing: 50,
|
6887 | |
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 |
|
6896 |
|
6897 |
|
6898 |
|
6899 | rankSpacing: 50,
|
6900 | |
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 | curve: "basis",
|
6910 |
|
6911 |
|
6912 | padding: 15,
|
6913 | |
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 |
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 | useMaxWidth: true,
|
6926 | |
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 |
|
6933 |
|
6934 |
|
6935 |
|
6936 |
|
6937 |
|
6938 |
|
6939 | defaultRenderer: "dagre-wrapper",
|
6940 | |
6941 |
|
6942 |
|
6943 |
|
6944 |
|
6945 |
|
6946 |
|
6947 |
|
6948 |
|
6949 |
|
6950 |
|
6951 | wrappingWidth: 200
|
6952 | },
|
6953 |
|
6954 | sequence: {
|
6955 | hideUnusedParticipants: false,
|
6956 | |
6957 |
|
6958 |
|
6959 |
|
6960 |
|
6961 |
|
6962 |
|
6963 | activationWidth: 10,
|
6964 | |
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 |
|
6970 |
|
6971 | diagramMarginX: 50,
|
6972 | |
6973 |
|
6974 |
|
6975 |
|
6976 |
|
6977 |
|
6978 |
|
6979 | diagramMarginY: 10,
|
6980 | |
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 | actorMargin: 50,
|
6988 | |
6989 |
|
6990 |
|
6991 |
|
6992 |
|
6993 |
|
6994 |
|
6995 | width: 150,
|
6996 | |
6997 |
|
6998 |
|
6999 |
|
7000 |
|
7001 |
|
7002 |
|
7003 | height: 65,
|
7004 | |
7005 |
|
7006 |
|
7007 |
|
7008 |
|
7009 |
|
7010 |
|
7011 | boxMargin: 10,
|
7012 | |
7013 |
|
7014 |
|
7015 |
|
7016 |
|
7017 |
|
7018 |
|
7019 | boxTextMargin: 5,
|
7020 | |
7021 |
|
7022 |
|
7023 |
|
7024 |
|
7025 |
|
7026 |
|
7027 | noteMargin: 10,
|
7028 | |
7029 |
|
7030 |
|
7031 |
|
7032 |
|
7033 |
|
7034 |
|
7035 | messageMargin: 35,
|
7036 | |
7037 |
|
7038 |
|
7039 |
|
7040 |
|
7041 |
|
7042 |
|
7043 | messageAlign: "center",
|
7044 | |
7045 |
|
7046 |
|
7047 |
|
7048 |
|
7049 |
|
7050 |
|
7051 | mirrorActors: true,
|
7052 | |
7053 |
|
7054 |
|
7055 |
|
7056 |
|
7057 |
|
7058 |
|
7059 |
|
7060 |
|
7061 | forceMenus: false,
|
7062 | |
7063 |
|
7064 |
|
7065 |
|
7066 |
|
7067 |
|
7068 |
|
7069 |
|
7070 |
|
7071 |
|
7072 |
|
7073 | bottomMarginAdj: 1,
|
7074 | |
7075 |
|
7076 |
|
7077 |
|
7078 |
|
7079 |
|
7080 |
|
7081 |
|
7082 |
|
7083 |
|
7084 | useMaxWidth: true,
|
7085 | |
7086 |
|
7087 |
|
7088 |
|
7089 |
|
7090 |
|
7091 |
|
7092 |
|
7093 |
|
7094 |
|
7095 |
|
7096 |
|
7097 | rightAngles: false,
|
7098 | |
7099 |
|
7100 |
|
7101 |
|
7102 |
|
7103 |
|
7104 |
|
7105 | showSequenceNumbers: false,
|
7106 | |
7107 |
|
7108 |
|
7109 |
|
7110 |
|
7111 |
|
7112 |
|
7113 | actorFontSize: 14,
|
7114 | |
7115 |
|
7116 |
|
7117 |
|
7118 |
|
7119 |
|
7120 |
|
7121 | actorFontFamily: '"Open Sans", sans-serif',
|
7122 | |
7123 |
|
7124 |
|
7125 |
|
7126 |
|
7127 | actorFontWeight: 400,
|
7128 | |
7129 |
|
7130 |
|
7131 |
|
7132 |
|
7133 |
|
7134 |
|
7135 | noteFontSize: 14,
|
7136 | |
7137 |
|
7138 |
|
7139 |
|
7140 |
|
7141 |
|
7142 |
|
7143 | noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
7144 | |
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 | noteFontWeight: 400,
|
7150 | |
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 |
|
7157 | noteAlign: "center",
|
7158 | |
7159 |
|
7160 |
|
7161 |
|
7162 |
|
7163 |
|
7164 |
|
7165 | messageFontSize: 16,
|
7166 | |
7167 |
|
7168 |
|
7169 |
|
7170 |
|
7171 |
|
7172 |
|
7173 | messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
7174 | |
7175 |
|
7176 |
|
7177 |
|
7178 |
|
7179 | messageFontWeight: 400,
|
7180 | |
7181 |
|
7182 |
|
7183 |
|
7184 |
|
7185 | wrap: false,
|
7186 | |
7187 |
|
7188 |
|
7189 |
|
7190 |
|
7191 | wrapPadding: 10,
|
7192 | |
7193 |
|
7194 |
|
7195 |
|
7196 |
|
7197 | labelBoxWidth: 50,
|
7198 | |
7199 |
|
7200 |
|
7201 |
|
7202 |
|
7203 | labelBoxHeight: 20,
|
7204 | messageFont: function() {
|
7205 | return {
|
7206 | fontFamily: this.messageFontFamily,
|
7207 | fontSize: this.messageFontSize,
|
7208 | fontWeight: this.messageFontWeight
|
7209 | };
|
7210 | },
|
7211 | noteFont: function() {
|
7212 | return {
|
7213 | fontFamily: this.noteFontFamily,
|
7214 | fontSize: this.noteFontSize,
|
7215 | fontWeight: this.noteFontWeight
|
7216 | };
|
7217 | },
|
7218 | actorFont: function() {
|
7219 | return {
|
7220 | fontFamily: this.actorFontFamily,
|
7221 | fontSize: this.actorFontSize,
|
7222 | fontWeight: this.actorFontWeight
|
7223 | };
|
7224 | }
|
7225 | },
|
7226 |
|
7227 | gantt: {
|
7228 | |
7229 |
|
7230 |
|
7231 |
|
7232 |
|
7233 |
|
7234 |
|
7235 |
|
7236 |
|
7237 | titleTopMargin: 25,
|
7238 | |
7239 |
|
7240 |
|
7241 |
|
7242 |
|
7243 |
|
7244 |
|
7245 | barHeight: 20,
|
7246 | |
7247 |
|
7248 |
|
7249 |
|
7250 |
|
7251 |
|
7252 |
|
7253 | barGap: 4,
|
7254 | |
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 | topPadding: 50,
|
7262 | |
7263 |
|
7264 |
|
7265 |
|
7266 |
|
7267 |
|
7268 |
|
7269 | rightPadding: 75,
|
7270 | |
7271 |
|
7272 |
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 | leftPadding: 75,
|
7278 | |
7279 |
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 | gridLineStartPadding: 35,
|
7286 | |
7287 |
|
7288 |
|
7289 |
|
7290 |
|
7291 |
|
7292 |
|
7293 | fontSize: 11,
|
7294 | |
7295 |
|
7296 |
|
7297 |
|
7298 |
|
7299 |
|
7300 |
|
7301 | sectionFontSize: 11,
|
7302 | |
7303 |
|
7304 |
|
7305 |
|
7306 |
|
7307 |
|
7308 |
|
7309 | numberSectionStyles: 4,
|
7310 | |
7311 |
|
7312 |
|
7313 |
|
7314 |
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 | displayMode: "",
|
7320 | |
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 | axisFormat: "%Y-%m-%d",
|
7332 | |
7333 |
|
7334 |
|
7335 |
|
7336 |
|
7337 |
|
7338 |
|
7339 |
|
7340 |
|
7341 |
|
7342 |
|
7343 | tickInterval: void 0,
|
7344 | |
7345 |
|
7346 |
|
7347 |
|
7348 |
|
7349 |
|
7350 |
|
7351 |
|
7352 |
|
7353 |
|
7354 |
|
7355 |
|
7356 | useMaxWidth: true,
|
7357 | |
7358 |
|
7359 |
|
7360 |
|
7361 |
|
7362 |
|
7363 |
|
7364 |
|
7365 |
|
7366 | topAxis: false,
|
7367 | useWidth: void 0
|
7368 | },
|
7369 |
|
7370 | journey: {
|
7371 | |
7372 |
|
7373 |
|
7374 |
|
7375 |
|
7376 |
|
7377 |
|
7378 | diagramMarginX: 50,
|
7379 | |
7380 |
|
7381 |
|
7382 |
|
7383 |
|
7384 |
|
7385 |
|
7386 | diagramMarginY: 10,
|
7387 | |
7388 |
|
7389 |
|
7390 |
|
7391 |
|
7392 |
|
7393 |
|
7394 | leftMargin: 150,
|
7395 | |
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 | width: 150,
|
7403 | |
7404 |
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 | height: 50,
|
7411 | |
7412 |
|
7413 |
|
7414 |
|
7415 |
|
7416 |
|
7417 |
|
7418 | boxMargin: 10,
|
7419 | |
7420 |
|
7421 |
|
7422 |
|
7423 |
|
7424 |
|
7425 |
|
7426 | boxTextMargin: 5,
|
7427 | |
7428 |
|
7429 |
|
7430 |
|
7431 |
|
7432 |
|
7433 |
|
7434 | noteMargin: 10,
|
7435 | |
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 |
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 | messageMargin: 35,
|
7447 | |
7448 |
|
7449 |
|
7450 |
|
7451 |
|
7452 |
|
7453 |
|
7454 | messageAlign: "center",
|
7455 | |
7456 |
|
7457 |
|
7458 |
|
7459 |
|
7460 |
|
7461 |
|
7462 |
|
7463 |
|
7464 |
|
7465 |
|
7466 | bottomMarginAdj: 1,
|
7467 | |
7468 |
|
7469 |
|
7470 |
|
7471 |
|
7472 |
|
7473 |
|
7474 |
|
7475 |
|
7476 |
|
7477 |
|
7478 |
|
7479 | useMaxWidth: true,
|
7480 | |
7481 |
|
7482 |
|
7483 |
|
7484 |
|
7485 |
|
7486 |
|
7487 |
|
7488 |
|
7489 |
|
7490 |
|
7491 |
|
7492 | rightAngles: false,
|
7493 | taskFontSize: 14,
|
7494 | taskFontFamily: '"Open Sans", sans-serif',
|
7495 | taskMargin: 50,
|
7496 |
|
7497 | activationWidth: 10,
|
7498 |
|
7499 | textPlacement: "fo",
|
7500 | actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"],
|
7501 | sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"],
|
7502 | sectionColours: ["#fff"]
|
7503 | },
|
7504 |
|
7505 | timeline: {
|
7506 | |
7507 |
|
7508 |
|
7509 |
|
7510 |
|
7511 |
|
7512 |
|
7513 | diagramMarginX: 50,
|
7514 | |
7515 |
|
7516 |
|
7517 |
|
7518 |
|
7519 |
|
7520 |
|
7521 | diagramMarginY: 10,
|
7522 | |
7523 |
|
7524 |
|
7525 |
|
7526 |
|
7527 |
|
7528 |
|
7529 | leftMargin: 150,
|
7530 | |
7531 |
|
7532 |
|
7533 |
|
7534 |
|
7535 |
|
7536 |
|
7537 | width: 150,
|
7538 | |
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 | height: 50,
|
7546 | |
7547 |
|
7548 |
|
7549 |
|
7550 |
|
7551 |
|
7552 |
|
7553 | boxMargin: 10,
|
7554 | |
7555 |
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 | boxTextMargin: 5,
|
7562 | |
7563 |
|
7564 |
|
7565 |
|
7566 |
|
7567 |
|
7568 |
|
7569 | noteMargin: 10,
|
7570 | |
7571 |
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 |
|
7581 | messageMargin: 35,
|
7582 | |
7583 |
|
7584 |
|
7585 |
|
7586 |
|
7587 |
|
7588 |
|
7589 | messageAlign: "center",
|
7590 | |
7591 |
|
7592 |
|
7593 |
|
7594 |
|
7595 |
|
7596 |
|
7597 |
|
7598 |
|
7599 |
|
7600 |
|
7601 | bottomMarginAdj: 1,
|
7602 | |
7603 |
|
7604 |
|
7605 |
|
7606 |
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 |
|
7614 | useMaxWidth: true,
|
7615 | |
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 |
|
7627 | rightAngles: false,
|
7628 | taskFontSize: 14,
|
7629 | taskFontFamily: '"Open Sans", sans-serif',
|
7630 | taskMargin: 50,
|
7631 |
|
7632 | activationWidth: 10,
|
7633 |
|
7634 | textPlacement: "fo",
|
7635 | actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"],
|
7636 | sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"],
|
7637 | sectionColours: ["#fff"],
|
7638 | disableMulticolor: false
|
7639 | },
|
7640 | class: {
|
7641 | |
7642 |
|
7643 |
|
7644 |
|
7645 |
|
7646 |
|
7647 |
|
7648 |
|
7649 |
|
7650 | titleTopMargin: 25,
|
7651 | arrowMarkerAbsolute: false,
|
7652 | dividerMargin: 10,
|
7653 | padding: 5,
|
7654 | textHeight: 10,
|
7655 | |
7656 |
|
7657 |
|
7658 |
|
7659 |
|
7660 |
|
7661 |
|
7662 |
|
7663 |
|
7664 |
|
7665 |
|
7666 |
|
7667 | useMaxWidth: true,
|
7668 | |
7669 |
|
7670 |
|
7671 |
|
7672 |
|
7673 |
|
7674 |
|
7675 |
|
7676 |
|
7677 |
|
7678 |
|
7679 |
|
7680 | defaultRenderer: "dagre-wrapper"
|
7681 | },
|
7682 | state: {
|
7683 | |
7684 |
|
7685 |
|
7686 |
|
7687 |
|
7688 |
|
7689 |
|
7690 |
|
7691 |
|
7692 | titleTopMargin: 25,
|
7693 | dividerMargin: 10,
|
7694 | sizeUnit: 5,
|
7695 | padding: 8,
|
7696 | textHeight: 10,
|
7697 | titleShift: -15,
|
7698 | noteMargin: 10,
|
7699 | forkWidth: 70,
|
7700 | forkHeight: 7,
|
7701 |
|
7702 | miniPadding: 2,
|
7703 |
|
7704 |
|
7705 | fontSizeFactor: 5.02,
|
7706 | fontSize: 24,
|
7707 | labelHeight: 16,
|
7708 | edgeLengthFactor: "20",
|
7709 | compositTitleSize: 35,
|
7710 | radius: 5,
|
7711 | |
7712 |
|
7713 |
|
7714 |
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 |
|
7721 |
|
7722 |
|
7723 | useMaxWidth: true,
|
7724 | |
7725 |
|
7726 |
|
7727 |
|
7728 |
|
7729 |
|
7730 |
|
7731 |
|
7732 |
|
7733 |
|
7734 |
|
7735 |
|
7736 | defaultRenderer: "dagre-wrapper"
|
7737 | },
|
7738 |
|
7739 | er: {
|
7740 | |
7741 |
|
7742 |
|
7743 |
|
7744 |
|
7745 |
|
7746 |
|
7747 |
|
7748 |
|
7749 | titleTopMargin: 25,
|
7750 | |
7751 |
|
7752 |
|
7753 |
|
7754 |
|
7755 |
|
7756 |
|
7757 |
|
7758 |
|
7759 |
|
7760 |
|
7761 |
|
7762 | diagramPadding: 20,
|
7763 | |
7764 |
|
7765 |
|
7766 |
|
7767 |
|
7768 |
|
7769 |
|
7770 |
|
7771 |
|
7772 |
|
7773 |
|
7774 |
|
7775 |
|
7776 | layoutDirection: "TB",
|
7777 | |
7778 |
|
7779 |
|
7780 |
|
7781 |
|
7782 |
|
7783 |
|
7784 | minEntityWidth: 100,
|
7785 | |
7786 |
|
7787 |
|
7788 |
|
7789 |
|
7790 |
|
7791 |
|
7792 | minEntityHeight: 75,
|
7793 | |
7794 |
|
7795 |
|
7796 |
|
7797 |
|
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 |
|
7804 |
|
7805 | entityPadding: 15,
|
7806 | |
7807 |
|
7808 |
|
7809 |
|
7810 |
|
7811 |
|
7812 |
|
7813 | stroke: "gray",
|
7814 | |
7815 |
|
7816 |
|
7817 |
|
7818 |
|
7819 |
|
7820 |
|
7821 | fill: "honeydew",
|
7822 | |
7823 |
|
7824 |
|
7825 |
|
7826 |
|
7827 |
|
7828 |
|
7829 |
|
7830 |
|
7831 | fontSize: 12,
|
7832 | |
7833 |
|
7834 |
|
7835 |
|
7836 |
|
7837 |
|
7838 |
|
7839 |
|
7840 |
|
7841 |
|
7842 |
|
7843 |
|
7844 | useMaxWidth: true
|
7845 | },
|
7846 |
|
7847 | pie: {
|
7848 | useWidth: void 0,
|
7849 | |
7850 |
|
7851 |
|
7852 |
|
7853 |
|
7854 |
|
7855 |
|
7856 |
|
7857 |
|
7858 |
|
7859 |
|
7860 |
|
7861 | useMaxWidth: true,
|
7862 | |
7863 |
|
7864 |
|
7865 |
|
7866 |
|
7867 |
|
7868 |
|
7869 | textPosition: 0.75
|
7870 | },
|
7871 | quadrantChart: {
|
7872 | |
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 |
|
7878 |
|
7879 |
|
7880 | chartWidth: 500,
|
7881 | |
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 |
|
7887 |
|
7888 |
|
7889 | chartHeight: 500,
|
7890 | |
7891 |
|
7892 |
|
7893 |
|
7894 |
|
7895 |
|
7896 |
|
7897 |
|
7898 | titlePadding: 10,
|
7899 | |
7900 |
|
7901 |
|
7902 |
|
7903 |
|
7904 |
|
7905 |
|
7906 |
|
7907 | titleFontSize: 20,
|
7908 | |
7909 |
|
7910 |
|
7911 |
|
7912 |
|
7913 |
|
7914 |
|
7915 |
|
7916 | quadrantPadding: 5,
|
7917 | |
7918 |
|
7919 |
|
7920 |
|
7921 |
|
7922 |
|
7923 |
|
7924 |
|
7925 | quadrantTextTopPadding: 5,
|
7926 | |
7927 |
|
7928 |
|
7929 |
|
7930 |
|
7931 |
|
7932 |
|
7933 |
|
7934 | quadrantLabelFontSize: 16,
|
7935 | |
7936 |
|
7937 |
|
7938 |
|
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 | quadrantInternalBorderStrokeWidth: 1,
|
7944 | |
7945 |
|
7946 |
|
7947 |
|
7948 |
|
7949 |
|
7950 |
|
7951 |
|
7952 | quadrantExternalBorderStrokeWidth: 2,
|
7953 | |
7954 |
|
7955 |
|
7956 |
|
7957 |
|
7958 |
|
7959 |
|
7960 |
|
7961 | xAxisLabelPadding: 5,
|
7962 | |
7963 |
|
7964 |
|
7965 |
|
7966 |
|
7967 |
|
7968 |
|
7969 |
|
7970 | xAxisLabelFontSize: 16,
|
7971 | |
7972 |
|
7973 |
|
7974 |
|
7975 |
|
7976 |
|
7977 |
|
7978 |
|
7979 | xAxisPosition: "top",
|
7980 | |
7981 |
|
7982 |
|
7983 |
|
7984 |
|
7985 |
|
7986 |
|
7987 |
|
7988 | yAxisLabelPadding: 5,
|
7989 | |
7990 |
|
7991 |
|
7992 |
|
7993 |
|
7994 |
|
7995 |
|
7996 |
|
7997 | yAxisLabelFontSize: 16,
|
7998 | |
7999 |
|
8000 |
|
8001 |
|
8002 |
|
8003 |
|
8004 |
|
8005 |
|
8006 | yAxisPosition: "left",
|
8007 | |
8008 |
|
8009 |
|
8010 |
|
8011 |
|
8012 |
|
8013 |
|
8014 |
|
8015 | pointTextPadding: 5,
|
8016 | |
8017 |
|
8018 |
|
8019 |
|
8020 |
|
8021 |
|
8022 |
|
8023 |
|
8024 | pointLabelFontSize: 12,
|
8025 | |
8026 |
|
8027 |
|
8028 |
|
8029 |
|
8030 |
|
8031 |
|
8032 |
|
8033 | pointRadius: 5,
|
8034 | |
8035 |
|
8036 |
|
8037 |
|
8038 |
|
8039 |
|
8040 |
|
8041 |
|
8042 |
|
8043 |
|
8044 |
|
8045 |
|
8046 | useMaxWidth: true
|
8047 | },
|
8048 |
|
8049 | requirement: {
|
8050 | useWidth: void 0,
|
8051 | |
8052 |
|
8053 |
|
8054 |
|
8055 |
|
8056 |
|
8057 |
|
8058 |
|
8059 |
|
8060 |
|
8061 |
|
8062 |
|
8063 | useMaxWidth: true,
|
8064 | rect_fill: "#f9f9f9",
|
8065 | text_color: "#333",
|
8066 | rect_border_size: "0.5px",
|
8067 | rect_border_color: "#bbb",
|
8068 | rect_min_width: 200,
|
8069 | rect_min_height: 200,
|
8070 | fontSize: 14,
|
8071 | rect_padding: 10,
|
8072 | line_height: 20
|
8073 | },
|
8074 | gitGraph: {
|
8075 | |
8076 |
|
8077 |
|
8078 |
|
8079 |
|
8080 |
|
8081 |
|
8082 |
|
8083 |
|
8084 | titleTopMargin: 25,
|
8085 | diagramPadding: 8,
|
8086 | nodeLabel: {
|
8087 | width: 75,
|
8088 | height: 100,
|
8089 | x: -25,
|
8090 | y: 0
|
8091 | },
|
8092 | mainBranchName: "main",
|
8093 | mainBranchOrder: 0,
|
8094 | showCommitLabel: true,
|
8095 | showBranches: true,
|
8096 | rotateCommitLabel: true
|
8097 | },
|
8098 |
|
8099 | c4: {
|
8100 | useWidth: void 0,
|
8101 | |
8102 |
|
8103 |
|
8104 |
|
8105 |
|
8106 |
|
8107 |
|
8108 | diagramMarginX: 50,
|
8109 | |
8110 |
|
8111 |
|
8112 |
|
8113 |
|
8114 |
|
8115 |
|
8116 | diagramMarginY: 10,
|
8117 | |
8118 |
|
8119 |
|
8120 |
|
8121 |
|
8122 |
|
8123 |
|
8124 | c4ShapeMargin: 50,
|
8125 | |
8126 |
|
8127 |
|
8128 |
|
8129 |
|
8130 |
|
8131 |
|
8132 | c4ShapePadding: 20,
|
8133 | |
8134 |
|
8135 |
|
8136 |
|
8137 |
|
8138 |
|
8139 |
|
8140 | width: 216,
|
8141 | |
8142 |
|
8143 |
|
8144 |
|
8145 |
|
8146 |
|
8147 |
|
8148 | height: 60,
|
8149 | |
8150 |
|
8151 |
|
8152 |
|
8153 |
|
8154 |
|
8155 |
|
8156 | boxMargin: 10,
|
8157 | |
8158 |
|
8159 |
|
8160 |
|
8161 |
|
8162 |
|
8163 |
|
8164 |
|
8165 |
|
8166 |
|
8167 | useMaxWidth: true,
|
8168 | |
8169 |
|
8170 |
|
8171 |
|
8172 |
|
8173 |
|
8174 |
|
8175 |
|
8176 |
|
8177 | c4ShapeInRow: 4,
|
8178 | nextLinePaddingX: 0,
|
8179 | |
8180 |
|
8181 |
|
8182 |
|
8183 |
|
8184 |
|
8185 |
|
8186 |
|
8187 |
|
8188 | c4BoundaryInRow: 2,
|
8189 | |
8190 |
|
8191 |
|
8192 |
|
8193 |
|
8194 | personFontSize: 14,
|
8195 | |
8196 |
|
8197 |
|
8198 |
|
8199 |
|
8200 | personFontFamily: '"Open Sans", sans-serif',
|
8201 | |
8202 |
|
8203 |
|
8204 |
|
8205 |
|
8206 | personFontWeight: "normal",
|
8207 | |
8208 |
|
8209 |
|
8210 |
|
8211 |
|
8212 | external_personFontSize: 14,
|
8213 | |
8214 |
|
8215 |
|
8216 |
|
8217 |
|
8218 | external_personFontFamily: '"Open Sans", sans-serif',
|
8219 | |
8220 |
|
8221 |
|
8222 |
|
8223 |
|
8224 | external_personFontWeight: "normal",
|
8225 | |
8226 |
|
8227 |
|
8228 |
|
8229 |
|
8230 | systemFontSize: 14,
|
8231 | |
8232 |
|
8233 |
|
8234 |
|
8235 |
|
8236 | systemFontFamily: '"Open Sans", sans-serif',
|
8237 | |
8238 |
|
8239 |
|
8240 |
|
8241 |
|
8242 | systemFontWeight: "normal",
|
8243 | |
8244 |
|
8245 |
|
8246 |
|
8247 |
|
8248 | external_systemFontSize: 14,
|
8249 | |
8250 |
|
8251 |
|
8252 |
|
8253 |
|
8254 | external_systemFontFamily: '"Open Sans", sans-serif',
|
8255 | |
8256 |
|
8257 |
|
8258 |
|
8259 |
|
8260 | external_systemFontWeight: "normal",
|
8261 | |
8262 |
|
8263 |
|
8264 |
|
8265 |
|
8266 | system_dbFontSize: 14,
|
8267 | |
8268 |
|
8269 |
|
8270 |
|
8271 |
|
8272 | system_dbFontFamily: '"Open Sans", sans-serif',
|
8273 | |
8274 |
|
8275 |
|
8276 |
|
8277 |
|
8278 | system_dbFontWeight: "normal",
|
8279 | |
8280 |
|
8281 |
|
8282 |
|
8283 |
|
8284 | external_system_dbFontSize: 14,
|
8285 | |
8286 |
|
8287 |
|
8288 |
|
8289 |
|
8290 | external_system_dbFontFamily: '"Open Sans", sans-serif',
|
8291 | |
8292 |
|
8293 |
|
8294 |
|
8295 |
|
8296 | external_system_dbFontWeight: "normal",
|
8297 | |
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 | system_queueFontSize: 14,
|
8303 | |
8304 |
|
8305 |
|
8306 |
|
8307 |
|
8308 | system_queueFontFamily: '"Open Sans", sans-serif',
|
8309 | |
8310 |
|
8311 |
|
8312 |
|
8313 |
|
8314 | system_queueFontWeight: "normal",
|
8315 | |
8316 |
|
8317 |
|
8318 |
|
8319 |
|
8320 | external_system_queueFontSize: 14,
|
8321 | |
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 | external_system_queueFontFamily: '"Open Sans", sans-serif',
|
8327 | |
8328 |
|
8329 |
|
8330 |
|
8331 |
|
8332 | external_system_queueFontWeight: "normal",
|
8333 | |
8334 |
|
8335 |
|
8336 |
|
8337 |
|
8338 | boundaryFontSize: 14,
|
8339 | |
8340 |
|
8341 |
|
8342 |
|
8343 |
|
8344 | boundaryFontFamily: '"Open Sans", sans-serif',
|
8345 | |
8346 |
|
8347 |
|
8348 |
|
8349 |
|
8350 | boundaryFontWeight: "normal",
|
8351 | |
8352 |
|
8353 |
|
8354 |
|
8355 |
|
8356 | messageFontSize: 12,
|
8357 | |
8358 |
|
8359 |
|
8360 |
|
8361 |
|
8362 | messageFontFamily: '"Open Sans", sans-serif',
|
8363 | |
8364 |
|
8365 |
|
8366 |
|
8367 |
|
8368 | messageFontWeight: "normal",
|
8369 | |
8370 |
|
8371 |
|
8372 |
|
8373 |
|
8374 | containerFontSize: 14,
|
8375 | |
8376 |
|
8377 |
|
8378 |
|
8379 |
|
8380 | containerFontFamily: '"Open Sans", sans-serif',
|
8381 | |
8382 |
|
8383 |
|
8384 |
|
8385 |
|
8386 | containerFontWeight: "normal",
|
8387 | |
8388 |
|
8389 |
|
8390 |
|
8391 |
|
8392 | external_containerFontSize: 14,
|
8393 | |
8394 |
|
8395 |
|
8396 |
|
8397 |
|
8398 | external_containerFontFamily: '"Open Sans", sans-serif',
|
8399 | |
8400 |
|
8401 |
|
8402 |
|
8403 |
|
8404 | external_containerFontWeight: "normal",
|
8405 | |
8406 |
|
8407 |
|
8408 |
|
8409 |
|
8410 | container_dbFontSize: 14,
|
8411 | |
8412 |
|
8413 |
|
8414 |
|
8415 |
|
8416 | container_dbFontFamily: '"Open Sans", sans-serif',
|
8417 | |
8418 |
|
8419 |
|
8420 |
|
8421 |
|
8422 | container_dbFontWeight: "normal",
|
8423 | |
8424 |
|
8425 |
|
8426 |
|
8427 |
|
8428 | external_container_dbFontSize: 14,
|
8429 | |
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 | external_container_dbFontFamily: '"Open Sans", sans-serif',
|
8435 | |
8436 |
|
8437 |
|
8438 |
|
8439 |
|
8440 | external_container_dbFontWeight: "normal",
|
8441 | |
8442 |
|
8443 |
|
8444 |
|
8445 |
|
8446 | container_queueFontSize: 14,
|
8447 | |
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 | container_queueFontFamily: '"Open Sans", sans-serif',
|
8453 | |
8454 |
|
8455 |
|
8456 |
|
8457 |
|
8458 | container_queueFontWeight: "normal",
|
8459 | |
8460 |
|
8461 |
|
8462 |
|
8463 |
|
8464 | external_container_queueFontSize: 14,
|
8465 | |
8466 |
|
8467 |
|
8468 |
|
8469 |
|
8470 | external_container_queueFontFamily: '"Open Sans", sans-serif',
|
8471 | |
8472 |
|
8473 |
|
8474 |
|
8475 |
|
8476 | external_container_queueFontWeight: "normal",
|
8477 | |
8478 |
|
8479 |
|
8480 |
|
8481 |
|
8482 | componentFontSize: 14,
|
8483 | |
8484 |
|
8485 |
|
8486 |
|
8487 |
|
8488 | componentFontFamily: '"Open Sans", sans-serif',
|
8489 | |
8490 |
|
8491 |
|
8492 |
|
8493 |
|
8494 | componentFontWeight: "normal",
|
8495 | |
8496 |
|
8497 |
|
8498 |
|
8499 |
|
8500 | external_componentFontSize: 14,
|
8501 | |
8502 |
|
8503 |
|
8504 |
|
8505 |
|
8506 | external_componentFontFamily: '"Open Sans", sans-serif',
|
8507 | |
8508 |
|
8509 |
|
8510 |
|
8511 |
|
8512 | external_componentFontWeight: "normal",
|
8513 | |
8514 |
|
8515 |
|
8516 |
|
8517 |
|
8518 | component_dbFontSize: 14,
|
8519 | |
8520 |
|
8521 |
|
8522 |
|
8523 |
|
8524 | component_dbFontFamily: '"Open Sans", sans-serif',
|
8525 | |
8526 |
|
8527 |
|
8528 |
|
8529 |
|
8530 | component_dbFontWeight: "normal",
|
8531 | |
8532 |
|
8533 |
|
8534 |
|
8535 |
|
8536 | external_component_dbFontSize: 14,
|
8537 | |
8538 |
|
8539 |
|
8540 |
|
8541 |
|
8542 | external_component_dbFontFamily: '"Open Sans", sans-serif',
|
8543 | |
8544 |
|
8545 |
|
8546 |
|
8547 |
|
8548 | external_component_dbFontWeight: "normal",
|
8549 | |
8550 |
|
8551 |
|
8552 |
|
8553 |
|
8554 | component_queueFontSize: 14,
|
8555 | |
8556 |
|
8557 |
|
8558 |
|
8559 |
|
8560 | component_queueFontFamily: '"Open Sans", sans-serif',
|
8561 | |
8562 |
|
8563 |
|
8564 |
|
8565 |
|
8566 | component_queueFontWeight: "normal",
|
8567 | |
8568 |
|
8569 |
|
8570 |
|
8571 |
|
8572 | external_component_queueFontSize: 14,
|
8573 | |
8574 |
|
8575 |
|
8576 |
|
8577 |
|
8578 | external_component_queueFontFamily: '"Open Sans", sans-serif',
|
8579 | |
8580 |
|
8581 |
|
8582 |
|
8583 |
|
8584 | external_component_queueFontWeight: "normal",
|
8585 | |
8586 |
|
8587 |
|
8588 |
|
8589 |
|
8590 | wrap: true,
|
8591 | |
8592 |
|
8593 |
|
8594 |
|
8595 |
|
8596 | wrapPadding: 10,
|
8597 | personFont: function() {
|
8598 | return {
|
8599 | fontFamily: this.personFontFamily,
|
8600 | fontSize: this.personFontSize,
|
8601 | fontWeight: this.personFontWeight
|
8602 | };
|
8603 | },
|
8604 | external_personFont: function() {
|
8605 | return {
|
8606 | fontFamily: this.external_personFontFamily,
|
8607 | fontSize: this.external_personFontSize,
|
8608 | fontWeight: this.external_personFontWeight
|
8609 | };
|
8610 | },
|
8611 | systemFont: function() {
|
8612 | return {
|
8613 | fontFamily: this.systemFontFamily,
|
8614 | fontSize: this.systemFontSize,
|
8615 | fontWeight: this.systemFontWeight
|
8616 | };
|
8617 | },
|
8618 | external_systemFont: function() {
|
8619 | return {
|
8620 | fontFamily: this.external_systemFontFamily,
|
8621 | fontSize: this.external_systemFontSize,
|
8622 | fontWeight: this.external_systemFontWeight
|
8623 | };
|
8624 | },
|
8625 | system_dbFont: function() {
|
8626 | return {
|
8627 | fontFamily: this.system_dbFontFamily,
|
8628 | fontSize: this.system_dbFontSize,
|
8629 | fontWeight: this.system_dbFontWeight
|
8630 | };
|
8631 | },
|
8632 | external_system_dbFont: function() {
|
8633 | return {
|
8634 | fontFamily: this.external_system_dbFontFamily,
|
8635 | fontSize: this.external_system_dbFontSize,
|
8636 | fontWeight: this.external_system_dbFontWeight
|
8637 | };
|
8638 | },
|
8639 | system_queueFont: function() {
|
8640 | return {
|
8641 | fontFamily: this.system_queueFontFamily,
|
8642 | fontSize: this.system_queueFontSize,
|
8643 | fontWeight: this.system_queueFontWeight
|
8644 | };
|
8645 | },
|
8646 | external_system_queueFont: function() {
|
8647 | return {
|
8648 | fontFamily: this.external_system_queueFontFamily,
|
8649 | fontSize: this.external_system_queueFontSize,
|
8650 | fontWeight: this.external_system_queueFontWeight
|
8651 | };
|
8652 | },
|
8653 | containerFont: function() {
|
8654 | return {
|
8655 | fontFamily: this.containerFontFamily,
|
8656 | fontSize: this.containerFontSize,
|
8657 | fontWeight: this.containerFontWeight
|
8658 | };
|
8659 | },
|
8660 | external_containerFont: function() {
|
8661 | return {
|
8662 | fontFamily: this.external_containerFontFamily,
|
8663 | fontSize: this.external_containerFontSize,
|
8664 | fontWeight: this.external_containerFontWeight
|
8665 | };
|
8666 | },
|
8667 | container_dbFont: function() {
|
8668 | return {
|
8669 | fontFamily: this.container_dbFontFamily,
|
8670 | fontSize: this.container_dbFontSize,
|
8671 | fontWeight: this.container_dbFontWeight
|
8672 | };
|
8673 | },
|
8674 | external_container_dbFont: function() {
|
8675 | return {
|
8676 | fontFamily: this.external_container_dbFontFamily,
|
8677 | fontSize: this.external_container_dbFontSize,
|
8678 | fontWeight: this.external_container_dbFontWeight
|
8679 | };
|
8680 | },
|
8681 | container_queueFont: function() {
|
8682 | return {
|
8683 | fontFamily: this.container_queueFontFamily,
|
8684 | fontSize: this.container_queueFontSize,
|
8685 | fontWeight: this.container_queueFontWeight
|
8686 | };
|
8687 | },
|
8688 | external_container_queueFont: function() {
|
8689 | return {
|
8690 | fontFamily: this.external_container_queueFontFamily,
|
8691 | fontSize: this.external_container_queueFontSize,
|
8692 | fontWeight: this.external_container_queueFontWeight
|
8693 | };
|
8694 | },
|
8695 | componentFont: function() {
|
8696 | return {
|
8697 | fontFamily: this.componentFontFamily,
|
8698 | fontSize: this.componentFontSize,
|
8699 | fontWeight: this.componentFontWeight
|
8700 | };
|
8701 | },
|
8702 | external_componentFont: function() {
|
8703 | return {
|
8704 | fontFamily: this.external_componentFontFamily,
|
8705 | fontSize: this.external_componentFontSize,
|
8706 | fontWeight: this.external_componentFontWeight
|
8707 | };
|
8708 | },
|
8709 | component_dbFont: function() {
|
8710 | return {
|
8711 | fontFamily: this.component_dbFontFamily,
|
8712 | fontSize: this.component_dbFontSize,
|
8713 | fontWeight: this.component_dbFontWeight
|
8714 | };
|
8715 | },
|
8716 | external_component_dbFont: function() {
|
8717 | return {
|
8718 | fontFamily: this.external_component_dbFontFamily,
|
8719 | fontSize: this.external_component_dbFontSize,
|
8720 | fontWeight: this.external_component_dbFontWeight
|
8721 | };
|
8722 | },
|
8723 | component_queueFont: function() {
|
8724 | return {
|
8725 | fontFamily: this.component_queueFontFamily,
|
8726 | fontSize: this.component_queueFontSize,
|
8727 | fontWeight: this.component_queueFontWeight
|
8728 | };
|
8729 | },
|
8730 | external_component_queueFont: function() {
|
8731 | return {
|
8732 | fontFamily: this.external_component_queueFontFamily,
|
8733 | fontSize: this.external_component_queueFontSize,
|
8734 | fontWeight: this.external_component_queueFontWeight
|
8735 | };
|
8736 | },
|
8737 | boundaryFont: function() {
|
8738 | return {
|
8739 | fontFamily: this.boundaryFontFamily,
|
8740 | fontSize: this.boundaryFontSize,
|
8741 | fontWeight: this.boundaryFontWeight
|
8742 | };
|
8743 | },
|
8744 | messageFont: function() {
|
8745 | return {
|
8746 | fontFamily: this.messageFontFamily,
|
8747 | fontSize: this.messageFontSize,
|
8748 | fontWeight: this.messageFontWeight
|
8749 | };
|
8750 | },
|
8751 |
|
8752 |
|
8753 | person_bg_color: "#08427B",
|
8754 | person_border_color: "#073B6F",
|
8755 | external_person_bg_color: "#686868",
|
8756 | external_person_border_color: "#8A8A8A",
|
8757 | system_bg_color: "#1168BD",
|
8758 | system_border_color: "#3C7FC0",
|
8759 | system_db_bg_color: "#1168BD",
|
8760 | system_db_border_color: "#3C7FC0",
|
8761 | system_queue_bg_color: "#1168BD",
|
8762 | system_queue_border_color: "#3C7FC0",
|
8763 | external_system_bg_color: "#999999",
|
8764 | external_system_border_color: "#8A8A8A",
|
8765 | external_system_db_bg_color: "#999999",
|
8766 | external_system_db_border_color: "#8A8A8A",
|
8767 | external_system_queue_bg_color: "#999999",
|
8768 | external_system_queue_border_color: "#8A8A8A",
|
8769 | container_bg_color: "#438DD5",
|
8770 | container_border_color: "#3C7FC0",
|
8771 | container_db_bg_color: "#438DD5",
|
8772 | container_db_border_color: "#3C7FC0",
|
8773 | container_queue_bg_color: "#438DD5",
|
8774 | container_queue_border_color: "#3C7FC0",
|
8775 | external_container_bg_color: "#B3B3B3",
|
8776 | external_container_border_color: "#A6A6A6",
|
8777 | external_container_db_bg_color: "#B3B3B3",
|
8778 | external_container_db_border_color: "#A6A6A6",
|
8779 | external_container_queue_bg_color: "#B3B3B3",
|
8780 | external_container_queue_border_color: "#A6A6A6",
|
8781 | component_bg_color: "#85BBF0",
|
8782 | component_border_color: "#78A8D8",
|
8783 | component_db_bg_color: "#85BBF0",
|
8784 | component_db_border_color: "#78A8D8",
|
8785 | component_queue_bg_color: "#85BBF0",
|
8786 | component_queue_border_color: "#78A8D8",
|
8787 | external_component_bg_color: "#CCCCCC",
|
8788 | external_component_border_color: "#BFBFBF",
|
8789 | external_component_db_bg_color: "#CCCCCC",
|
8790 | external_component_db_border_color: "#BFBFBF",
|
8791 | external_component_queue_bg_color: "#CCCCCC",
|
8792 | external_component_queue_border_color: "#BFBFBF"
|
8793 | },
|
8794 | mindmap: {
|
8795 | useMaxWidth: true,
|
8796 | padding: 10,
|
8797 | maxNodeWidth: 200
|
8798 | },
|
8799 | fontSize: 16
|
8800 | };
|
8801 | if (config.class) {
|
8802 | config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8803 | }
|
8804 | if (config.gitGraph) {
|
8805 | config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
8806 | }
|
8807 | const keyify = (obj, prefix = "") => Object.keys(obj).reduce((res, el) => {
|
8808 | if (Array.isArray(obj[el])) {
|
8809 | return res;
|
8810 | } else if (typeof obj[el] === "object" && obj[el] !== null) {
|
8811 | return [...res, prefix + el, ...keyify(obj[el], "")];
|
8812 | }
|
8813 | return [...res, prefix + el];
|
8814 | }, []);
|
8815 | const configKeys = keyify(config, "");
|
8816 | const defaultConfig$1 = config;
|
8817 |
|
8818 | function isNothing(subject) {
|
8819 | return typeof subject === "undefined" || subject === null;
|
8820 | }
|
8821 | function isObject$1(subject) {
|
8822 | return typeof subject === "object" && subject !== null;
|
8823 | }
|
8824 | function toArray(sequence2) {
|
8825 | if (Array.isArray(sequence2))
|
8826 | return sequence2;
|
8827 | else if (isNothing(sequence2))
|
8828 | return [];
|
8829 | return [sequence2];
|
8830 | }
|
8831 | function extend(target, source) {
|
8832 | var index, length2, key, sourceKeys;
|
8833 | if (source) {
|
8834 | sourceKeys = Object.keys(source);
|
8835 | for (index = 0, length2 = sourceKeys.length; index < length2; index += 1) {
|
8836 | key = sourceKeys[index];
|
8837 | target[key] = source[key];
|
8838 | }
|
8839 | }
|
8840 | return target;
|
8841 | }
|
8842 | function repeat(string, count) {
|
8843 | var result = "", cycle;
|
8844 | for (cycle = 0; cycle < count; cycle += 1) {
|
8845 | result += string;
|
8846 | }
|
8847 | return result;
|
8848 | }
|
8849 | function isNegativeZero(number) {
|
8850 | return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
8851 | }
|
8852 | var isNothing_1 = isNothing;
|
8853 | var isObject_1 = isObject$1;
|
8854 | var toArray_1 = toArray;
|
8855 | var repeat_1 = repeat;
|
8856 | var isNegativeZero_1 = isNegativeZero;
|
8857 | var extend_1 = extend;
|
8858 | var common = {
|
8859 | isNothing: isNothing_1,
|
8860 | isObject: isObject_1,
|
8861 | toArray: toArray_1,
|
8862 | repeat: repeat_1,
|
8863 | isNegativeZero: isNegativeZero_1,
|
8864 | extend: extend_1
|
8865 | };
|
8866 | function formatError(exception2, compact) {
|
8867 | var where = "", message = exception2.reason || "(unknown reason)";
|
8868 | if (!exception2.mark)
|
8869 | return message;
|
8870 | if (exception2.mark.name) {
|
8871 | where += 'in "' + exception2.mark.name + '" ';
|
8872 | }
|
8873 | where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
|
8874 | if (!compact && exception2.mark.snippet) {
|
8875 | where += "\n\n" + exception2.mark.snippet;
|
8876 | }
|
8877 | return message + " " + where;
|
8878 | }
|
8879 | function YAMLException$1(reason, mark) {
|
8880 | Error.call(this);
|
8881 | this.name = "YAMLException";
|
8882 | this.reason = reason;
|
8883 | this.mark = mark;
|
8884 | this.message = formatError(this, false);
|
8885 | if (Error.captureStackTrace) {
|
8886 | Error.captureStackTrace(this, this.constructor);
|
8887 | } else {
|
8888 | this.stack = new Error().stack || "";
|
8889 | }
|
8890 | }
|
8891 | YAMLException$1.prototype = Object.create(Error.prototype);
|
8892 | YAMLException$1.prototype.constructor = YAMLException$1;
|
8893 | YAMLException$1.prototype.toString = function toString(compact) {
|
8894 | return this.name + ": " + formatError(this, compact);
|
8895 | };
|
8896 | var exception = YAMLException$1;
|
8897 | function getLine(buffer, lineStart, lineEnd, position2, maxLineLength) {
|
8898 | var head = "";
|
8899 | var tail = "";
|
8900 | var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
8901 | if (position2 - lineStart > maxHalfLength) {
|
8902 | head = " ... ";
|
8903 | lineStart = position2 - maxHalfLength + head.length;
|
8904 | }
|
8905 | if (lineEnd - position2 > maxHalfLength) {
|
8906 | tail = " ...";
|
8907 | lineEnd = position2 + maxHalfLength - tail.length;
|
8908 | }
|
8909 | return {
|
8910 | str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
|
8911 | pos: position2 - lineStart + head.length
|
8912 |
|
8913 | };
|
8914 | }
|
8915 | function padStart2(string, max2) {
|
8916 | return common.repeat(" ", max2 - string.length) + string;
|
8917 | }
|
8918 | function makeSnippet(mark, options) {
|
8919 | options = Object.create(options || null);
|
8920 | if (!mark.buffer)
|
8921 | return null;
|
8922 | if (!options.maxLength)
|
8923 | options.maxLength = 79;
|
8924 | if (typeof options.indent !== "number")
|
8925 | options.indent = 1;
|
8926 | if (typeof options.linesBefore !== "number")
|
8927 | options.linesBefore = 3;
|
8928 | if (typeof options.linesAfter !== "number")
|
8929 | options.linesAfter = 2;
|
8930 | var re = /\r?\n|\r|\0/g;
|
8931 | var lineStarts = [0];
|
8932 | var lineEnds = [];
|
8933 | var match;
|
8934 | var foundLineNo = -1;
|
8935 | while (match = re.exec(mark.buffer)) {
|
8936 | lineEnds.push(match.index);
|
8937 | lineStarts.push(match.index + match[0].length);
|
8938 | if (mark.position <= match.index && foundLineNo < 0) {
|
8939 | foundLineNo = lineStarts.length - 2;
|
8940 | }
|
8941 | }
|
8942 | if (foundLineNo < 0)
|
8943 | foundLineNo = lineStarts.length - 1;
|
8944 | var result = "", i, line2;
|
8945 | var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
8946 | var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
8947 | for (i = 1; i <= options.linesBefore; i++) {
|
8948 | if (foundLineNo - i < 0)
|
8949 | break;
|
8950 | line2 = getLine(
|
8951 | mark.buffer,
|
8952 | lineStarts[foundLineNo - i],
|
8953 | lineEnds[foundLineNo - i],
|
8954 | mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
|
8955 | maxLineLength
|
8956 | );
|
8957 | result = common.repeat(" ", options.indent) + padStart2((mark.line - i + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
|
8958 | }
|
8959 | line2 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
8960 | result += common.repeat(" ", options.indent) + padStart2((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
|
8961 | result += common.repeat("-", options.indent + lineNoLength + 3 + line2.pos) + "^\n";
|
8962 | for (i = 1; i <= options.linesAfter; i++) {
|
8963 | if (foundLineNo + i >= lineEnds.length)
|
8964 | break;
|
8965 | line2 = getLine(
|
8966 | mark.buffer,
|
8967 | lineStarts[foundLineNo + i],
|
8968 | lineEnds[foundLineNo + i],
|
8969 | mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
|
8970 | maxLineLength
|
8971 | );
|
8972 | result += common.repeat(" ", options.indent) + padStart2((mark.line + i + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
|
8973 | }
|
8974 | return result.replace(/\n$/, "");
|
8975 | }
|
8976 | var snippet = makeSnippet;
|
8977 | var TYPE_CONSTRUCTOR_OPTIONS = [
|
8978 | "kind",
|
8979 | "multi",
|
8980 | "resolve",
|
8981 | "construct",
|
8982 | "instanceOf",
|
8983 | "predicate",
|
8984 | "represent",
|
8985 | "representName",
|
8986 | "defaultStyle",
|
8987 | "styleAliases"
|
8988 | ];
|
8989 | var YAML_NODE_KINDS = [
|
8990 | "scalar",
|
8991 | "sequence",
|
8992 | "mapping"
|
8993 | ];
|
8994 | function compileStyleAliases(map2) {
|
8995 | var result = {};
|
8996 | if (map2 !== null) {
|
8997 | Object.keys(map2).forEach(function(style) {
|
8998 | map2[style].forEach(function(alias) {
|
8999 | result[String(alias)] = style;
|
9000 | });
|
9001 | });
|
9002 | }
|
9003 | return result;
|
9004 | }
|
9005 | function Type$1(tag, options) {
|
9006 | options = options || {};
|
9007 | Object.keys(options).forEach(function(name) {
|
9008 | if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
9009 | throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
9010 | }
|
9011 | });
|
9012 | this.options = options;
|
9013 | this.tag = tag;
|
9014 | this.kind = options["kind"] || null;
|
9015 | this.resolve = options["resolve"] || function() {
|
9016 | return true;
|
9017 | };
|
9018 | this.construct = options["construct"] || function(data) {
|
9019 | return data;
|
9020 | };
|
9021 | this.instanceOf = options["instanceOf"] || null;
|
9022 | this.predicate = options["predicate"] || null;
|
9023 | this.represent = options["represent"] || null;
|
9024 | this.representName = options["representName"] || null;
|
9025 | this.defaultStyle = options["defaultStyle"] || null;
|
9026 | this.multi = options["multi"] || false;
|
9027 | this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
9028 | if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
9029 | throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
9030 | }
|
9031 | }
|
9032 | var type = Type$1;
|
9033 | function compileList(schema2, name) {
|
9034 | var result = [];
|
9035 | schema2[name].forEach(function(currentType) {
|
9036 | var newIndex = result.length;
|
9037 | result.forEach(function(previousType, previousIndex) {
|
9038 | if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
9039 | newIndex = previousIndex;
|
9040 | }
|
9041 | });
|
9042 | result[newIndex] = currentType;
|
9043 | });
|
9044 | return result;
|
9045 | }
|
9046 | function compileMap() {
|
9047 | var result = {
|
9048 | scalar: {},
|
9049 | sequence: {},
|
9050 | mapping: {},
|
9051 | fallback: {},
|
9052 | multi: {
|
9053 | scalar: [],
|
9054 | sequence: [],
|
9055 | mapping: [],
|
9056 | fallback: []
|
9057 | }
|
9058 | }, index, length2;
|
9059 | function collectType(type2) {
|
9060 | if (type2.multi) {
|
9061 | result.multi[type2.kind].push(type2);
|
9062 | result.multi["fallback"].push(type2);
|
9063 | } else {
|
9064 | result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
9065 | }
|
9066 | }
|
9067 | for (index = 0, length2 = arguments.length; index < length2; index += 1) {
|
9068 | arguments[index].forEach(collectType);
|
9069 | }
|
9070 | return result;
|
9071 | }
|
9072 | function Schema$1(definition) {
|
9073 | return this.extend(definition);
|
9074 | }
|
9075 | Schema$1.prototype.extend = function extend2(definition) {
|
9076 | var implicit = [];
|
9077 | var explicit = [];
|
9078 | if (definition instanceof type) {
|
9079 | explicit.push(definition);
|
9080 | } else if (Array.isArray(definition)) {
|
9081 | explicit = explicit.concat(definition);
|
9082 | } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
9083 | if (definition.implicit)
|
9084 | implicit = implicit.concat(definition.implicit);
|
9085 | if (definition.explicit)
|
9086 | explicit = explicit.concat(definition.explicit);
|
9087 | } else {
|
9088 | throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
9089 | }
|
9090 | implicit.forEach(function(type$1) {
|
9091 | if (!(type$1 instanceof type)) {
|
9092 | throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
9093 | }
|
9094 | if (type$1.loadKind && type$1.loadKind !== "scalar") {
|
9095 | throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
9096 | }
|
9097 | if (type$1.multi) {
|
9098 | throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
9099 | }
|
9100 | });
|
9101 | explicit.forEach(function(type$1) {
|
9102 | if (!(type$1 instanceof type)) {
|
9103 | throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
9104 | }
|
9105 | });
|
9106 | var result = Object.create(Schema$1.prototype);
|
9107 | result.implicit = (this.implicit || []).concat(implicit);
|
9108 | result.explicit = (this.explicit || []).concat(explicit);
|
9109 | result.compiledImplicit = compileList(result, "implicit");
|
9110 | result.compiledExplicit = compileList(result, "explicit");
|
9111 | result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
9112 | return result;
|
9113 | };
|
9114 | var schema = Schema$1;
|
9115 | var str = new type("tag:yaml.org,2002:str", {
|
9116 | kind: "scalar",
|
9117 | construct: function(data) {
|
9118 | return data !== null ? data : "";
|
9119 | }
|
9120 | });
|
9121 | var seq = new type("tag:yaml.org,2002:seq", {
|
9122 | kind: "sequence",
|
9123 | construct: function(data) {
|
9124 | return data !== null ? data : [];
|
9125 | }
|
9126 | });
|
9127 | var map = new type("tag:yaml.org,2002:map", {
|
9128 | kind: "mapping",
|
9129 | construct: function(data) {
|
9130 | return data !== null ? data : {};
|
9131 | }
|
9132 | });
|
9133 | var failsafe = new schema({
|
9134 | explicit: [
|
9135 | str,
|
9136 | seq,
|
9137 | map
|
9138 | ]
|
9139 | });
|
9140 | function resolveYamlNull(data) {
|
9141 | if (data === null)
|
9142 | return true;
|
9143 | var max2 = data.length;
|
9144 | return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL");
|
9145 | }
|
9146 | function constructYamlNull() {
|
9147 | return null;
|
9148 | }
|
9149 | function isNull(object) {
|
9150 | return object === null;
|
9151 | }
|
9152 | var _null = new type("tag:yaml.org,2002:null", {
|
9153 | kind: "scalar",
|
9154 | resolve: resolveYamlNull,
|
9155 | construct: constructYamlNull,
|
9156 | predicate: isNull,
|
9157 | represent: {
|
9158 | canonical: function() {
|
9159 | return "~";
|
9160 | },
|
9161 | lowercase: function() {
|
9162 | return "null";
|
9163 | },
|
9164 | uppercase: function() {
|
9165 | return "NULL";
|
9166 | },
|
9167 | camelcase: function() {
|
9168 | return "Null";
|
9169 | },
|
9170 | empty: function() {
|
9171 | return "";
|
9172 | }
|
9173 | },
|
9174 | defaultStyle: "lowercase"
|
9175 | });
|
9176 | function resolveYamlBoolean(data) {
|
9177 | if (data === null)
|
9178 | return false;
|
9179 | var max2 = data.length;
|
9180 | return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE");
|
9181 | }
|
9182 | function constructYamlBoolean(data) {
|
9183 | return data === "true" || data === "True" || data === "TRUE";
|
9184 | }
|
9185 | function isBoolean(object) {
|
9186 | return Object.prototype.toString.call(object) === "[object Boolean]";
|
9187 | }
|
9188 | var bool = new type("tag:yaml.org,2002:bool", {
|
9189 | kind: "scalar",
|
9190 | resolve: resolveYamlBoolean,
|
9191 | construct: constructYamlBoolean,
|
9192 | predicate: isBoolean,
|
9193 | represent: {
|
9194 | lowercase: function(object) {
|
9195 | return object ? "true" : "false";
|
9196 | },
|
9197 | uppercase: function(object) {
|
9198 | return object ? "TRUE" : "FALSE";
|
9199 | },
|
9200 | camelcase: function(object) {
|
9201 | return object ? "True" : "False";
|
9202 | }
|
9203 | },
|
9204 | defaultStyle: "lowercase"
|
9205 | });
|
9206 | function isHexCode(c) {
|
9207 | return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
9208 | }
|
9209 | function isOctCode(c) {
|
9210 | return 48 <= c && c <= 55;
|
9211 | }
|
9212 | function isDecCode(c) {
|
9213 | return 48 <= c && c <= 57;
|
9214 | }
|
9215 | function resolveYamlInteger(data) {
|
9216 | if (data === null)
|
9217 | return false;
|
9218 | var max2 = data.length, index = 0, hasDigits = false, ch;
|
9219 | if (!max2)
|
9220 | return false;
|
9221 | ch = data[index];
|
9222 | if (ch === "-" || ch === "+") {
|
9223 | ch = data[++index];
|
9224 | }
|
9225 | if (ch === "0") {
|
9226 | if (index + 1 === max2)
|
9227 | return true;
|
9228 | ch = data[++index];
|
9229 | if (ch === "b") {
|
9230 | index++;
|
9231 | for (; index < max2; index++) {
|
9232 | ch = data[index];
|
9233 | if (ch === "_")
|
9234 | continue;
|
9235 | if (ch !== "0" && ch !== "1")
|
9236 | return false;
|
9237 | hasDigits = true;
|
9238 | }
|
9239 | return hasDigits && ch !== "_";
|
9240 | }
|
9241 | if (ch === "x") {
|
9242 | index++;
|
9243 | for (; index < max2; index++) {
|
9244 | ch = data[index];
|
9245 | if (ch === "_")
|
9246 | continue;
|
9247 | if (!isHexCode(data.charCodeAt(index)))
|
9248 | return false;
|
9249 | hasDigits = true;
|
9250 | }
|
9251 | return hasDigits && ch !== "_";
|
9252 | }
|
9253 | if (ch === "o") {
|
9254 | index++;
|
9255 | for (; index < max2; index++) {
|
9256 | ch = data[index];
|
9257 | if (ch === "_")
|
9258 | continue;
|
9259 | if (!isOctCode(data.charCodeAt(index)))
|
9260 | return false;
|
9261 | hasDigits = true;
|
9262 | }
|
9263 | return hasDigits && ch !== "_";
|
9264 | }
|
9265 | }
|
9266 | if (ch === "_")
|
9267 | return false;
|
9268 | for (; index < max2; index++) {
|
9269 | ch = data[index];
|
9270 | if (ch === "_")
|
9271 | continue;
|
9272 | if (!isDecCode(data.charCodeAt(index))) {
|
9273 | return false;
|
9274 | }
|
9275 | hasDigits = true;
|
9276 | }
|
9277 | if (!hasDigits || ch === "_")
|
9278 | return false;
|
9279 | return true;
|
9280 | }
|
9281 | function constructYamlInteger(data) {
|
9282 | var value = data, sign2 = 1, ch;
|
9283 | if (value.indexOf("_") !== -1) {
|
9284 | value = value.replace(/_/g, "");
|
9285 | }
|
9286 | ch = value[0];
|
9287 | if (ch === "-" || ch === "+") {
|
9288 | if (ch === "-")
|
9289 | sign2 = -1;
|
9290 | value = value.slice(1);
|
9291 | ch = value[0];
|
9292 | }
|
9293 | if (value === "0")
|
9294 | return 0;
|
9295 | if (ch === "0") {
|
9296 | if (value[1] === "b")
|
9297 | return sign2 * parseInt(value.slice(2), 2);
|
9298 | if (value[1] === "x")
|
9299 | return sign2 * parseInt(value.slice(2), 16);
|
9300 | if (value[1] === "o")
|
9301 | return sign2 * parseInt(value.slice(2), 8);
|
9302 | }
|
9303 | return sign2 * parseInt(value, 10);
|
9304 | }
|
9305 | function isInteger(object) {
|
9306 | return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
9307 | }
|
9308 | var int = new type("tag:yaml.org,2002:int", {
|
9309 | kind: "scalar",
|
9310 | resolve: resolveYamlInteger,
|
9311 | construct: constructYamlInteger,
|
9312 | predicate: isInteger,
|
9313 | represent: {
|
9314 | binary: function(obj) {
|
9315 | return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
9316 | },
|
9317 | octal: function(obj) {
|
9318 | return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
9319 | },
|
9320 | decimal: function(obj) {
|
9321 | return obj.toString(10);
|
9322 | },
|
9323 |
|
9324 | hexadecimal: function(obj) {
|
9325 | return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
9326 | }
|
9327 | },
|
9328 | defaultStyle: "decimal",
|
9329 | styleAliases: {
|
9330 | binary: [2, "bin"],
|
9331 | octal: [8, "oct"],
|
9332 | decimal: [10, "dec"],
|
9333 | hexadecimal: [16, "hex"]
|
9334 | }
|
9335 | });
|
9336 | var YAML_FLOAT_PATTERN = new RegExp(
|
9337 |
|
9338 | "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
9339 | );
|
9340 | function resolveYamlFloat(data) {
|
9341 | if (data === null)
|
9342 | return false;
|
9343 | if (!YAML_FLOAT_PATTERN.test(data) ||
|
9344 |
|
9345 | data[data.length - 1] === "_") {
|
9346 | return false;
|
9347 | }
|
9348 | return true;
|
9349 | }
|
9350 | function constructYamlFloat(data) {
|
9351 | var value, sign2;
|
9352 | value = data.replace(/_/g, "").toLowerCase();
|
9353 | sign2 = value[0] === "-" ? -1 : 1;
|
9354 | if ("+-".indexOf(value[0]) >= 0) {
|
9355 | value = value.slice(1);
|
9356 | }
|
9357 | if (value === ".inf") {
|
9358 | return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
9359 | } else if (value === ".nan") {
|
9360 | return NaN;
|
9361 | }
|
9362 | return sign2 * parseFloat(value, 10);
|
9363 | }
|
9364 | var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
9365 | function representYamlFloat(object, style) {
|
9366 | var res;
|
9367 | if (isNaN(object)) {
|
9368 | switch (style) {
|
9369 | case "lowercase":
|
9370 | return ".nan";
|
9371 | case "uppercase":
|
9372 | return ".NAN";
|
9373 | case "camelcase":
|
9374 | return ".NaN";
|
9375 | }
|
9376 | } else if (Number.POSITIVE_INFINITY === object) {
|
9377 | switch (style) {
|
9378 | case "lowercase":
|
9379 | return ".inf";
|
9380 | case "uppercase":
|
9381 | return ".INF";
|
9382 | case "camelcase":
|
9383 | return ".Inf";
|
9384 | }
|
9385 | } else if (Number.NEGATIVE_INFINITY === object) {
|
9386 | switch (style) {
|
9387 | case "lowercase":
|
9388 | return "-.inf";
|
9389 | case "uppercase":
|
9390 | return "-.INF";
|
9391 | case "camelcase":
|
9392 | return "-.Inf";
|
9393 | }
|
9394 | } else if (common.isNegativeZero(object)) {
|
9395 | return "-0.0";
|
9396 | }
|
9397 | res = object.toString(10);
|
9398 | return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
9399 | }
|
9400 | function isFloat(object) {
|
9401 | return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
9402 | }
|
9403 | var float = new type("tag:yaml.org,2002:float", {
|
9404 | kind: "scalar",
|
9405 | resolve: resolveYamlFloat,
|
9406 | construct: constructYamlFloat,
|
9407 | predicate: isFloat,
|
9408 | represent: representYamlFloat,
|
9409 | defaultStyle: "lowercase"
|
9410 | });
|
9411 | var json = failsafe.extend({
|
9412 | implicit: [
|
9413 | _null,
|
9414 | bool,
|
9415 | int,
|
9416 | float
|
9417 | ]
|
9418 | });
|
9419 | var core = json;
|
9420 | var YAML_DATE_REGEXP = new RegExp(
|
9421 | "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
9422 | );
|
9423 | var YAML_TIMESTAMP_REGEXP = new RegExp(
|
9424 | "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
9425 | );
|
9426 | function resolveYamlTimestamp(data) {
|
9427 | if (data === null)
|
9428 | return false;
|
9429 | if (YAML_DATE_REGEXP.exec(data) !== null)
|
9430 | return true;
|
9431 | if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
9432 | return true;
|
9433 | return false;
|
9434 | }
|
9435 | function constructYamlTimestamp(data) {
|
9436 | var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
9437 | match = YAML_DATE_REGEXP.exec(data);
|
9438 | if (match === null)
|
9439 | match = YAML_TIMESTAMP_REGEXP.exec(data);
|
9440 | if (match === null)
|
9441 | throw new Error("Date resolve error");
|
9442 | year = +match[1];
|
9443 | month = +match[2] - 1;
|
9444 | day = +match[3];
|
9445 | if (!match[4]) {
|
9446 | return new Date(Date.UTC(year, month, day));
|
9447 | }
|
9448 | hour = +match[4];
|
9449 | minute = +match[5];
|
9450 | second = +match[6];
|
9451 | if (match[7]) {
|
9452 | fraction = match[7].slice(0, 3);
|
9453 | while (fraction.length < 3) {
|
9454 | fraction += "0";
|
9455 | }
|
9456 | fraction = +fraction;
|
9457 | }
|
9458 | if (match[9]) {
|
9459 | tz_hour = +match[10];
|
9460 | tz_minute = +(match[11] || 0);
|
9461 | delta = (tz_hour * 60 + tz_minute) * 6e4;
|
9462 | if (match[9] === "-")
|
9463 | delta = -delta;
|
9464 | }
|
9465 | date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
9466 | if (delta)
|
9467 | date.setTime(date.getTime() - delta);
|
9468 | return date;
|
9469 | }
|
9470 | function representYamlTimestamp(object) {
|
9471 | return object.toISOString();
|
9472 | }
|
9473 | var timestamp = new type("tag:yaml.org,2002:timestamp", {
|
9474 | kind: "scalar",
|
9475 | resolve: resolveYamlTimestamp,
|
9476 | construct: constructYamlTimestamp,
|
9477 | instanceOf: Date,
|
9478 | represent: representYamlTimestamp
|
9479 | });
|
9480 | function resolveYamlMerge(data) {
|
9481 | return data === "<<" || data === null;
|
9482 | }
|
9483 | var merge = new type("tag:yaml.org,2002:merge", {
|
9484 | kind: "scalar",
|
9485 | resolve: resolveYamlMerge
|
9486 | });
|
9487 | var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
9488 | function resolveYamlBinary(data) {
|
9489 | if (data === null)
|
9490 | return false;
|
9491 | var code, idx, bitlen = 0, max2 = data.length, map2 = BASE64_MAP;
|
9492 | for (idx = 0; idx < max2; idx++) {
|
9493 | code = map2.indexOf(data.charAt(idx));
|
9494 | if (code > 64)
|
9495 | continue;
|
9496 | if (code < 0)
|
9497 | return false;
|
9498 | bitlen += 6;
|
9499 | }
|
9500 | return bitlen % 8 === 0;
|
9501 | }
|
9502 | function constructYamlBinary(data) {
|
9503 | var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
9504 | for (idx = 0; idx < max2; idx++) {
|
9505 | if (idx % 4 === 0 && idx) {
|
9506 | result.push(bits >> 16 & 255);
|
9507 | result.push(bits >> 8 & 255);
|
9508 | result.push(bits & 255);
|
9509 | }
|
9510 | bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
9511 | }
|
9512 | tailbits = max2 % 4 * 6;
|
9513 | if (tailbits === 0) {
|
9514 | result.push(bits >> 16 & 255);
|
9515 | result.push(bits >> 8 & 255);
|
9516 | result.push(bits & 255);
|
9517 | } else if (tailbits === 18) {
|
9518 | result.push(bits >> 10 & 255);
|
9519 | result.push(bits >> 2 & 255);
|
9520 | } else if (tailbits === 12) {
|
9521 | result.push(bits >> 4 & 255);
|
9522 | }
|
9523 | return new Uint8Array(result);
|
9524 | }
|
9525 | function representYamlBinary(object) {
|
9526 | var result = "", bits = 0, idx, tail, max2 = object.length, map2 = BASE64_MAP;
|
9527 | for (idx = 0; idx < max2; idx++) {
|
9528 | if (idx % 3 === 0 && idx) {
|
9529 | result += map2[bits >> 18 & 63];
|
9530 | result += map2[bits >> 12 & 63];
|
9531 | result += map2[bits >> 6 & 63];
|
9532 | result += map2[bits & 63];
|
9533 | }
|
9534 | bits = (bits << 8) + object[idx];
|
9535 | }
|
9536 | tail = max2 % 3;
|
9537 | if (tail === 0) {
|
9538 | result += map2[bits >> 18 & 63];
|
9539 | result += map2[bits >> 12 & 63];
|
9540 | result += map2[bits >> 6 & 63];
|
9541 | result += map2[bits & 63];
|
9542 | } else if (tail === 2) {
|
9543 | result += map2[bits >> 10 & 63];
|
9544 | result += map2[bits >> 4 & 63];
|
9545 | result += map2[bits << 2 & 63];
|
9546 | result += map2[64];
|
9547 | } else if (tail === 1) {
|
9548 | result += map2[bits >> 2 & 63];
|
9549 | result += map2[bits << 4 & 63];
|
9550 | result += map2[64];
|
9551 | result += map2[64];
|
9552 | }
|
9553 | return result;
|
9554 | }
|
9555 | function isBinary(obj) {
|
9556 | return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
9557 | }
|
9558 | var binary = new type("tag:yaml.org,2002:binary", {
|
9559 | kind: "scalar",
|
9560 | resolve: resolveYamlBinary,
|
9561 | construct: constructYamlBinary,
|
9562 | predicate: isBinary,
|
9563 | represent: representYamlBinary
|
9564 | });
|
9565 | var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
9566 | var _toString$2 = Object.prototype.toString;
|
9567 | function resolveYamlOmap(data) {
|
9568 | if (data === null)
|
9569 | return true;
|
9570 | var objectKeys = [], index, length2, pair, pairKey, pairHasKey, object = data;
|
9571 | for (index = 0, length2 = object.length; index < length2; index += 1) {
|
9572 | pair = object[index];
|
9573 | pairHasKey = false;
|
9574 | if (_toString$2.call(pair) !== "[object Object]")
|
9575 | return false;
|
9576 | for (pairKey in pair) {
|
9577 | if (_hasOwnProperty$3.call(pair, pairKey)) {
|
9578 | if (!pairHasKey)
|
9579 | pairHasKey = true;
|
9580 | else
|
9581 | return false;
|
9582 | }
|
9583 | }
|
9584 | if (!pairHasKey)
|
9585 | return false;
|
9586 | if (objectKeys.indexOf(pairKey) === -1)
|
9587 | objectKeys.push(pairKey);
|
9588 | else
|
9589 | return false;
|
9590 | }
|
9591 | return true;
|
9592 | }
|
9593 | function constructYamlOmap(data) {
|
9594 | return data !== null ? data : [];
|
9595 | }
|
9596 | var omap = new type("tag:yaml.org,2002:omap", {
|
9597 | kind: "sequence",
|
9598 | resolve: resolveYamlOmap,
|
9599 | construct: constructYamlOmap
|
9600 | });
|
9601 | var _toString$1 = Object.prototype.toString;
|
9602 | function resolveYamlPairs(data) {
|
9603 | if (data === null)
|
9604 | return true;
|
9605 | var index, length2, pair, keys, result, object = data;
|
9606 | result = new Array(object.length);
|
9607 | for (index = 0, length2 = object.length; index < length2; index += 1) {
|
9608 | pair = object[index];
|
9609 | if (_toString$1.call(pair) !== "[object Object]")
|
9610 | return false;
|
9611 | keys = Object.keys(pair);
|
9612 | if (keys.length !== 1)
|
9613 | return false;
|
9614 | result[index] = [keys[0], pair[keys[0]]];
|
9615 | }
|
9616 | return true;
|
9617 | }
|
9618 | function constructYamlPairs(data) {
|
9619 | if (data === null)
|
9620 | return [];
|
9621 | var index, length2, pair, keys, result, object = data;
|
9622 | result = new Array(object.length);
|
9623 | for (index = 0, length2 = object.length; index < length2; index += 1) {
|
9624 | pair = object[index];
|
9625 | keys = Object.keys(pair);
|
9626 | result[index] = [keys[0], pair[keys[0]]];
|
9627 | }
|
9628 | return result;
|
9629 | }
|
9630 | var pairs = new type("tag:yaml.org,2002:pairs", {
|
9631 | kind: "sequence",
|
9632 | resolve: resolveYamlPairs,
|
9633 | construct: constructYamlPairs
|
9634 | });
|
9635 | var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
9636 | function resolveYamlSet(data) {
|
9637 | if (data === null)
|
9638 | return true;
|
9639 | var key, object = data;
|
9640 | for (key in object) {
|
9641 | if (_hasOwnProperty$2.call(object, key)) {
|
9642 | if (object[key] !== null)
|
9643 | return false;
|
9644 | }
|
9645 | }
|
9646 | return true;
|
9647 | }
|
9648 | function constructYamlSet(data) {
|
9649 | return data !== null ? data : {};
|
9650 | }
|
9651 | var set = new type("tag:yaml.org,2002:set", {
|
9652 | kind: "mapping",
|
9653 | resolve: resolveYamlSet,
|
9654 | construct: constructYamlSet
|
9655 | });
|
9656 | var _default = core.extend({
|
9657 | implicit: [
|
9658 | timestamp,
|
9659 | merge
|
9660 | ],
|
9661 | explicit: [
|
9662 | binary,
|
9663 | omap,
|
9664 | pairs,
|
9665 | set
|
9666 | ]
|
9667 | });
|
9668 | var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
9669 | var CONTEXT_FLOW_IN = 1;
|
9670 | var CONTEXT_FLOW_OUT = 2;
|
9671 | var CONTEXT_BLOCK_IN = 3;
|
9672 | var CONTEXT_BLOCK_OUT = 4;
|
9673 | var CHOMPING_CLIP = 1;
|
9674 | var CHOMPING_STRIP = 2;
|
9675 | var CHOMPING_KEEP = 3;
|
9676 | var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
9677 | var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
9678 | var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
9679 | var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
9680 | var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
9681 | function _class(obj) {
|
9682 | return Object.prototype.toString.call(obj);
|
9683 | }
|
9684 | function is_EOL(c) {
|
9685 | return c === 10 || c === 13;
|
9686 | }
|
9687 | function is_WHITE_SPACE(c) {
|
9688 | return c === 9 || c === 32;
|
9689 | }
|
9690 | function is_WS_OR_EOL(c) {
|
9691 | return c === 9 || c === 32 || c === 10 || c === 13;
|
9692 | }
|
9693 | function is_FLOW_INDICATOR(c) {
|
9694 | return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
9695 | }
|
9696 | function fromHexCode(c) {
|
9697 | var lc;
|
9698 | if (48 <= c && c <= 57) {
|
9699 | return c - 48;
|
9700 | }
|
9701 | lc = c | 32;
|
9702 | if (97 <= lc && lc <= 102) {
|
9703 | return lc - 97 + 10;
|
9704 | }
|
9705 | return -1;
|
9706 | }
|
9707 | function escapedHexLen(c) {
|
9708 | if (c === 120) {
|
9709 | return 2;
|
9710 | }
|
9711 | if (c === 117) {
|
9712 | return 4;
|
9713 | }
|
9714 | if (c === 85) {
|
9715 | return 8;
|
9716 | }
|
9717 | return 0;
|
9718 | }
|
9719 | function fromDecimalCode(c) {
|
9720 | if (48 <= c && c <= 57) {
|
9721 | return c - 48;
|
9722 | }
|
9723 | return -1;
|
9724 | }
|
9725 | function simpleEscapeSequence(c) {
|
9726 | return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "
" : c === 95 ? " " : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
9727 | }
|
9728 | function charFromCodepoint(c) {
|
9729 | if (c <= 65535) {
|
9730 | return String.fromCharCode(c);
|
9731 | }
|
9732 | return String.fromCharCode(
|
9733 | (c - 65536 >> 10) + 55296,
|
9734 | (c - 65536 & 1023) + 56320
|
9735 | );
|
9736 | }
|
9737 | var simpleEscapeCheck = new Array(256);
|
9738 | var simpleEscapeMap = new Array(256);
|
9739 | for (var i = 0; i < 256; i++) {
|
9740 | simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
9741 | simpleEscapeMap[i] = simpleEscapeSequence(i);
|
9742 | }
|
9743 | function State$1(input, options) {
|
9744 | this.input = input;
|
9745 | this.filename = options["filename"] || null;
|
9746 | this.schema = options["schema"] || _default;
|
9747 | this.onWarning = options["onWarning"] || null;
|
9748 | this.legacy = options["legacy"] || false;
|
9749 | this.json = options["json"] || false;
|
9750 | this.listener = options["listener"] || null;
|
9751 | this.implicitTypes = this.schema.compiledImplicit;
|
9752 | this.typeMap = this.schema.compiledTypeMap;
|
9753 | this.length = input.length;
|
9754 | this.position = 0;
|
9755 | this.line = 0;
|
9756 | this.lineStart = 0;
|
9757 | this.lineIndent = 0;
|
9758 | this.firstTabInLine = -1;
|
9759 | this.documents = [];
|
9760 | }
|
9761 | function generateError(state2, message) {
|
9762 | var mark = {
|
9763 | name: state2.filename,
|
9764 | buffer: state2.input.slice(0, -1),
|
9765 |
|
9766 | position: state2.position,
|
9767 | line: state2.line,
|
9768 | column: state2.position - state2.lineStart
|
9769 | };
|
9770 | mark.snippet = snippet(mark);
|
9771 | return new exception(message, mark);
|
9772 | }
|
9773 | function throwError(state2, message) {
|
9774 | throw generateError(state2, message);
|
9775 | }
|
9776 | function throwWarning(state2, message) {
|
9777 | if (state2.onWarning) {
|
9778 | state2.onWarning.call(null, generateError(state2, message));
|
9779 | }
|
9780 | }
|
9781 | var directiveHandlers = {
|
9782 | YAML: function handleYamlDirective(state2, name, args) {
|
9783 | var match, major, minor;
|
9784 | if (state2.version !== null) {
|
9785 | throwError(state2, "duplication of %YAML directive");
|
9786 | }
|
9787 | if (args.length !== 1) {
|
9788 | throwError(state2, "YAML directive accepts exactly one argument");
|
9789 | }
|
9790 | match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
9791 | if (match === null) {
|
9792 | throwError(state2, "ill-formed argument of the YAML directive");
|
9793 | }
|
9794 | major = parseInt(match[1], 10);
|
9795 | minor = parseInt(match[2], 10);
|
9796 | if (major !== 1) {
|
9797 | throwError(state2, "unacceptable YAML version of the document");
|
9798 | }
|
9799 | state2.version = args[0];
|
9800 | state2.checkLineBreaks = minor < 2;
|
9801 | if (minor !== 1 && minor !== 2) {
|
9802 | throwWarning(state2, "unsupported YAML version of the document");
|
9803 | }
|
9804 | },
|
9805 | TAG: function handleTagDirective(state2, name, args) {
|
9806 | var handle, prefix;
|
9807 | if (args.length !== 2) {
|
9808 | throwError(state2, "TAG directive accepts exactly two arguments");
|
9809 | }
|
9810 | handle = args[0];
|
9811 | prefix = args[1];
|
9812 | if (!PATTERN_TAG_HANDLE.test(handle)) {
|
9813 | throwError(state2, "ill-formed tag handle (first argument) of the TAG directive");
|
9814 | }
|
9815 | if (_hasOwnProperty$1.call(state2.tagMap, handle)) {
|
9816 | throwError(state2, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
9817 | }
|
9818 | if (!PATTERN_TAG_URI.test(prefix)) {
|
9819 | throwError(state2, "ill-formed tag prefix (second argument) of the TAG directive");
|
9820 | }
|
9821 | try {
|
9822 | prefix = decodeURIComponent(prefix);
|
9823 | } catch (err) {
|
9824 | throwError(state2, "tag prefix is malformed: " + prefix);
|
9825 | }
|
9826 | state2.tagMap[handle] = prefix;
|
9827 | }
|
9828 | };
|
9829 | function captureSegment(state2, start2, end, checkJson) {
|
9830 | var _position, _length, _character, _result;
|
9831 | if (start2 < end) {
|
9832 | _result = state2.input.slice(start2, end);
|
9833 | if (checkJson) {
|
9834 | for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
9835 | _character = _result.charCodeAt(_position);
|
9836 | if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
9837 | throwError(state2, "expected valid JSON character");
|
9838 | }
|
9839 | }
|
9840 | } else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
9841 | throwError(state2, "the stream contains non-printable characters");
|
9842 | }
|
9843 | state2.result += _result;
|
9844 | }
|
9845 | }
|
9846 | function mergeMappings(state2, destination, source, overridableKeys) {
|
9847 | var sourceKeys, key, index, quantity;
|
9848 | if (!common.isObject(source)) {
|
9849 | throwError(state2, "cannot merge mappings; the provided source object is unacceptable");
|
9850 | }
|
9851 | sourceKeys = Object.keys(source);
|
9852 | for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
9853 | key = sourceKeys[index];
|
9854 | if (!_hasOwnProperty$1.call(destination, key)) {
|
9855 | destination[key] = source[key];
|
9856 | overridableKeys[key] = true;
|
9857 | }
|
9858 | }
|
9859 | }
|
9860 | function storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
9861 | var index, quantity;
|
9862 | if (Array.isArray(keyNode)) {
|
9863 | keyNode = Array.prototype.slice.call(keyNode);
|
9864 | for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
9865 | if (Array.isArray(keyNode[index])) {
|
9866 | throwError(state2, "nested arrays are not supported inside keys");
|
9867 | }
|
9868 | if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
9869 | keyNode[index] = "[object Object]";
|
9870 | }
|
9871 | }
|
9872 | }
|
9873 | if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
9874 | keyNode = "[object Object]";
|
9875 | }
|
9876 | keyNode = String(keyNode);
|
9877 | if (_result === null) {
|
9878 | _result = {};
|
9879 | }
|
9880 | if (keyTag === "tag:yaml.org,2002:merge") {
|
9881 | if (Array.isArray(valueNode)) {
|
9882 | for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
9883 | mergeMappings(state2, _result, valueNode[index], overridableKeys);
|
9884 | }
|
9885 | } else {
|
9886 | mergeMappings(state2, _result, valueNode, overridableKeys);
|
9887 | }
|
9888 | } else {
|
9889 | if (!state2.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
9890 | state2.line = startLine || state2.line;
|
9891 | state2.lineStart = startLineStart || state2.lineStart;
|
9892 | state2.position = startPos || state2.position;
|
9893 | throwError(state2, "duplicated mapping key");
|
9894 | }
|
9895 | if (keyNode === "__proto__") {
|
9896 | Object.defineProperty(_result, keyNode, {
|
9897 | configurable: true,
|
9898 | enumerable: true,
|
9899 | writable: true,
|
9900 | value: valueNode
|
9901 | });
|
9902 | } else {
|
9903 | _result[keyNode] = valueNode;
|
9904 | }
|
9905 | delete overridableKeys[keyNode];
|
9906 | }
|
9907 | return _result;
|
9908 | }
|
9909 | function readLineBreak(state2) {
|
9910 | var ch;
|
9911 | ch = state2.input.charCodeAt(state2.position);
|
9912 | if (ch === 10) {
|
9913 | state2.position++;
|
9914 | } else if (ch === 13) {
|
9915 | state2.position++;
|
9916 | if (state2.input.charCodeAt(state2.position) === 10) {
|
9917 | state2.position++;
|
9918 | }
|
9919 | } else {
|
9920 | throwError(state2, "a line break is expected");
|
9921 | }
|
9922 | state2.line += 1;
|
9923 | state2.lineStart = state2.position;
|
9924 | state2.firstTabInLine = -1;
|
9925 | }
|
9926 | function skipSeparationSpace(state2, allowComments, checkIndent) {
|
9927 | var lineBreaks = 0, ch = state2.input.charCodeAt(state2.position);
|
9928 | while (ch !== 0) {
|
9929 | while (is_WHITE_SPACE(ch)) {
|
9930 | if (ch === 9 && state2.firstTabInLine === -1) {
|
9931 | state2.firstTabInLine = state2.position;
|
9932 | }
|
9933 | ch = state2.input.charCodeAt(++state2.position);
|
9934 | }
|
9935 | if (allowComments && ch === 35) {
|
9936 | do {
|
9937 | ch = state2.input.charCodeAt(++state2.position);
|
9938 | } while (ch !== 10 && ch !== 13 && ch !== 0);
|
9939 | }
|
9940 | if (is_EOL(ch)) {
|
9941 | readLineBreak(state2);
|
9942 | ch = state2.input.charCodeAt(state2.position);
|
9943 | lineBreaks++;
|
9944 | state2.lineIndent = 0;
|
9945 | while (ch === 32) {
|
9946 | state2.lineIndent++;
|
9947 | ch = state2.input.charCodeAt(++state2.position);
|
9948 | }
|
9949 | } else {
|
9950 | break;
|
9951 | }
|
9952 | }
|
9953 | if (checkIndent !== -1 && lineBreaks !== 0 && state2.lineIndent < checkIndent) {
|
9954 | throwWarning(state2, "deficient indentation");
|
9955 | }
|
9956 | return lineBreaks;
|
9957 | }
|
9958 | function testDocumentSeparator(state2) {
|
9959 | var _position = state2.position, ch;
|
9960 | ch = state2.input.charCodeAt(_position);
|
9961 | if ((ch === 45 || ch === 46) && ch === state2.input.charCodeAt(_position + 1) && ch === state2.input.charCodeAt(_position + 2)) {
|
9962 | _position += 3;
|
9963 | ch = state2.input.charCodeAt(_position);
|
9964 | if (ch === 0 || is_WS_OR_EOL(ch)) {
|
9965 | return true;
|
9966 | }
|
9967 | }
|
9968 | return false;
|
9969 | }
|
9970 | function writeFoldedLines(state2, count) {
|
9971 | if (count === 1) {
|
9972 | state2.result += " ";
|
9973 | } else if (count > 1) {
|
9974 | state2.result += common.repeat("\n", count - 1);
|
9975 | }
|
9976 | }
|
9977 | function readPlainScalar(state2, nodeIndent, withinFlowCollection) {
|
9978 | var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state2.kind, _result = state2.result, ch;
|
9979 | ch = state2.input.charCodeAt(state2.position);
|
9980 | if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
9981 | return false;
|
9982 | }
|
9983 | if (ch === 63 || ch === 45) {
|
9984 | following = state2.input.charCodeAt(state2.position + 1);
|
9985 | if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
9986 | return false;
|
9987 | }
|
9988 | }
|
9989 | state2.kind = "scalar";
|
9990 | state2.result = "";
|
9991 | captureStart = captureEnd = state2.position;
|
9992 | hasPendingContent = false;
|
9993 | while (ch !== 0) {
|
9994 | if (ch === 58) {
|
9995 | following = state2.input.charCodeAt(state2.position + 1);
|
9996 | if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
9997 | break;
|
9998 | }
|
9999 | } else if (ch === 35) {
|
10000 | preceding = state2.input.charCodeAt(state2.position - 1);
|
10001 | if (is_WS_OR_EOL(preceding)) {
|
10002 | break;
|
10003 | }
|
10004 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
10005 | break;
|
10006 | } else if (is_EOL(ch)) {
|
10007 | _line = state2.line;
|
10008 | _lineStart = state2.lineStart;
|
10009 | _lineIndent = state2.lineIndent;
|
10010 | skipSeparationSpace(state2, false, -1);
|
10011 | if (state2.lineIndent >= nodeIndent) {
|
10012 | hasPendingContent = true;
|
10013 | ch = state2.input.charCodeAt(state2.position);
|
10014 | continue;
|
10015 | } else {
|
10016 | state2.position = captureEnd;
|
10017 | state2.line = _line;
|
10018 | state2.lineStart = _lineStart;
|
10019 | state2.lineIndent = _lineIndent;
|
10020 | break;
|
10021 | }
|
10022 | }
|
10023 | if (hasPendingContent) {
|
10024 | captureSegment(state2, captureStart, captureEnd, false);
|
10025 | writeFoldedLines(state2, state2.line - _line);
|
10026 | captureStart = captureEnd = state2.position;
|
10027 | hasPendingContent = false;
|
10028 | }
|
10029 | if (!is_WHITE_SPACE(ch)) {
|
10030 | captureEnd = state2.position + 1;
|
10031 | }
|
10032 | ch = state2.input.charCodeAt(++state2.position);
|
10033 | }
|
10034 | captureSegment(state2, captureStart, captureEnd, false);
|
10035 | if (state2.result) {
|
10036 | return true;
|
10037 | }
|
10038 | state2.kind = _kind;
|
10039 | state2.result = _result;
|
10040 | return false;
|
10041 | }
|
10042 | function readSingleQuotedScalar(state2, nodeIndent) {
|
10043 | var ch, captureStart, captureEnd;
|
10044 | ch = state2.input.charCodeAt(state2.position);
|
10045 | if (ch !== 39) {
|
10046 | return false;
|
10047 | }
|
10048 | state2.kind = "scalar";
|
10049 | state2.result = "";
|
10050 | state2.position++;
|
10051 | captureStart = captureEnd = state2.position;
|
10052 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
10053 | if (ch === 39) {
|
10054 | captureSegment(state2, captureStart, state2.position, true);
|
10055 | ch = state2.input.charCodeAt(++state2.position);
|
10056 | if (ch === 39) {
|
10057 | captureStart = state2.position;
|
10058 | state2.position++;
|
10059 | captureEnd = state2.position;
|
10060 | } else {
|
10061 | return true;
|
10062 | }
|
10063 | } else if (is_EOL(ch)) {
|
10064 | captureSegment(state2, captureStart, captureEnd, true);
|
10065 | writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent));
|
10066 | captureStart = captureEnd = state2.position;
|
10067 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
10068 | throwError(state2, "unexpected end of the document within a single quoted scalar");
|
10069 | } else {
|
10070 | state2.position++;
|
10071 | captureEnd = state2.position;
|
10072 | }
|
10073 | }
|
10074 | throwError(state2, "unexpected end of the stream within a single quoted scalar");
|
10075 | }
|
10076 | function readDoubleQuotedScalar(state2, nodeIndent) {
|
10077 | var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
10078 | ch = state2.input.charCodeAt(state2.position);
|
10079 | if (ch !== 34) {
|
10080 | return false;
|
10081 | }
|
10082 | state2.kind = "scalar";
|
10083 | state2.result = "";
|
10084 | state2.position++;
|
10085 | captureStart = captureEnd = state2.position;
|
10086 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
10087 | if (ch === 34) {
|
10088 | captureSegment(state2, captureStart, state2.position, true);
|
10089 | state2.position++;
|
10090 | return true;
|
10091 | } else if (ch === 92) {
|
10092 | captureSegment(state2, captureStart, state2.position, true);
|
10093 | ch = state2.input.charCodeAt(++state2.position);
|
10094 | if (is_EOL(ch)) {
|
10095 | skipSeparationSpace(state2, false, nodeIndent);
|
10096 | } else if (ch < 256 && simpleEscapeCheck[ch]) {
|
10097 | state2.result += simpleEscapeMap[ch];
|
10098 | state2.position++;
|
10099 | } else if ((tmp = escapedHexLen(ch)) > 0) {
|
10100 | hexLength = tmp;
|
10101 | hexResult = 0;
|
10102 | for (; hexLength > 0; hexLength--) {
|
10103 | ch = state2.input.charCodeAt(++state2.position);
|
10104 | if ((tmp = fromHexCode(ch)) >= 0) {
|
10105 | hexResult = (hexResult << 4) + tmp;
|
10106 | } else {
|
10107 | throwError(state2, "expected hexadecimal character");
|
10108 | }
|
10109 | }
|
10110 | state2.result += charFromCodepoint(hexResult);
|
10111 | state2.position++;
|
10112 | } else {
|
10113 | throwError(state2, "unknown escape sequence");
|
10114 | }
|
10115 | captureStart = captureEnd = state2.position;
|
10116 | } else if (is_EOL(ch)) {
|
10117 | captureSegment(state2, captureStart, captureEnd, true);
|
10118 | writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent));
|
10119 | captureStart = captureEnd = state2.position;
|
10120 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
10121 | throwError(state2, "unexpected end of the document within a double quoted scalar");
|
10122 | } else {
|
10123 | state2.position++;
|
10124 | captureEnd = state2.position;
|
10125 | }
|
10126 | }
|
10127 | throwError(state2, "unexpected end of the stream within a double quoted scalar");
|
10128 | }
|
10129 | function readFlowCollection(state2, nodeIndent) {
|
10130 | var readNext = true, _line, _lineStart, _pos, _tag = state2.tag, _result, _anchor = state2.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
|
10131 | ch = state2.input.charCodeAt(state2.position);
|
10132 | if (ch === 91) {
|
10133 | terminator = 93;
|
10134 | isMapping = false;
|
10135 | _result = [];
|
10136 | } else if (ch === 123) {
|
10137 | terminator = 125;
|
10138 | isMapping = true;
|
10139 | _result = {};
|
10140 | } else {
|
10141 | return false;
|
10142 | }
|
10143 | if (state2.anchor !== null) {
|
10144 | state2.anchorMap[state2.anchor] = _result;
|
10145 | }
|
10146 | ch = state2.input.charCodeAt(++state2.position);
|
10147 | while (ch !== 0) {
|
10148 | skipSeparationSpace(state2, true, nodeIndent);
|
10149 | ch = state2.input.charCodeAt(state2.position);
|
10150 | if (ch === terminator) {
|
10151 | state2.position++;
|
10152 | state2.tag = _tag;
|
10153 | state2.anchor = _anchor;
|
10154 | state2.kind = isMapping ? "mapping" : "sequence";
|
10155 | state2.result = _result;
|
10156 | return true;
|
10157 | } else if (!readNext) {
|
10158 | throwError(state2, "missed comma between flow collection entries");
|
10159 | } else if (ch === 44) {
|
10160 | throwError(state2, "expected the node content, but found ','");
|
10161 | }
|
10162 | keyTag = keyNode = valueNode = null;
|
10163 | isPair = isExplicitPair = false;
|
10164 | if (ch === 63) {
|
10165 | following = state2.input.charCodeAt(state2.position + 1);
|
10166 | if (is_WS_OR_EOL(following)) {
|
10167 | isPair = isExplicitPair = true;
|
10168 | state2.position++;
|
10169 | skipSeparationSpace(state2, true, nodeIndent);
|
10170 | }
|
10171 | }
|
10172 | _line = state2.line;
|
10173 | _lineStart = state2.lineStart;
|
10174 | _pos = state2.position;
|
10175 | composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
10176 | keyTag = state2.tag;
|
10177 | keyNode = state2.result;
|
10178 | skipSeparationSpace(state2, true, nodeIndent);
|
10179 | ch = state2.input.charCodeAt(state2.position);
|
10180 | if ((isExplicitPair || state2.line === _line) && ch === 58) {
|
10181 | isPair = true;
|
10182 | ch = state2.input.charCodeAt(++state2.position);
|
10183 | skipSeparationSpace(state2, true, nodeIndent);
|
10184 | composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
10185 | valueNode = state2.result;
|
10186 | }
|
10187 | if (isMapping) {
|
10188 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
10189 | } else if (isPair) {
|
10190 | _result.push(storeMappingPair(state2, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
10191 | } else {
|
10192 | _result.push(keyNode);
|
10193 | }
|
10194 | skipSeparationSpace(state2, true, nodeIndent);
|
10195 | ch = state2.input.charCodeAt(state2.position);
|
10196 | if (ch === 44) {
|
10197 | readNext = true;
|
10198 | ch = state2.input.charCodeAt(++state2.position);
|
10199 | } else {
|
10200 | readNext = false;
|
10201 | }
|
10202 | }
|
10203 | throwError(state2, "unexpected end of the stream within a flow collection");
|
10204 | }
|
10205 | function readBlockScalar(state2, nodeIndent) {
|
10206 | var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
10207 | ch = state2.input.charCodeAt(state2.position);
|
10208 | if (ch === 124) {
|
10209 | folding = false;
|
10210 | } else if (ch === 62) {
|
10211 | folding = true;
|
10212 | } else {
|
10213 | return false;
|
10214 | }
|
10215 | state2.kind = "scalar";
|
10216 | state2.result = "";
|
10217 | while (ch !== 0) {
|
10218 | ch = state2.input.charCodeAt(++state2.position);
|
10219 | if (ch === 43 || ch === 45) {
|
10220 | if (CHOMPING_CLIP === chomping) {
|
10221 | chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
10222 | } else {
|
10223 | throwError(state2, "repeat of a chomping mode identifier");
|
10224 | }
|
10225 | } else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
10226 | if (tmp === 0) {
|
10227 | throwError(state2, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
10228 | } else if (!detectedIndent) {
|
10229 | textIndent = nodeIndent + tmp - 1;
|
10230 | detectedIndent = true;
|
10231 | } else {
|
10232 | throwError(state2, "repeat of an indentation width identifier");
|
10233 | }
|
10234 | } else {
|
10235 | break;
|
10236 | }
|
10237 | }
|
10238 | if (is_WHITE_SPACE(ch)) {
|
10239 | do {
|
10240 | ch = state2.input.charCodeAt(++state2.position);
|
10241 | } while (is_WHITE_SPACE(ch));
|
10242 | if (ch === 35) {
|
10243 | do {
|
10244 | ch = state2.input.charCodeAt(++state2.position);
|
10245 | } while (!is_EOL(ch) && ch !== 0);
|
10246 | }
|
10247 | }
|
10248 | while (ch !== 0) {
|
10249 | readLineBreak(state2);
|
10250 | state2.lineIndent = 0;
|
10251 | ch = state2.input.charCodeAt(state2.position);
|
10252 | while ((!detectedIndent || state2.lineIndent < textIndent) && ch === 32) {
|
10253 | state2.lineIndent++;
|
10254 | ch = state2.input.charCodeAt(++state2.position);
|
10255 | }
|
10256 | if (!detectedIndent && state2.lineIndent > textIndent) {
|
10257 | textIndent = state2.lineIndent;
|
10258 | }
|
10259 | if (is_EOL(ch)) {
|
10260 | emptyLines++;
|
10261 | continue;
|
10262 | }
|
10263 | if (state2.lineIndent < textIndent) {
|
10264 | if (chomping === CHOMPING_KEEP) {
|
10265 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
10266 | } else if (chomping === CHOMPING_CLIP) {
|
10267 | if (didReadContent) {
|
10268 | state2.result += "\n";
|
10269 | }
|
10270 | }
|
10271 | break;
|
10272 | }
|
10273 | if (folding) {
|
10274 | if (is_WHITE_SPACE(ch)) {
|
10275 | atMoreIndented = true;
|
10276 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
10277 | } else if (atMoreIndented) {
|
10278 | atMoreIndented = false;
|
10279 | state2.result += common.repeat("\n", emptyLines + 1);
|
10280 | } else if (emptyLines === 0) {
|
10281 | if (didReadContent) {
|
10282 | state2.result += " ";
|
10283 | }
|
10284 | } else {
|
10285 | state2.result += common.repeat("\n", emptyLines);
|
10286 | }
|
10287 | } else {
|
10288 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
10289 | }
|
10290 | didReadContent = true;
|
10291 | detectedIndent = true;
|
10292 | emptyLines = 0;
|
10293 | captureStart = state2.position;
|
10294 | while (!is_EOL(ch) && ch !== 0) {
|
10295 | ch = state2.input.charCodeAt(++state2.position);
|
10296 | }
|
10297 | captureSegment(state2, captureStart, state2.position, false);
|
10298 | }
|
10299 | return true;
|
10300 | }
|
10301 | function readBlockSequence(state2, nodeIndent) {
|
10302 | var _line, _tag = state2.tag, _anchor = state2.anchor, _result = [], following, detected = false, ch;
|
10303 | if (state2.firstTabInLine !== -1)
|
10304 | return false;
|
10305 | if (state2.anchor !== null) {
|
10306 | state2.anchorMap[state2.anchor] = _result;
|
10307 | }
|
10308 | ch = state2.input.charCodeAt(state2.position);
|
10309 | while (ch !== 0) {
|
10310 | if (state2.firstTabInLine !== -1) {
|
10311 | state2.position = state2.firstTabInLine;
|
10312 | throwError(state2, "tab characters must not be used in indentation");
|
10313 | }
|
10314 | if (ch !== 45) {
|
10315 | break;
|
10316 | }
|
10317 | following = state2.input.charCodeAt(state2.position + 1);
|
10318 | if (!is_WS_OR_EOL(following)) {
|
10319 | break;
|
10320 | }
|
10321 | detected = true;
|
10322 | state2.position++;
|
10323 | if (skipSeparationSpace(state2, true, -1)) {
|
10324 | if (state2.lineIndent <= nodeIndent) {
|
10325 | _result.push(null);
|
10326 | ch = state2.input.charCodeAt(state2.position);
|
10327 | continue;
|
10328 | }
|
10329 | }
|
10330 | _line = state2.line;
|
10331 | composeNode(state2, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
10332 | _result.push(state2.result);
|
10333 | skipSeparationSpace(state2, true, -1);
|
10334 | ch = state2.input.charCodeAt(state2.position);
|
10335 | if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) {
|
10336 | throwError(state2, "bad indentation of a sequence entry");
|
10337 | } else if (state2.lineIndent < nodeIndent) {
|
10338 | break;
|
10339 | }
|
10340 | }
|
10341 | if (detected) {
|
10342 | state2.tag = _tag;
|
10343 | state2.anchor = _anchor;
|
10344 | state2.kind = "sequence";
|
10345 | state2.result = _result;
|
10346 | return true;
|
10347 | }
|
10348 | return false;
|
10349 | }
|
10350 | function readBlockMapping(state2, nodeIndent, flowIndent) {
|
10351 | var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state2.tag, _anchor = state2.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
10352 | if (state2.firstTabInLine !== -1)
|
10353 | return false;
|
10354 | if (state2.anchor !== null) {
|
10355 | state2.anchorMap[state2.anchor] = _result;
|
10356 | }
|
10357 | ch = state2.input.charCodeAt(state2.position);
|
10358 | while (ch !== 0) {
|
10359 | if (!atExplicitKey && state2.firstTabInLine !== -1) {
|
10360 | state2.position = state2.firstTabInLine;
|
10361 | throwError(state2, "tab characters must not be used in indentation");
|
10362 | }
|
10363 | following = state2.input.charCodeAt(state2.position + 1);
|
10364 | _line = state2.line;
|
10365 | if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
10366 | if (ch === 63) {
|
10367 | if (atExplicitKey) {
|
10368 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
10369 | keyTag = keyNode = valueNode = null;
|
10370 | }
|
10371 | detected = true;
|
10372 | atExplicitKey = true;
|
10373 | allowCompact = true;
|
10374 | } else if (atExplicitKey) {
|
10375 | atExplicitKey = false;
|
10376 | allowCompact = true;
|
10377 | } else {
|
10378 | throwError(state2, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
10379 | }
|
10380 | state2.position += 1;
|
10381 | ch = following;
|
10382 | } else {
|
10383 | _keyLine = state2.line;
|
10384 | _keyLineStart = state2.lineStart;
|
10385 | _keyPos = state2.position;
|
10386 | if (!composeNode(state2, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
10387 | break;
|
10388 | }
|
10389 | if (state2.line === _line) {
|
10390 | ch = state2.input.charCodeAt(state2.position);
|
10391 | while (is_WHITE_SPACE(ch)) {
|
10392 | ch = state2.input.charCodeAt(++state2.position);
|
10393 | }
|
10394 | if (ch === 58) {
|
10395 | ch = state2.input.charCodeAt(++state2.position);
|
10396 | if (!is_WS_OR_EOL(ch)) {
|
10397 | throwError(state2, "a whitespace character is expected after the key-value separator within a block mapping");
|
10398 | }
|
10399 | if (atExplicitKey) {
|
10400 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
10401 | keyTag = keyNode = valueNode = null;
|
10402 | }
|
10403 | detected = true;
|
10404 | atExplicitKey = false;
|
10405 | allowCompact = false;
|
10406 | keyTag = state2.tag;
|
10407 | keyNode = state2.result;
|
10408 | } else if (detected) {
|
10409 | throwError(state2, "can not read an implicit mapping pair; a colon is missed");
|
10410 | } else {
|
10411 | state2.tag = _tag;
|
10412 | state2.anchor = _anchor;
|
10413 | return true;
|
10414 | }
|
10415 | } else if (detected) {
|
10416 | throwError(state2, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
10417 | } else {
|
10418 | state2.tag = _tag;
|
10419 | state2.anchor = _anchor;
|
10420 | return true;
|
10421 | }
|
10422 | }
|
10423 | if (state2.line === _line || state2.lineIndent > nodeIndent) {
|
10424 | if (atExplicitKey) {
|
10425 | _keyLine = state2.line;
|
10426 | _keyLineStart = state2.lineStart;
|
10427 | _keyPos = state2.position;
|
10428 | }
|
10429 | if (composeNode(state2, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
10430 | if (atExplicitKey) {
|
10431 | keyNode = state2.result;
|
10432 | } else {
|
10433 | valueNode = state2.result;
|
10434 | }
|
10435 | }
|
10436 | if (!atExplicitKey) {
|
10437 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
10438 | keyTag = keyNode = valueNode = null;
|
10439 | }
|
10440 | skipSeparationSpace(state2, true, -1);
|
10441 | ch = state2.input.charCodeAt(state2.position);
|
10442 | }
|
10443 | if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) {
|
10444 | throwError(state2, "bad indentation of a mapping entry");
|
10445 | } else if (state2.lineIndent < nodeIndent) {
|
10446 | break;
|
10447 | }
|
10448 | }
|
10449 | if (atExplicitKey) {
|
10450 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
10451 | }
|
10452 | if (detected) {
|
10453 | state2.tag = _tag;
|
10454 | state2.anchor = _anchor;
|
10455 | state2.kind = "mapping";
|
10456 | state2.result = _result;
|
10457 | }
|
10458 | return detected;
|
10459 | }
|
10460 | function readTagProperty(state2) {
|
10461 | var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
10462 | ch = state2.input.charCodeAt(state2.position);
|
10463 | if (ch !== 33)
|
10464 | return false;
|
10465 | if (state2.tag !== null) {
|
10466 | throwError(state2, "duplication of a tag property");
|
10467 | }
|
10468 | ch = state2.input.charCodeAt(++state2.position);
|
10469 | if (ch === 60) {
|
10470 | isVerbatim = true;
|
10471 | ch = state2.input.charCodeAt(++state2.position);
|
10472 | } else if (ch === 33) {
|
10473 | isNamed = true;
|
10474 | tagHandle = "!!";
|
10475 | ch = state2.input.charCodeAt(++state2.position);
|
10476 | } else {
|
10477 | tagHandle = "!";
|
10478 | }
|
10479 | _position = state2.position;
|
10480 | if (isVerbatim) {
|
10481 | do {
|
10482 | ch = state2.input.charCodeAt(++state2.position);
|
10483 | } while (ch !== 0 && ch !== 62);
|
10484 | if (state2.position < state2.length) {
|
10485 | tagName = state2.input.slice(_position, state2.position);
|
10486 | ch = state2.input.charCodeAt(++state2.position);
|
10487 | } else {
|
10488 | throwError(state2, "unexpected end of the stream within a verbatim tag");
|
10489 | }
|
10490 | } else {
|
10491 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
10492 | if (ch === 33) {
|
10493 | if (!isNamed) {
|
10494 | tagHandle = state2.input.slice(_position - 1, state2.position + 1);
|
10495 | if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
10496 | throwError(state2, "named tag handle cannot contain such characters");
|
10497 | }
|
10498 | isNamed = true;
|
10499 | _position = state2.position + 1;
|
10500 | } else {
|
10501 | throwError(state2, "tag suffix cannot contain exclamation marks");
|
10502 | }
|
10503 | }
|
10504 | ch = state2.input.charCodeAt(++state2.position);
|
10505 | }
|
10506 | tagName = state2.input.slice(_position, state2.position);
|
10507 | if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
10508 | throwError(state2, "tag suffix cannot contain flow indicator characters");
|
10509 | }
|
10510 | }
|
10511 | if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
10512 | throwError(state2, "tag name cannot contain such characters: " + tagName);
|
10513 | }
|
10514 | try {
|
10515 | tagName = decodeURIComponent(tagName);
|
10516 | } catch (err) {
|
10517 | throwError(state2, "tag name is malformed: " + tagName);
|
10518 | }
|
10519 | if (isVerbatim) {
|
10520 | state2.tag = tagName;
|
10521 | } else if (_hasOwnProperty$1.call(state2.tagMap, tagHandle)) {
|
10522 | state2.tag = state2.tagMap[tagHandle] + tagName;
|
10523 | } else if (tagHandle === "!") {
|
10524 | state2.tag = "!" + tagName;
|
10525 | } else if (tagHandle === "!!") {
|
10526 | state2.tag = "tag:yaml.org,2002:" + tagName;
|
10527 | } else {
|
10528 | throwError(state2, 'undeclared tag handle "' + tagHandle + '"');
|
10529 | }
|
10530 | return true;
|
10531 | }
|
10532 | function readAnchorProperty(state2) {
|
10533 | var _position, ch;
|
10534 | ch = state2.input.charCodeAt(state2.position);
|
10535 | if (ch !== 38)
|
10536 | return false;
|
10537 | if (state2.anchor !== null) {
|
10538 | throwError(state2, "duplication of an anchor property");
|
10539 | }
|
10540 | ch = state2.input.charCodeAt(++state2.position);
|
10541 | _position = state2.position;
|
10542 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
10543 | ch = state2.input.charCodeAt(++state2.position);
|
10544 | }
|
10545 | if (state2.position === _position) {
|
10546 | throwError(state2, "name of an anchor node must contain at least one character");
|
10547 | }
|
10548 | state2.anchor = state2.input.slice(_position, state2.position);
|
10549 | return true;
|
10550 | }
|
10551 | function readAlias(state2) {
|
10552 | var _position, alias, ch;
|
10553 | ch = state2.input.charCodeAt(state2.position);
|
10554 | if (ch !== 42)
|
10555 | return false;
|
10556 | ch = state2.input.charCodeAt(++state2.position);
|
10557 | _position = state2.position;
|
10558 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
10559 | ch = state2.input.charCodeAt(++state2.position);
|
10560 | }
|
10561 | if (state2.position === _position) {
|
10562 | throwError(state2, "name of an alias node must contain at least one character");
|
10563 | }
|
10564 | alias = state2.input.slice(_position, state2.position);
|
10565 | if (!_hasOwnProperty$1.call(state2.anchorMap, alias)) {
|
10566 | throwError(state2, 'unidentified alias "' + alias + '"');
|
10567 | }
|
10568 | state2.result = state2.anchorMap[alias];
|
10569 | skipSeparationSpace(state2, true, -1);
|
10570 | return true;
|
10571 | }
|
10572 | function composeNode(state2, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
10573 | var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
|
10574 | if (state2.listener !== null) {
|
10575 | state2.listener("open", state2);
|
10576 | }
|
10577 | state2.tag = null;
|
10578 | state2.anchor = null;
|
10579 | state2.kind = null;
|
10580 | state2.result = null;
|
10581 | allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
10582 | if (allowToSeek) {
|
10583 | if (skipSeparationSpace(state2, true, -1)) {
|
10584 | atNewLine = true;
|
10585 | if (state2.lineIndent > parentIndent) {
|
10586 | indentStatus = 1;
|
10587 | } else if (state2.lineIndent === parentIndent) {
|
10588 | indentStatus = 0;
|
10589 | } else if (state2.lineIndent < parentIndent) {
|
10590 | indentStatus = -1;
|
10591 | }
|
10592 | }
|
10593 | }
|
10594 | if (indentStatus === 1) {
|
10595 | while (readTagProperty(state2) || readAnchorProperty(state2)) {
|
10596 | if (skipSeparationSpace(state2, true, -1)) {
|
10597 | atNewLine = true;
|
10598 | allowBlockCollections = allowBlockStyles;
|
10599 | if (state2.lineIndent > parentIndent) {
|
10600 | indentStatus = 1;
|
10601 | } else if (state2.lineIndent === parentIndent) {
|
10602 | indentStatus = 0;
|
10603 | } else if (state2.lineIndent < parentIndent) {
|
10604 | indentStatus = -1;
|
10605 | }
|
10606 | } else {
|
10607 | allowBlockCollections = false;
|
10608 | }
|
10609 | }
|
10610 | }
|
10611 | if (allowBlockCollections) {
|
10612 | allowBlockCollections = atNewLine || allowCompact;
|
10613 | }
|
10614 | if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
10615 | if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
10616 | flowIndent = parentIndent;
|
10617 | } else {
|
10618 | flowIndent = parentIndent + 1;
|
10619 | }
|
10620 | blockIndent = state2.position - state2.lineStart;
|
10621 | if (indentStatus === 1) {
|
10622 | if (allowBlockCollections && (readBlockSequence(state2, blockIndent) || readBlockMapping(state2, blockIndent, flowIndent)) || readFlowCollection(state2, flowIndent)) {
|
10623 | hasContent = true;
|
10624 | } else {
|
10625 | if (allowBlockScalars && readBlockScalar(state2, flowIndent) || readSingleQuotedScalar(state2, flowIndent) || readDoubleQuotedScalar(state2, flowIndent)) {
|
10626 | hasContent = true;
|
10627 | } else if (readAlias(state2)) {
|
10628 | hasContent = true;
|
10629 | if (state2.tag !== null || state2.anchor !== null) {
|
10630 | throwError(state2, "alias node should not have any properties");
|
10631 | }
|
10632 | } else if (readPlainScalar(state2, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
10633 | hasContent = true;
|
10634 | if (state2.tag === null) {
|
10635 | state2.tag = "?";
|
10636 | }
|
10637 | }
|
10638 | if (state2.anchor !== null) {
|
10639 | state2.anchorMap[state2.anchor] = state2.result;
|
10640 | }
|
10641 | }
|
10642 | } else if (indentStatus === 0) {
|
10643 | hasContent = allowBlockCollections && readBlockSequence(state2, blockIndent);
|
10644 | }
|
10645 | }
|
10646 | if (state2.tag === null) {
|
10647 | if (state2.anchor !== null) {
|
10648 | state2.anchorMap[state2.anchor] = state2.result;
|
10649 | }
|
10650 | } else if (state2.tag === "?") {
|
10651 | if (state2.result !== null && state2.kind !== "scalar") {
|
10652 | throwError(state2, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state2.kind + '"');
|
10653 | }
|
10654 | for (typeIndex = 0, typeQuantity = state2.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
10655 | type2 = state2.implicitTypes[typeIndex];
|
10656 | if (type2.resolve(state2.result)) {
|
10657 | state2.result = type2.construct(state2.result);
|
10658 | state2.tag = type2.tag;
|
10659 | if (state2.anchor !== null) {
|
10660 | state2.anchorMap[state2.anchor] = state2.result;
|
10661 | }
|
10662 | break;
|
10663 | }
|
10664 | }
|
10665 | } else if (state2.tag !== "!") {
|
10666 | if (_hasOwnProperty$1.call(state2.typeMap[state2.kind || "fallback"], state2.tag)) {
|
10667 | type2 = state2.typeMap[state2.kind || "fallback"][state2.tag];
|
10668 | } else {
|
10669 | type2 = null;
|
10670 | typeList = state2.typeMap.multi[state2.kind || "fallback"];
|
10671 | for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
10672 | if (state2.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
10673 | type2 = typeList[typeIndex];
|
10674 | break;
|
10675 | }
|
10676 | }
|
10677 | }
|
10678 | if (!type2) {
|
10679 | throwError(state2, "unknown tag !<" + state2.tag + ">");
|
10680 | }
|
10681 | if (state2.result !== null && type2.kind !== state2.kind) {
|
10682 | throwError(state2, "unacceptable node kind for !<" + state2.tag + '> tag; it should be "' + type2.kind + '", not "' + state2.kind + '"');
|
10683 | }
|
10684 | if (!type2.resolve(state2.result, state2.tag)) {
|
10685 | throwError(state2, "cannot resolve a node with !<" + state2.tag + "> explicit tag");
|
10686 | } else {
|
10687 | state2.result = type2.construct(state2.result, state2.tag);
|
10688 | if (state2.anchor !== null) {
|
10689 | state2.anchorMap[state2.anchor] = state2.result;
|
10690 | }
|
10691 | }
|
10692 | }
|
10693 | if (state2.listener !== null) {
|
10694 | state2.listener("close", state2);
|
10695 | }
|
10696 | return state2.tag !== null || state2.anchor !== null || hasContent;
|
10697 | }
|
10698 | function readDocument(state2) {
|
10699 | var documentStart = state2.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
10700 | state2.version = null;
|
10701 | state2.checkLineBreaks = state2.legacy;
|
10702 | state2.tagMap = Object.create(null);
|
10703 | state2.anchorMap = Object.create(null);
|
10704 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
10705 | skipSeparationSpace(state2, true, -1);
|
10706 | ch = state2.input.charCodeAt(state2.position);
|
10707 | if (state2.lineIndent > 0 || ch !== 37) {
|
10708 | break;
|
10709 | }
|
10710 | hasDirectives = true;
|
10711 | ch = state2.input.charCodeAt(++state2.position);
|
10712 | _position = state2.position;
|
10713 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
10714 | ch = state2.input.charCodeAt(++state2.position);
|
10715 | }
|
10716 | directiveName = state2.input.slice(_position, state2.position);
|
10717 | directiveArgs = [];
|
10718 | if (directiveName.length < 1) {
|
10719 | throwError(state2, "directive name must not be less than one character in length");
|
10720 | }
|
10721 | while (ch !== 0) {
|
10722 | while (is_WHITE_SPACE(ch)) {
|
10723 | ch = state2.input.charCodeAt(++state2.position);
|
10724 | }
|
10725 | if (ch === 35) {
|
10726 | do {
|
10727 | ch = state2.input.charCodeAt(++state2.position);
|
10728 | } while (ch !== 0 && !is_EOL(ch));
|
10729 | break;
|
10730 | }
|
10731 | if (is_EOL(ch))
|
10732 | break;
|
10733 | _position = state2.position;
|
10734 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
10735 | ch = state2.input.charCodeAt(++state2.position);
|
10736 | }
|
10737 | directiveArgs.push(state2.input.slice(_position, state2.position));
|
10738 | }
|
10739 | if (ch !== 0)
|
10740 | readLineBreak(state2);
|
10741 | if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
|
10742 | directiveHandlers[directiveName](state2, directiveName, directiveArgs);
|
10743 | } else {
|
10744 | throwWarning(state2, 'unknown document directive "' + directiveName + '"');
|
10745 | }
|
10746 | }
|
10747 | skipSeparationSpace(state2, true, -1);
|
10748 | if (state2.lineIndent === 0 && state2.input.charCodeAt(state2.position) === 45 && state2.input.charCodeAt(state2.position + 1) === 45 && state2.input.charCodeAt(state2.position + 2) === 45) {
|
10749 | state2.position += 3;
|
10750 | skipSeparationSpace(state2, true, -1);
|
10751 | } else if (hasDirectives) {
|
10752 | throwError(state2, "directives end mark is expected");
|
10753 | }
|
10754 | composeNode(state2, state2.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
10755 | skipSeparationSpace(state2, true, -1);
|
10756 | if (state2.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state2.input.slice(documentStart, state2.position))) {
|
10757 | throwWarning(state2, "non-ASCII line breaks are interpreted as content");
|
10758 | }
|
10759 | state2.documents.push(state2.result);
|
10760 | if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
10761 | if (state2.input.charCodeAt(state2.position) === 46) {
|
10762 | state2.position += 3;
|
10763 | skipSeparationSpace(state2, true, -1);
|
10764 | }
|
10765 | return;
|
10766 | }
|
10767 | if (state2.position < state2.length - 1) {
|
10768 | throwError(state2, "end of the stream or a document separator is expected");
|
10769 | } else {
|
10770 | return;
|
10771 | }
|
10772 | }
|
10773 | function loadDocuments(input, options) {
|
10774 | input = String(input);
|
10775 | options = options || {};
|
10776 | if (input.length !== 0) {
|
10777 | if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
10778 | input += "\n";
|
10779 | }
|
10780 | if (input.charCodeAt(0) === 65279) {
|
10781 | input = input.slice(1);
|
10782 | }
|
10783 | }
|
10784 | var state2 = new State$1(input, options);
|
10785 | var nullpos = input.indexOf("\0");
|
10786 | if (nullpos !== -1) {
|
10787 | state2.position = nullpos;
|
10788 | throwError(state2, "null byte is not allowed in input");
|
10789 | }
|
10790 | state2.input += "\0";
|
10791 | while (state2.input.charCodeAt(state2.position) === 32) {
|
10792 | state2.lineIndent += 1;
|
10793 | state2.position += 1;
|
10794 | }
|
10795 | while (state2.position < state2.length - 1) {
|
10796 | readDocument(state2);
|
10797 | }
|
10798 | return state2.documents;
|
10799 | }
|
10800 | function loadAll$1(input, iterator2, options) {
|
10801 | if (iterator2 !== null && typeof iterator2 === "object" && typeof options === "undefined") {
|
10802 | options = iterator2;
|
10803 | iterator2 = null;
|
10804 | }
|
10805 | var documents = loadDocuments(input, options);
|
10806 | if (typeof iterator2 !== "function") {
|
10807 | return documents;
|
10808 | }
|
10809 | for (var index = 0, length2 = documents.length; index < length2; index += 1) {
|
10810 | iterator2(documents[index]);
|
10811 | }
|
10812 | }
|
10813 | function load$1(input, options) {
|
10814 | var documents = loadDocuments(input, options);
|
10815 | if (documents.length === 0) {
|
10816 | return void 0;
|
10817 | } else if (documents.length === 1) {
|
10818 | return documents[0];
|
10819 | }
|
10820 | throw new exception("expected a single document in the stream, but found more");
|
10821 | }
|
10822 | var loadAll_1 = loadAll$1;
|
10823 | var load_1 = load$1;
|
10824 | var loader$j = {
|
10825 | loadAll: loadAll_1,
|
10826 | load: load_1
|
10827 | };
|
10828 | var FAILSAFE_SCHEMA = failsafe;
|
10829 | var load = loader$j.load;
|
10830 | const frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
|
10831 | function extractFrontMatter(text2, db) {
|
10832 | var _a, _b;
|
10833 | const matches = text2.match(frontMatterRegex);
|
10834 | if (matches) {
|
10835 | const parsed = load(matches[1], {
|
10836 |
|
10837 |
|
10838 | schema: FAILSAFE_SCHEMA
|
10839 | });
|
10840 | if (parsed == null ? void 0 : parsed.title) {
|
10841 | (_a = db.setDiagramTitle) == null ? void 0 : _a.call(db, parsed.title);
|
10842 | }
|
10843 | if (parsed == null ? void 0 : parsed.displayMode) {
|
10844 | (_b = db.setDisplayMode) == null ? void 0 : _b.call(db, parsed.displayMode);
|
10845 | }
|
10846 | return text2.slice(matches[0].length);
|
10847 | } else {
|
10848 | return text2;
|
10849 | }
|
10850 | }
|
10851 | const assignWithDepth = function(dst, src, config2) {
|
10852 | const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config2);
|
10853 | if (Array.isArray(src) && !Array.isArray(dst)) {
|
10854 | src.forEach((s) => assignWithDepth(dst, s, config2));
|
10855 | return dst;
|
10856 | } else if (Array.isArray(src) && Array.isArray(dst)) {
|
10857 | src.forEach((s) => {
|
10858 | if (!dst.includes(s)) {
|
10859 | dst.push(s);
|
10860 | }
|
10861 | });
|
10862 | return dst;
|
10863 | }
|
10864 | if (dst === void 0 || depth <= 0) {
|
10865 | if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") {
|
10866 | return Object.assign(dst, src);
|
10867 | } else {
|
10868 | return src;
|
10869 | }
|
10870 | }
|
10871 | if (src !== void 0 && typeof dst === "object" && typeof src === "object") {
|
10872 | Object.keys(src).forEach((key) => {
|
10873 | if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) {
|
10874 | if (dst[key] === void 0) {
|
10875 | dst[key] = Array.isArray(src[key]) ? [] : {};
|
10876 | }
|
10877 | dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });
|
10878 | } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") {
|
10879 | dst[key] = src[key];
|
10880 | }
|
10881 | });
|
10882 | }
|
10883 | return dst;
|
10884 | };
|
10885 | const assignWithDepth$1 = assignWithDepth;
|
10886 | const defaultConfig = Object.freeze(defaultConfig$1);
|
10887 | let siteConfig = assignWithDepth$1({}, defaultConfig);
|
10888 | let configFromInitialize;
|
10889 | let directives = [];
|
10890 | let currentConfig = assignWithDepth$1({}, defaultConfig);
|
10891 | const updateCurrentConfig = (siteCfg, _directives) => {
|
10892 | let cfg = assignWithDepth$1({}, siteCfg);
|
10893 | let sumOfDirectives = {};
|
10894 | for (const d of _directives) {
|
10895 | sanitize(d);
|
10896 | sumOfDirectives = assignWithDepth$1(sumOfDirectives, d);
|
10897 | }
|
10898 | cfg = assignWithDepth$1(cfg, sumOfDirectives);
|
10899 | if (sumOfDirectives.theme && sumOfDirectives.theme in theme) {
|
10900 | const tmpConfigFromInitialize = assignWithDepth$1({}, configFromInitialize);
|
10901 | const themeVariables = assignWithDepth$1(
|
10902 | tmpConfigFromInitialize.themeVariables || {},
|
10903 | sumOfDirectives.themeVariables
|
10904 | );
|
10905 | if (cfg.theme && cfg.theme in theme) {
|
10906 | cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables);
|
10907 | }
|
10908 | }
|
10909 | currentConfig = cfg;
|
10910 | checkConfig(currentConfig);
|
10911 | return currentConfig;
|
10912 | };
|
10913 | const setSiteConfig = (conf) => {
|
10914 | siteConfig = assignWithDepth$1({}, defaultConfig);
|
10915 | siteConfig = assignWithDepth$1(siteConfig, conf);
|
10916 | if (conf.theme && theme[conf.theme]) {
|
10917 | siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);
|
10918 | }
|
10919 | updateCurrentConfig(siteConfig, directives);
|
10920 | return siteConfig;
|
10921 | };
|
10922 | const saveConfigFromInitialize = (conf) => {
|
10923 | configFromInitialize = assignWithDepth$1({}, conf);
|
10924 | };
|
10925 | const updateSiteConfig = (conf) => {
|
10926 | siteConfig = assignWithDepth$1(siteConfig, conf);
|
10927 | updateCurrentConfig(siteConfig, directives);
|
10928 | return siteConfig;
|
10929 | };
|
10930 | const getSiteConfig = () => {
|
10931 | return assignWithDepth$1({}, siteConfig);
|
10932 | };
|
10933 | const setConfig = (conf) => {
|
10934 | checkConfig(conf);
|
10935 | assignWithDepth$1(currentConfig, conf);
|
10936 | return getConfig$1();
|
10937 | };
|
10938 | const getConfig$1 = () => {
|
10939 | return assignWithDepth$1({}, currentConfig);
|
10940 | };
|
10941 | const sanitize = (options) => {
|
10942 | ["secure", ...siteConfig.secure ?? []].forEach((key) => {
|
10943 | if (options[key] !== void 0) {
|
10944 | log$1.debug(`Denied attempt to modify a secure key ${key}`, options[key]);
|
10945 | delete options[key];
|
10946 | }
|
10947 | });
|
10948 | Object.keys(options).forEach((key) => {
|
10949 | if (key.indexOf("__") === 0) {
|
10950 | delete options[key];
|
10951 | }
|
10952 | });
|
10953 | Object.keys(options).forEach((key) => {
|
10954 | if (typeof options[key] === "string" && (options[key].includes("<") || options[key].includes(">") || options[key].includes("url(data:"))) {
|
10955 | delete options[key];
|
10956 | }
|
10957 | if (typeof options[key] === "object") {
|
10958 | sanitize(options[key]);
|
10959 | }
|
10960 | });
|
10961 | };
|
10962 | const addDirective = (directive2) => {
|
10963 | if (directive2.fontFamily) {
|
10964 | if (!directive2.themeVariables) {
|
10965 | directive2.themeVariables = { fontFamily: directive2.fontFamily };
|
10966 | } else {
|
10967 | if (!directive2.themeVariables.fontFamily) {
|
10968 | directive2.themeVariables = { fontFamily: directive2.fontFamily };
|
10969 | }
|
10970 | }
|
10971 | }
|
10972 | directives.push(directive2);
|
10973 | updateCurrentConfig(siteConfig, directives);
|
10974 | };
|
10975 | const reset = (config2 = siteConfig) => {
|
10976 | directives = [];
|
10977 | updateCurrentConfig(config2, directives);
|
10978 | };
|
10979 | var ConfigWarning = ((ConfigWarning2) => {
|
10980 | ConfigWarning2["LAZY_LOAD_DEPRECATED"] = "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.";
|
10981 | return ConfigWarning2;
|
10982 | })(ConfigWarning || {});
|
10983 | const issuedWarnings = {};
|
10984 | const issueWarning = (warning) => {
|
10985 | if (issuedWarnings[warning]) {
|
10986 | return;
|
10987 | }
|
10988 | log$1.warn(ConfigWarning[warning]);
|
10989 | issuedWarnings[warning] = true;
|
10990 | };
|
10991 | const checkConfig = (config2) => {
|
10992 | if (!config2) {
|
10993 | return;
|
10994 | }
|
10995 | if (config2.lazyLoadedDiagrams || config2.loadExternalDiagramsAtStartup) {
|
10996 | issueWarning("LAZY_LOAD_DEPRECATED");
|
10997 | }
|
10998 | };
|
10999 | const d3Attrs = function(d3Elem, attrs) {
|
11000 | for (let attr of attrs) {
|
11001 | d3Elem.attr(attr[0], attr[1]);
|
11002 | }
|
11003 | };
|
11004 | const calculateSvgSizeAttrs = function(height, width, useMaxWidth) {
|
11005 | let attrs = new Map();
|
11006 | if (useMaxWidth) {
|
11007 | attrs.set("width", "100%");
|
11008 | attrs.set("style", `max-width: ${width}px;`);
|
11009 | } else {
|
11010 | attrs.set("height", height);
|
11011 | attrs.set("width", width);
|
11012 | }
|
11013 | return attrs;
|
11014 | };
|
11015 | const configureSvgSize = function(svgElem, height, width, useMaxWidth) {
|
11016 | const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
|
11017 | d3Attrs(svgElem, attrs);
|
11018 | };
|
11019 | const setupGraphViewbox$1 = function(graph, svgElem, padding, useMaxWidth) {
|
11020 | const svgBounds = svgElem.node().getBBox();
|
11021 | const sWidth = svgBounds.width;
|
11022 | const sHeight = svgBounds.height;
|
11023 | log$1.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds);
|
11024 | let width = 0;
|
11025 | let height = 0;
|
11026 | log$1.info(`Graph bounds: ${width}x${height}`, graph);
|
11027 | width = sWidth + padding * 2;
|
11028 | height = sHeight + padding * 2;
|
11029 | log$1.info(`Calculated bounds: ${width}x${height}`);
|
11030 | configureSvgSize(svgElem, height, width, useMaxWidth);
|
11031 | const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${svgBounds.width + 2 * padding} ${svgBounds.height + 2 * padding}`;
|
11032 | svgElem.attr("viewBox", vBox);
|
11033 | };
|
11034 | const themes = {};
|
11035 | const getStyles$1 = (type2, userStyles, options) => {
|
11036 | let diagramStyles = "";
|
11037 | if (type2 in themes && themes[type2]) {
|
11038 | diagramStyles = themes[type2](options);
|
11039 | } else {
|
11040 | log$1.warn(`No theme found for ${type2}`);
|
11041 | }
|
11042 | return ` & {
|
11043 | font-family: ${options.fontFamily};
|
11044 | font-size: ${options.fontSize};
|
11045 | fill: ${options.textColor}
|
11046 | }
|
11047 |
|
11048 | /* Classes common for multiple diagrams */
|
11049 |
|
11050 | & .error-icon {
|
11051 | fill: ${options.errorBkgColor};
|
11052 | }
|
11053 | & .error-text {
|
11054 | fill: ${options.errorTextColor};
|
11055 | stroke: ${options.errorTextColor};
|
11056 | }
|
11057 |
|
11058 | & .edge-thickness-normal {
|
11059 | stroke-width: 2px;
|
11060 | }
|
11061 | & .edge-thickness-thick {
|
11062 | stroke-width: 3.5px
|
11063 | }
|
11064 | & .edge-pattern-solid {
|
11065 | stroke-dasharray: 0;
|
11066 | }
|
11067 |
|
11068 | & .edge-pattern-dashed{
|
11069 | stroke-dasharray: 3;
|
11070 | }
|
11071 | .edge-pattern-dotted {
|
11072 | stroke-dasharray: 2;
|
11073 | }
|
11074 |
|
11075 | & .marker {
|
11076 | fill: ${options.lineColor};
|
11077 | stroke: ${options.lineColor};
|
11078 | }
|
11079 | & .marker.cross {
|
11080 | stroke: ${options.lineColor};
|
11081 | }
|
11082 |
|
11083 | & svg {
|
11084 | font-family: ${options.fontFamily};
|
11085 | font-size: ${options.fontSize};
|
11086 | }
|
11087 |
|
11088 | ${diagramStyles}
|
11089 |
|
11090 | ${userStyles}
|
11091 | `;
|
11092 | };
|
11093 | const addStylesForDiagram = (type2, diagramTheme) => {
|
11094 | themes[type2] = diagramTheme;
|
11095 | };
|
11096 | const getStyles$2 = getStyles$1;
|
11097 | let title = "";
|
11098 | let diagramTitle = "";
|
11099 | let description = "";
|
11100 | const sanitizeText$1 = (txt) => sanitizeText$2(txt, getConfig$1());
|
11101 | const clear = function() {
|
11102 | title = "";
|
11103 | description = "";
|
11104 | diagramTitle = "";
|
11105 | };
|
11106 | const setAccTitle = function(txt) {
|
11107 | title = sanitizeText$1(txt).replace(/^\s+/g, "");
|
11108 | };
|
11109 | const getAccTitle = function() {
|
11110 | return title || diagramTitle;
|
11111 | };
|
11112 | const setAccDescription = function(txt) {
|
11113 | description = sanitizeText$1(txt).replace(/\n\s+/g, "\n");
|
11114 | };
|
11115 | const getAccDescription = function() {
|
11116 | return description;
|
11117 | };
|
11118 | const setDiagramTitle = function(txt) {
|
11119 | diagramTitle = sanitizeText$1(txt);
|
11120 | };
|
11121 | const getDiagramTitle = function() {
|
11122 | return diagramTitle;
|
11123 | };
|
11124 | const commonDb = {
|
11125 | getAccTitle,
|
11126 | setAccTitle,
|
11127 | getDiagramTitle,
|
11128 | setDiagramTitle,
|
11129 | getAccDescription,
|
11130 | setAccDescription,
|
11131 | clear
|
11132 | };
|
11133 | const commonDb$1 = Object.freeze( Object.defineProperty({
|
11134 | __proto__: null,
|
11135 | clear,
|
11136 | default: commonDb,
|
11137 | getAccDescription,
|
11138 | getAccTitle,
|
11139 | getDiagramTitle,
|
11140 | setAccDescription,
|
11141 | setAccTitle,
|
11142 | setDiagramTitle
|
11143 | }, Symbol.toStringTag, { value: "Module" }));
|
11144 | let currentDirective = {};
|
11145 | const parseDirective$1 = function(p, statement, context, type2) {
|
11146 | log$1.debug("parseDirective is being called", statement, context, type2);
|
11147 | try {
|
11148 | if (statement !== void 0) {
|
11149 | statement = statement.trim();
|
11150 | switch (context) {
|
11151 | case "open_directive":
|
11152 | currentDirective = {};
|
11153 | break;
|
11154 | case "type_directive":
|
11155 | if (!currentDirective) {
|
11156 | throw new Error("currentDirective is undefined");
|
11157 | }
|
11158 | currentDirective.type = statement.toLowerCase();
|
11159 | break;
|
11160 | case "arg_directive":
|
11161 | if (!currentDirective) {
|
11162 | throw new Error("currentDirective is undefined");
|
11163 | }
|
11164 | currentDirective.args = JSON.parse(statement);
|
11165 | break;
|
11166 | case "close_directive":
|
11167 | handleDirective(p, currentDirective, type2);
|
11168 | currentDirective = void 0;
|
11169 | break;
|
11170 | }
|
11171 | }
|
11172 | } catch (error) {
|
11173 | log$1.error(
|
11174 | `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}`
|
11175 | );
|
11176 | log$1.error(error.message);
|
11177 | }
|
11178 | };
|
11179 | const handleDirective = function(p, directive2, type2) {
|
11180 | log$1.info(`Directive type=${directive2.type} with args:`, directive2.args);
|
11181 | switch (directive2.type) {
|
11182 | case "init":
|
11183 | case "initialize": {
|
11184 | ["config"].forEach((prop) => {
|
11185 | if (directive2.args[prop] !== void 0) {
|
11186 | if (type2 === "flowchart-v2") {
|
11187 | type2 = "flowchart";
|
11188 | }
|
11189 | directive2.args[type2] = directive2.args[prop];
|
11190 | delete directive2.args[prop];
|
11191 | }
|
11192 | });
|
11193 | log$1.info("sanitize in handleDirective", directive2.args);
|
11194 | directiveSanitizer(directive2.args);
|
11195 | log$1.info("sanitize in handleDirective (done)", directive2.args);
|
11196 | addDirective(directive2.args);
|
11197 | break;
|
11198 | }
|
11199 | case "wrap":
|
11200 | case "nowrap":
|
11201 | if (p && p["setWrap"]) {
|
11202 | p.setWrap(directive2.type === "wrap");
|
11203 | }
|
11204 | break;
|
11205 | case "themeCss":
|
11206 | log$1.warn("themeCss encountered");
|
11207 | break;
|
11208 | default:
|
11209 | log$1.warn(
|
11210 | `Unhandled directive: source: '%%{${directive2.type}: ${JSON.stringify(
|
11211 | directive2.args ? directive2.args : {}
|
11212 | )}}%%`,
|
11213 | directive2
|
11214 | );
|
11215 | break;
|
11216 | }
|
11217 | };
|
11218 | const log = log$1;
|
11219 | const setLogLevel = setLogLevel$1;
|
11220 | const getConfig = getConfig$1;
|
11221 | const sanitizeText = (text2) => sanitizeText$2(text2, getConfig());
|
11222 | const setupGraphViewbox = setupGraphViewbox$1;
|
11223 | const getCommonDb = () => {
|
11224 | return commonDb$1;
|
11225 | };
|
11226 | const parseDirective = (p, statement, context, type2) => parseDirective$1(p, statement, context, type2);
|
11227 | const diagrams = {};
|
11228 | const registerDiagram = (id2, diagram2, detector2) => {
|
11229 | if (diagrams[id2]) {
|
11230 | throw new Error(`Diagram ${id2} already registered.`);
|
11231 | }
|
11232 | diagrams[id2] = diagram2;
|
11233 | if (detector2) {
|
11234 | addDetector(id2, detector2);
|
11235 | }
|
11236 | addStylesForDiagram(id2, diagram2.styles);
|
11237 | if (diagram2.injectUtils) {
|
11238 | diagram2.injectUtils(
|
11239 | log,
|
11240 | setLogLevel,
|
11241 | getConfig,
|
11242 | sanitizeText,
|
11243 | setupGraphViewbox,
|
11244 | getCommonDb(),
|
11245 | parseDirective
|
11246 | );
|
11247 | }
|
11248 | };
|
11249 | const getDiagram = (name) => {
|
11250 | if (name in diagrams) {
|
11251 | return diagrams[name];
|
11252 | }
|
11253 | throw new Error(`Diagram ${name} not found.`);
|
11254 | };
|
11255 | class UnknownDiagramError extends Error {
|
11256 | constructor(message) {
|
11257 | super(message);
|
11258 | this.name = "UnknownDiagramError";
|
11259 | }
|
11260 | }
|
11261 | const directive$1 = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
11262 | const anyComment = /\s*%%.*\n/gm;
|
11263 | const detectors = {};
|
11264 | const detectType = function(text2, config2) {
|
11265 | text2 = text2.replace(frontMatterRegex, "").replace(directive$1, "").replace(anyComment, "\n");
|
11266 | for (const [key, { detector: detector2 }] of Object.entries(detectors)) {
|
11267 | const diagram2 = detector2(text2, config2);
|
11268 | if (diagram2) {
|
11269 | return key;
|
11270 | }
|
11271 | }
|
11272 | throw new UnknownDiagramError(
|
11273 | `No diagram type detected matching given configuration for text: ${text2}`
|
11274 | );
|
11275 | };
|
11276 | const registerLazyLoadedDiagrams = (...diagrams2) => {
|
11277 | for (const { id: id2, detector: detector2, loader: loader2 } of diagrams2) {
|
11278 | addDetector(id2, detector2, loader2);
|
11279 | }
|
11280 | };
|
11281 | const loadRegisteredDiagrams = async () => {
|
11282 | log$1.debug(`Loading registered diagrams`);
|
11283 | const results = await Promise.allSettled(
|
11284 | Object.entries(detectors).map(async ([key, { detector: detector2, loader: loader2 }]) => {
|
11285 | if (loader2) {
|
11286 | try {
|
11287 | getDiagram(key);
|
11288 | } catch (error) {
|
11289 | try {
|
11290 | const { diagram: diagram2, id: id2 } = await loader2();
|
11291 | registerDiagram(id2, diagram2, detector2);
|
11292 | } catch (err) {
|
11293 | log$1.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);
|
11294 | delete detectors[key];
|
11295 | throw err;
|
11296 | }
|
11297 | }
|
11298 | }
|
11299 | })
|
11300 | );
|
11301 | const failed = results.filter((result) => result.status === "rejected");
|
11302 | if (failed.length > 0) {
|
11303 | log$1.error(`Failed to load ${failed.length} external diagrams`);
|
11304 | for (const res of failed) {
|
11305 | log$1.error(res);
|
11306 | }
|
11307 | throw new Error(`Failed to load ${failed.length} external diagrams`);
|
11308 | }
|
11309 | };
|
11310 | const addDetector = (key, detector2, loader2) => {
|
11311 | if (detectors[key]) {
|
11312 | log$1.error(`Detector with key ${key} already exists`);
|
11313 | } else {
|
11314 | detectors[key] = { detector: detector2, loader: loader2 };
|
11315 | }
|
11316 | log$1.debug(`Detector with key ${key} added${loader2 ? " with loader" : ""}`);
|
11317 | };
|
11318 | const getDiagramLoader = (key) => {
|
11319 | return detectors[key].loader;
|
11320 | };
|
11321 | var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
11322 | const freeGlobal$1 = freeGlobal;
|
11323 | var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
11324 | var root = freeGlobal$1 || freeSelf || Function("return this")();
|
11325 | const root$1 = root;
|
11326 | var Symbol$1 = root$1.Symbol;
|
11327 | const Symbol$2 = Symbol$1;
|
11328 | var objectProto$8 = Object.prototype;
|
11329 | var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
11330 | var nativeObjectToString$1 = objectProto$8.toString;
|
11331 | var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
11332 | function getRawTag(value) {
|
11333 | var isOwn = hasOwnProperty$6.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
11334 | try {
|
11335 | value[symToStringTag$1] = void 0;
|
11336 | var unmasked = true;
|
11337 | } catch (e) {
|
11338 | }
|
11339 | var result = nativeObjectToString$1.call(value);
|
11340 | if (unmasked) {
|
11341 | if (isOwn) {
|
11342 | value[symToStringTag$1] = tag;
|
11343 | } else {
|
11344 | delete value[symToStringTag$1];
|
11345 | }
|
11346 | }
|
11347 | return result;
|
11348 | }
|
11349 | var objectProto$7 = Object.prototype;
|
11350 | var nativeObjectToString = objectProto$7.toString;
|
11351 | function objectToString(value) {
|
11352 | return nativeObjectToString.call(value);
|
11353 | }
|
11354 | var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
11355 | var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
11356 | function baseGetTag(value) {
|
11357 | if (value == null) {
|
11358 | return value === void 0 ? undefinedTag : nullTag;
|
11359 | }
|
11360 | return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
11361 | }
|
11362 | function isObject(value) {
|
11363 | var type2 = typeof value;
|
11364 | return value != null && (type2 == "object" || type2 == "function");
|
11365 | }
|
11366 | var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
11367 | function isFunction(value) {
|
11368 | if (!isObject(value)) {
|
11369 | return false;
|
11370 | }
|
11371 | var tag = baseGetTag(value);
|
11372 | return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
11373 | }
|
11374 | var coreJsData = root$1["__core-js_shared__"];
|
11375 | const coreJsData$1 = coreJsData;
|
11376 | var maskSrcKey = function() {
|
11377 | var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
11378 | return uid ? "Symbol(src)_1." + uid : "";
|
11379 | }();
|
11380 | function isMasked(func) {
|
11381 | return !!maskSrcKey && maskSrcKey in func;
|
11382 | }
|
11383 | var funcProto$1 = Function.prototype;
|
11384 | var funcToString$1 = funcProto$1.toString;
|
11385 | function toSource(func) {
|
11386 | if (func != null) {
|
11387 | try {
|
11388 | return funcToString$1.call(func);
|
11389 | } catch (e) {
|
11390 | }
|
11391 | try {
|
11392 | return func + "";
|
11393 | } catch (e) {
|
11394 | }
|
11395 | }
|
11396 | return "";
|
11397 | }
|
11398 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
11399 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
11400 | var funcProto = Function.prototype, objectProto$6 = Object.prototype;
|
11401 | var funcToString = funcProto.toString;
|
11402 | var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
11403 | var reIsNative = RegExp(
|
11404 | "^" + funcToString.call(hasOwnProperty$5).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
11405 | );
|
11406 | function baseIsNative(value) {
|
11407 | if (!isObject(value) || isMasked(value)) {
|
11408 | return false;
|
11409 | }
|
11410 | var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
11411 | return pattern.test(toSource(value));
|
11412 | }
|
11413 | function getValue(object, key) {
|
11414 | return object == null ? void 0 : object[key];
|
11415 | }
|
11416 | function getNative(object, key) {
|
11417 | var value = getValue(object, key);
|
11418 | return baseIsNative(value) ? value : void 0;
|
11419 | }
|
11420 | var nativeCreate = getNative(Object, "create");
|
11421 | const nativeCreate$1 = nativeCreate;
|
11422 | function hashClear() {
|
11423 | this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
|
11424 | this.size = 0;
|
11425 | }
|
11426 | function hashDelete(key) {
|
11427 | var result = this.has(key) && delete this.__data__[key];
|
11428 | this.size -= result ? 1 : 0;
|
11429 | return result;
|
11430 | }
|
11431 | var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
11432 | var objectProto$5 = Object.prototype;
|
11433 | var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
11434 | function hashGet(key) {
|
11435 | var data = this.__data__;
|
11436 | if (nativeCreate$1) {
|
11437 | var result = data[key];
|
11438 | return result === HASH_UNDEFINED$1 ? void 0 : result;
|
11439 | }
|
11440 | return hasOwnProperty$4.call(data, key) ? data[key] : void 0;
|
11441 | }
|
11442 | var objectProto$4 = Object.prototype;
|
11443 | var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
11444 | function hashHas(key) {
|
11445 | var data = this.__data__;
|
11446 | return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$3.call(data, key);
|
11447 | }
|
11448 | var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
11449 | function hashSet(key, value) {
|
11450 | var data = this.__data__;
|
11451 | this.size += this.has(key) ? 0 : 1;
|
11452 | data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED : value;
|
11453 | return this;
|
11454 | }
|
11455 | function Hash(entries2) {
|
11456 | var index = -1, length2 = entries2 == null ? 0 : entries2.length;
|
11457 | this.clear();
|
11458 | while (++index < length2) {
|
11459 | var entry = entries2[index];
|
11460 | this.set(entry[0], entry[1]);
|
11461 | }
|
11462 | }
|
11463 | Hash.prototype.clear = hashClear;
|
11464 | Hash.prototype["delete"] = hashDelete;
|
11465 | Hash.prototype.get = hashGet;
|
11466 | Hash.prototype.has = hashHas;
|
11467 | Hash.prototype.set = hashSet;
|
11468 | function listCacheClear() {
|
11469 | this.__data__ = [];
|
11470 | this.size = 0;
|
11471 | }
|
11472 | function eq(value, other) {
|
11473 | return value === other || value !== value && other !== other;
|
11474 | }
|
11475 | function assocIndexOf(array2, key) {
|
11476 | var length2 = array2.length;
|
11477 | while (length2--) {
|
11478 | if (eq(array2[length2][0], key)) {
|
11479 | return length2;
|
11480 | }
|
11481 | }
|
11482 | return -1;
|
11483 | }
|
11484 | var arrayProto = Array.prototype;
|
11485 | var splice = arrayProto.splice;
|
11486 | function listCacheDelete(key) {
|
11487 | var data = this.__data__, index = assocIndexOf(data, key);
|
11488 | if (index < 0) {
|
11489 | return false;
|
11490 | }
|
11491 | var lastIndex = data.length - 1;
|
11492 | if (index == lastIndex) {
|
11493 | data.pop();
|
11494 | } else {
|
11495 | splice.call(data, index, 1);
|
11496 | }
|
11497 | --this.size;
|
11498 | return true;
|
11499 | }
|
11500 | function listCacheGet(key) {
|
11501 | var data = this.__data__, index = assocIndexOf(data, key);
|
11502 | return index < 0 ? void 0 : data[index][1];
|
11503 | }
|
11504 | function listCacheHas(key) {
|
11505 | return assocIndexOf(this.__data__, key) > -1;
|
11506 | }
|
11507 | function listCacheSet(key, value) {
|
11508 | var data = this.__data__, index = assocIndexOf(data, key);
|
11509 | if (index < 0) {
|
11510 | ++this.size;
|
11511 | data.push([key, value]);
|
11512 | } else {
|
11513 | data[index][1] = value;
|
11514 | }
|
11515 | return this;
|
11516 | }
|
11517 | function ListCache(entries2) {
|
11518 | var index = -1, length2 = entries2 == null ? 0 : entries2.length;
|
11519 | this.clear();
|
11520 | while (++index < length2) {
|
11521 | var entry = entries2[index];
|
11522 | this.set(entry[0], entry[1]);
|
11523 | }
|
11524 | }
|
11525 | ListCache.prototype.clear = listCacheClear;
|
11526 | ListCache.prototype["delete"] = listCacheDelete;
|
11527 | ListCache.prototype.get = listCacheGet;
|
11528 | ListCache.prototype.has = listCacheHas;
|
11529 | ListCache.prototype.set = listCacheSet;
|
11530 | var Map$1 = getNative(root$1, "Map");
|
11531 | const Map$2 = Map$1;
|
11532 | function mapCacheClear() {
|
11533 | this.size = 0;
|
11534 | this.__data__ = {
|
11535 | "hash": new Hash(),
|
11536 | "map": new (Map$2 || ListCache)(),
|
11537 | "string": new Hash()
|
11538 | };
|
11539 | }
|
11540 | function isKeyable(value) {
|
11541 | var type2 = typeof value;
|
11542 | return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
|
11543 | }
|
11544 | function getMapData(map2, key) {
|
11545 | var data = map2.__data__;
|
11546 | return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
11547 | }
|
11548 | function mapCacheDelete(key) {
|
11549 | var result = getMapData(this, key)["delete"](key);
|
11550 | this.size -= result ? 1 : 0;
|
11551 | return result;
|
11552 | }
|
11553 | function mapCacheGet(key) {
|
11554 | return getMapData(this, key).get(key);
|
11555 | }
|
11556 | function mapCacheHas(key) {
|
11557 | return getMapData(this, key).has(key);
|
11558 | }
|
11559 | function mapCacheSet(key, value) {
|
11560 | var data = getMapData(this, key), size = data.size;
|
11561 | data.set(key, value);
|
11562 | this.size += data.size == size ? 0 : 1;
|
11563 | return this;
|
11564 | }
|
11565 | function MapCache(entries2) {
|
11566 | var index = -1, length2 = entries2 == null ? 0 : entries2.length;
|
11567 | this.clear();
|
11568 | while (++index < length2) {
|
11569 | var entry = entries2[index];
|
11570 | this.set(entry[0], entry[1]);
|
11571 | }
|
11572 | }
|
11573 | MapCache.prototype.clear = mapCacheClear;
|
11574 | MapCache.prototype["delete"] = mapCacheDelete;
|
11575 | MapCache.prototype.get = mapCacheGet;
|
11576 | MapCache.prototype.has = mapCacheHas;
|
11577 | MapCache.prototype.set = mapCacheSet;
|
11578 | var FUNC_ERROR_TEXT = "Expected a function";
|
11579 | function memoize(func, resolver) {
|
11580 | if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
11581 | throw new TypeError(FUNC_ERROR_TEXT);
|
11582 | }
|
11583 | var memoized = function() {
|
11584 | var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
11585 | if (cache.has(key)) {
|
11586 | return cache.get(key);
|
11587 | }
|
11588 | var result = func.apply(this, args);
|
11589 | memoized.cache = cache.set(key, result) || cache;
|
11590 | return result;
|
11591 | };
|
11592 | memoized.cache = new (memoize.Cache || MapCache)();
|
11593 | return memoized;
|
11594 | }
|
11595 | memoize.Cache = MapCache;
|
11596 | const d3CurveTypes = {
|
11597 | curveBasis,
|
11598 | curveBasisClosed,
|
11599 | curveBasisOpen,
|
11600 | curveBumpX: bumpX,
|
11601 | curveBumpY: bumpY,
|
11602 | curveBundle,
|
11603 | curveCardinalClosed,
|
11604 | curveCardinalOpen,
|
11605 | curveCardinal,
|
11606 | curveCatmullRomClosed,
|
11607 | curveCatmullRomOpen,
|
11608 | curveCatmullRom,
|
11609 | curveLinear,
|
11610 | curveLinearClosed,
|
11611 | curveMonotoneX: monotoneX,
|
11612 | curveMonotoneY: monotoneY,
|
11613 | curveNatural,
|
11614 | curveStep,
|
11615 | curveStepAfter: stepAfter,
|
11616 | curveStepBefore: stepBefore
|
11617 | };
|
11618 | const directive = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
11619 | const directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
11620 | const detectInit = function(text2, config2) {
|
11621 | const inits = detectDirective(text2, /(?:init\b)|(?:initialize\b)/);
|
11622 | let results = {};
|
11623 | if (Array.isArray(inits)) {
|
11624 | const args = inits.map((init2) => init2.args);
|
11625 | directiveSanitizer(args);
|
11626 | results = assignWithDepth$1(results, [...args]);
|
11627 | } else {
|
11628 | results = inits.args;
|
11629 | }
|
11630 | if (results) {
|
11631 | let type2 = detectType(text2, config2);
|
11632 | ["config"].forEach((prop) => {
|
11633 | if (results[prop] !== void 0) {
|
11634 | if (type2 === "flowchart-v2") {
|
11635 | type2 = "flowchart";
|
11636 | }
|
11637 | results[type2] = results[prop];
|
11638 | delete results[prop];
|
11639 | }
|
11640 | });
|
11641 | }
|
11642 | return results;
|
11643 | };
|
11644 | const detectDirective = function(text2, type2 = null) {
|
11645 | try {
|
11646 | const commentWithoutDirectives = new RegExp(
|
11647 | `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
|
11648 | `,
|
11649 | "ig"
|
11650 | );
|
11651 | text2 = text2.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
|
11652 | log$1.debug(
|
11653 | `Detecting diagram directive${type2 !== null ? " type:" + type2 : ""} based on the text:${text2}`
|
11654 | );
|
11655 | let match;
|
11656 | const result = [];
|
11657 | while ((match = directive.exec(text2)) !== null) {
|
11658 | if (match.index === directive.lastIndex) {
|
11659 | directive.lastIndex++;
|
11660 | }
|
11661 | if (match && !type2 || type2 && match[1] && match[1].match(type2) || type2 && match[2] && match[2].match(type2)) {
|
11662 | const type22 = match[1] ? match[1] : match[2];
|
11663 | const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;
|
11664 | result.push({ type: type22, args });
|
11665 | }
|
11666 | }
|
11667 | if (result.length === 0) {
|
11668 | result.push({ type: text2, args: null });
|
11669 | }
|
11670 | return result.length === 1 ? result[0] : result;
|
11671 | } catch (error) {
|
11672 | log$1.error(
|
11673 | `ERROR: ${error.message} - Unable to parse directive
|
11674 | ${type2 !== null ? " type:" + type2 : ""} based on the text:${text2}`
|
11675 | );
|
11676 | return { type: null, args: null };
|
11677 | }
|
11678 | };
|
11679 | const isSubstringInArray = function(str2, arr) {
|
11680 | for (const [i, element] of arr.entries()) {
|
11681 | if (element.match(str2)) {
|
11682 | return i;
|
11683 | }
|
11684 | }
|
11685 | return -1;
|
11686 | };
|
11687 | function interpolateToCurve(interpolate2, defaultCurve) {
|
11688 | if (!interpolate2) {
|
11689 | return defaultCurve;
|
11690 | }
|
11691 | const curveName = `curve${interpolate2.charAt(0).toUpperCase() + interpolate2.slice(1)}`;
|
11692 | return d3CurveTypes[curveName] || defaultCurve;
|
11693 | }
|
11694 | function formatUrl(linkStr, config2) {
|
11695 | const url = linkStr.trim();
|
11696 | if (url) {
|
11697 | if (config2.securityLevel !== "loose") {
|
11698 | return sanitizeUrl_1(url);
|
11699 | }
|
11700 | return url;
|
11701 | }
|
11702 | }
|
11703 | const runFunc = (functionName, ...params) => {
|
11704 | const arrPaths = functionName.split(".");
|
11705 | const len = arrPaths.length - 1;
|
11706 | const fnName = arrPaths[len];
|
11707 | let obj = window;
|
11708 | for (let i = 0; i < len; i++) {
|
11709 | obj = obj[arrPaths[i]];
|
11710 | if (!obj) {
|
11711 | return;
|
11712 | }
|
11713 | }
|
11714 | obj[fnName](...params);
|
11715 | };
|
11716 | function distance(p1, p2) {
|
11717 | return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;
|
11718 | }
|
11719 | function traverseEdge(points) {
|
11720 | let prevPoint;
|
11721 | let totalDistance = 0;
|
11722 | points.forEach((point2) => {
|
11723 | totalDistance += distance(point2, prevPoint);
|
11724 | prevPoint = point2;
|
11725 | });
|
11726 | let remainingDistance = totalDistance / 2;
|
11727 | let center = void 0;
|
11728 | prevPoint = void 0;
|
11729 | points.forEach((point2) => {
|
11730 | if (prevPoint && !center) {
|
11731 | const vectorDistance = distance(point2, prevPoint);
|
11732 | if (vectorDistance < remainingDistance) {
|
11733 | remainingDistance -= vectorDistance;
|
11734 | } else {
|
11735 | const distanceRatio = remainingDistance / vectorDistance;
|
11736 | if (distanceRatio <= 0) {
|
11737 | center = prevPoint;
|
11738 | }
|
11739 | if (distanceRatio >= 1) {
|
11740 | center = { x: point2.x, y: point2.y };
|
11741 | }
|
11742 | if (distanceRatio > 0 && distanceRatio < 1) {
|
11743 | center = {
|
11744 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x,
|
11745 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y
|
11746 | };
|
11747 | }
|
11748 | }
|
11749 | }
|
11750 | prevPoint = point2;
|
11751 | });
|
11752 | return center;
|
11753 | }
|
11754 | function calcLabelPosition(points) {
|
11755 | if (points.length === 1) {
|
11756 | return points[0];
|
11757 | }
|
11758 | return traverseEdge(points);
|
11759 | }
|
11760 | const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => {
|
11761 | let prevPoint;
|
11762 | log$1.info(`our points ${JSON.stringify(points)}`);
|
11763 | if (points[0] !== initialPosition) {
|
11764 | points = points.reverse();
|
11765 | }
|
11766 | const distanceToCardinalityPoint = 25;
|
11767 | let remainingDistance = distanceToCardinalityPoint;
|
11768 | let center;
|
11769 | prevPoint = void 0;
|
11770 | points.forEach((point2) => {
|
11771 | if (prevPoint && !center) {
|
11772 | const vectorDistance = distance(point2, prevPoint);
|
11773 | if (vectorDistance < remainingDistance) {
|
11774 | remainingDistance -= vectorDistance;
|
11775 | } else {
|
11776 | const distanceRatio = remainingDistance / vectorDistance;
|
11777 | if (distanceRatio <= 0) {
|
11778 | center = prevPoint;
|
11779 | }
|
11780 | if (distanceRatio >= 1) {
|
11781 | center = { x: point2.x, y: point2.y };
|
11782 | }
|
11783 | if (distanceRatio > 0 && distanceRatio < 1) {
|
11784 | center = {
|
11785 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x,
|
11786 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y
|
11787 | };
|
11788 | }
|
11789 | }
|
11790 | }
|
11791 | prevPoint = point2;
|
11792 | });
|
11793 | const d = isRelationTypePresent ? 10 : 5;
|
11794 | const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
11795 | const cardinalityPosition = { x: 0, y: 0 };
|
11796 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
11797 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
11798 | return cardinalityPosition;
|
11799 | };
|
11800 | function calcTerminalLabelPosition(terminalMarkerSize, position2, _points) {
|
11801 | let points = JSON.parse(JSON.stringify(_points));
|
11802 | let prevPoint;
|
11803 | log$1.info("our points", points);
|
11804 | if (position2 !== "start_left" && position2 !== "start_right") {
|
11805 | points = points.reverse();
|
11806 | }
|
11807 | points.forEach((point2) => {
|
11808 | prevPoint = point2;
|
11809 | });
|
11810 | const distanceToCardinalityPoint = 25 + terminalMarkerSize;
|
11811 | let remainingDistance = distanceToCardinalityPoint;
|
11812 | let center;
|
11813 | prevPoint = void 0;
|
11814 | points.forEach((point2) => {
|
11815 | if (prevPoint && !center) {
|
11816 | const vectorDistance = distance(point2, prevPoint);
|
11817 | if (vectorDistance < remainingDistance) {
|
11818 | remainingDistance -= vectorDistance;
|
11819 | } else {
|
11820 | const distanceRatio = remainingDistance / vectorDistance;
|
11821 | if (distanceRatio <= 0) {
|
11822 | center = prevPoint;
|
11823 | }
|
11824 | if (distanceRatio >= 1) {
|
11825 | center = { x: point2.x, y: point2.y };
|
11826 | }
|
11827 | if (distanceRatio > 0 && distanceRatio < 1) {
|
11828 | center = {
|
11829 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x,
|
11830 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y
|
11831 | };
|
11832 | }
|
11833 | }
|
11834 | }
|
11835 | prevPoint = point2;
|
11836 | });
|
11837 | const d = 10 + terminalMarkerSize * 0.5;
|
11838 | const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
11839 | const cardinalityPosition = { x: 0, y: 0 };
|
11840 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
11841 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
11842 | if (position2 === "start_left") {
|
11843 | cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;
|
11844 | cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;
|
11845 | }
|
11846 | if (position2 === "end_right") {
|
11847 | cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;
|
11848 | cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;
|
11849 | }
|
11850 | if (position2 === "end_left") {
|
11851 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;
|
11852 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;
|
11853 | }
|
11854 | return cardinalityPosition;
|
11855 | }
|
11856 | function getStylesFromArray(arr) {
|
11857 | let style = "";
|
11858 | let labelStyle = "";
|
11859 | for (const element of arr) {
|
11860 | if (element !== void 0) {
|
11861 | if (element.startsWith("color:") || element.startsWith("text-align:")) {
|
11862 | labelStyle = labelStyle + element + ";";
|
11863 | } else {
|
11864 | style = style + element + ";";
|
11865 | }
|
11866 | }
|
11867 | }
|
11868 | return { style, labelStyle };
|
11869 | }
|
11870 | let cnt = 0;
|
11871 | const generateId = () => {
|
11872 | cnt++;
|
11873 | return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
|
11874 | };
|
11875 | function makeid(length2) {
|
11876 | let result = "";
|
11877 | const characters2 = "0123456789abcdef";
|
11878 | const charactersLength = characters2.length;
|
11879 | for (let i = 0; i < length2; i++) {
|
11880 | result += characters2.charAt(Math.floor(Math.random() * charactersLength));
|
11881 | }
|
11882 | return result;
|
11883 | }
|
11884 | const random = (options) => {
|
11885 | return makeid(options.length);
|
11886 | };
|
11887 | const getTextObj = function() {
|
11888 | return {
|
11889 | x: 0,
|
11890 | y: 0,
|
11891 | fill: void 0,
|
11892 | anchor: "start",
|
11893 | style: "#666",
|
11894 | width: 100,
|
11895 | height: 100,
|
11896 | textMargin: 0,
|
11897 | rx: 0,
|
11898 | ry: 0,
|
11899 | valign: void 0
|
11900 | };
|
11901 | };
|
11902 | const drawSimpleText = function(elem, textData) {
|
11903 | const nText = textData.text.replace(common$1.lineBreakRegex, " ");
|
11904 | const [, _fontSizePx] = parseFontSize(textData.fontSize);
|
11905 | const textElem = elem.append("text");
|
11906 | textElem.attr("x", textData.x);
|
11907 | textElem.attr("y", textData.y);
|
11908 | textElem.style("text-anchor", textData.anchor);
|
11909 | textElem.style("font-family", textData.fontFamily);
|
11910 | textElem.style("font-size", _fontSizePx);
|
11911 | textElem.style("font-weight", textData.fontWeight);
|
11912 | textElem.attr("fill", textData.fill);
|
11913 | if (textData.class !== void 0) {
|
11914 | textElem.attr("class", textData.class);
|
11915 | }
|
11916 | const span = textElem.append("tspan");
|
11917 | span.attr("x", textData.x + textData.textMargin * 2);
|
11918 | span.attr("fill", textData.fill);
|
11919 | span.text(nText);
|
11920 | return textElem;
|
11921 | };
|
11922 | const wrapLabel = memoize(
|
11923 | (label, maxWidth, config2) => {
|
11924 | if (!label) {
|
11925 | return label;
|
11926 | }
|
11927 | config2 = Object.assign(
|
11928 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" },
|
11929 | config2
|
11930 | );
|
11931 | if (common$1.lineBreakRegex.test(label)) {
|
11932 | return label;
|
11933 | }
|
11934 | const words = label.split(" ");
|
11935 | const completedLines = [];
|
11936 | let nextLine = "";
|
11937 | words.forEach((word, index) => {
|
11938 | const wordLength = calculateTextWidth(`${word} `, config2);
|
11939 | const nextLineLength = calculateTextWidth(nextLine, config2);
|
11940 | if (wordLength > maxWidth) {
|
11941 | const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config2);
|
11942 | completedLines.push(nextLine, ...hyphenatedStrings);
|
11943 | nextLine = remainingWord;
|
11944 | } else if (nextLineLength + wordLength >= maxWidth) {
|
11945 | completedLines.push(nextLine);
|
11946 | nextLine = word;
|
11947 | } else {
|
11948 | nextLine = [nextLine, word].filter(Boolean).join(" ");
|
11949 | }
|
11950 | const currentWord = index + 1;
|
11951 | const isLastWord = currentWord === words.length;
|
11952 | if (isLastWord) {
|
11953 | completedLines.push(nextLine);
|
11954 | }
|
11955 | });
|
11956 | return completedLines.filter((line2) => line2 !== "").join(config2.joinWith);
|
11957 | },
|
11958 | (label, maxWidth, config2) => `${label}${maxWidth}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}${config2.joinWith}`
|
11959 | );
|
11960 | const breakString = memoize(
|
11961 | (word, maxWidth, hyphenCharacter = "-", config2) => {
|
11962 | config2 = Object.assign(
|
11963 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
|
11964 | config2
|
11965 | );
|
11966 | const characters2 = [...word];
|
11967 | const lines = [];
|
11968 | let currentLine = "";
|
11969 | characters2.forEach((character2, index) => {
|
11970 | const nextLine = `${currentLine}${character2}`;
|
11971 | const lineWidth = calculateTextWidth(nextLine, config2);
|
11972 | if (lineWidth >= maxWidth) {
|
11973 | const currentCharacter = index + 1;
|
11974 | const isLastLine = characters2.length === currentCharacter;
|
11975 | const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
|
11976 | lines.push(isLastLine ? nextLine : hyphenatedNextLine);
|
11977 | currentLine = "";
|
11978 | } else {
|
11979 | currentLine = nextLine;
|
11980 | }
|
11981 | });
|
11982 | return { hyphenatedStrings: lines, remainingWord: currentLine };
|
11983 | },
|
11984 | (word, maxWidth, hyphenCharacter = "-", config2) => `${word}${maxWidth}${hyphenCharacter}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}`
|
11985 | );
|
11986 | function calculateTextHeight(text2, config2) {
|
11987 | config2 = Object.assign(
|
11988 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 15 },
|
11989 | config2
|
11990 | );
|
11991 | return calculateTextDimensions(text2, config2).height;
|
11992 | }
|
11993 | function calculateTextWidth(text2, config2) {
|
11994 | config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2);
|
11995 | return calculateTextDimensions(text2, config2).width;
|
11996 | }
|
11997 | const calculateTextDimensions = memoize(
|
11998 | (text2, config2) => {
|
11999 | config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2);
|
12000 | const { fontSize, fontFamily, fontWeight } = config2;
|
12001 | if (!text2) {
|
12002 | return { width: 0, height: 0 };
|
12003 | }
|
12004 | const [, _fontSizePx] = parseFontSize(fontSize);
|
12005 | const fontFamilies = ["sans-serif", fontFamily];
|
12006 | const lines = text2.split(common$1.lineBreakRegex);
|
12007 | const dims = [];
|
12008 | const body = select("body");
|
12009 | if (!body.remove) {
|
12010 | return { width: 0, height: 0, lineHeight: 0 };
|
12011 | }
|
12012 | const g = body.append("svg");
|
12013 | for (const fontFamily2 of fontFamilies) {
|
12014 | let cheight = 0;
|
12015 | const dim = { width: 0, height: 0, lineHeight: 0 };
|
12016 | for (const line2 of lines) {
|
12017 | const textObj = getTextObj();
|
12018 | textObj.text = line2;
|
12019 | const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
|
12020 | const bBox = (textElem._groups || textElem)[0][0].getBBox();
|
12021 | if (bBox.width === 0 && bBox.height === 0) {
|
12022 | throw new Error("svg element not in render tree");
|
12023 | }
|
12024 | dim.width = Math.round(Math.max(dim.width, bBox.width));
|
12025 | cheight = Math.round(bBox.height);
|
12026 | dim.height += cheight;
|
12027 | dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight));
|
12028 | }
|
12029 | dims.push(dim);
|
12030 | }
|
12031 | g.remove();
|
12032 | const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
|
12033 | return dims[index];
|
12034 | },
|
12035 | (text2, config2) => `${text2}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}`
|
12036 | );
|
12037 | const initIdGenerator = class iterator {
|
12038 | constructor(deterministic, seed) {
|
12039 | this.deterministic = deterministic;
|
12040 | this.seed = seed;
|
12041 | this.count = seed ? seed.length : 0;
|
12042 | }
|
12043 | next() {
|
12044 | if (!this.deterministic) {
|
12045 | return Date.now();
|
12046 | }
|
12047 | return this.count++;
|
12048 | }
|
12049 | };
|
12050 | let decoder;
|
12051 | const entityDecode = function(html2) {
|
12052 | decoder = decoder || document.createElement("div");
|
12053 | html2 = escape(html2).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
|
12054 | decoder.innerHTML = html2;
|
12055 | return unescape(decoder.textContent);
|
12056 | };
|
12057 | const directiveSanitizer = (args) => {
|
12058 | log$1.debug("directiveSanitizer called with", args);
|
12059 | if (typeof args === "object") {
|
12060 | if (args.length) {
|
12061 | args.forEach((arg) => directiveSanitizer(arg));
|
12062 | } else {
|
12063 | Object.keys(args).forEach((key) => {
|
12064 | log$1.debug("Checking key", key);
|
12065 | if (key.startsWith("__")) {
|
12066 | log$1.debug("sanitize deleting __ option", key);
|
12067 | delete args[key];
|
12068 | }
|
12069 | if (key.includes("proto")) {
|
12070 | log$1.debug("sanitize deleting proto option", key);
|
12071 | delete args[key];
|
12072 | }
|
12073 | if (key.includes("constr")) {
|
12074 | log$1.debug("sanitize deleting constr option", key);
|
12075 | delete args[key];
|
12076 | }
|
12077 | if (key.includes("themeCSS")) {
|
12078 | log$1.debug("sanitizing themeCss option");
|
12079 | args[key] = sanitizeCss(args[key]);
|
12080 | }
|
12081 | if (key.includes("fontFamily")) {
|
12082 | log$1.debug("sanitizing fontFamily option");
|
12083 | args[key] = sanitizeCss(args[key]);
|
12084 | }
|
12085 | if (key.includes("altFontFamily")) {
|
12086 | log$1.debug("sanitizing altFontFamily option");
|
12087 | args[key] = sanitizeCss(args[key]);
|
12088 | }
|
12089 | if (!configKeys.includes(key)) {
|
12090 | log$1.debug("sanitize deleting option", key);
|
12091 | delete args[key];
|
12092 | } else {
|
12093 | if (typeof args[key] === "object") {
|
12094 | log$1.debug("sanitize deleting object", key);
|
12095 | directiveSanitizer(args[key]);
|
12096 | }
|
12097 | }
|
12098 | });
|
12099 | }
|
12100 | }
|
12101 | if (args.themeVariables) {
|
12102 | const kArr = Object.keys(args.themeVariables);
|
12103 | for (const k of kArr) {
|
12104 | const val = args.themeVariables[k];
|
12105 | if (val && val.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) {
|
12106 | args.themeVariables[k] = "";
|
12107 | }
|
12108 | }
|
12109 | }
|
12110 | log$1.debug("After sanitization", args);
|
12111 | };
|
12112 | const sanitizeCss = (str2) => {
|
12113 | let startCnt = 0;
|
12114 | let endCnt = 0;
|
12115 | for (const element of str2) {
|
12116 | if (startCnt < endCnt) {
|
12117 | return "{ /* ERROR: Unbalanced CSS */ }";
|
12118 | }
|
12119 | if (element === "{") {
|
12120 | startCnt++;
|
12121 | } else if (element === "}") {
|
12122 | endCnt++;
|
12123 | }
|
12124 | }
|
12125 | if (startCnt !== endCnt) {
|
12126 | return "{ /* ERROR: Unbalanced CSS */ }";
|
12127 | }
|
12128 | return str2;
|
12129 | };
|
12130 | function isDetailedError(error) {
|
12131 | return "str" in error;
|
12132 | }
|
12133 | function getErrorMessage(error) {
|
12134 | if (error instanceof Error) {
|
12135 | return error.message;
|
12136 | }
|
12137 | return String(error);
|
12138 | }
|
12139 | const insertTitle = (parent, cssClass, titleTopMargin, title2) => {
|
12140 | if (!title2) {
|
12141 | return;
|
12142 | }
|
12143 | const bounds = parent.node().getBBox();
|
12144 | parent.append("text").text(title2).attr("x", bounds.x + bounds.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
|
12145 | };
|
12146 | const parseFontSize = (fontSize) => {
|
12147 | if (typeof fontSize === "number") {
|
12148 | return [fontSize, fontSize + "px"];
|
12149 | }
|
12150 | const fontSizeNumber = parseInt(fontSize, 10);
|
12151 | if (Number.isNaN(fontSizeNumber)) {
|
12152 | return [void 0, void 0];
|
12153 | } else if (fontSize === String(fontSizeNumber)) {
|
12154 | return [fontSizeNumber, fontSize + "px"];
|
12155 | } else {
|
12156 | return [fontSizeNumber, fontSize];
|
12157 | }
|
12158 | };
|
12159 | const utils = {
|
12160 | assignWithDepth: assignWithDepth$1,
|
12161 | wrapLabel,
|
12162 | calculateTextHeight,
|
12163 | calculateTextWidth,
|
12164 | calculateTextDimensions,
|
12165 | detectInit,
|
12166 | detectDirective,
|
12167 | isSubstringInArray,
|
12168 | interpolateToCurve,
|
12169 | calcLabelPosition,
|
12170 | calcCardinalityPosition,
|
12171 | calcTerminalLabelPosition,
|
12172 | formatUrl,
|
12173 | getStylesFromArray,
|
12174 | generateId,
|
12175 | random,
|
12176 | runFunc,
|
12177 | entityDecode,
|
12178 | initIdGenerator,
|
12179 | directiveSanitizer,
|
12180 | sanitizeCss,
|
12181 | insertTitle,
|
12182 | parseFontSize
|
12183 | };
|
12184 | var COMMENT = "comm";
|
12185 | var RULESET = "rule";
|
12186 | var DECLARATION = "decl";
|
12187 | var IMPORT = "@import";
|
12188 | var KEYFRAMES = "@keyframes";
|
12189 | var abs = Math.abs;
|
12190 | var from = String.fromCharCode;
|
12191 | function trim(value) {
|
12192 | return value.trim();
|
12193 | }
|
12194 | function replace(value, pattern, replacement) {
|
12195 | return value.replace(pattern, replacement);
|
12196 | }
|
12197 | function indexof(value, search) {
|
12198 | return value.indexOf(search);
|
12199 | }
|
12200 | function charat(value, index) {
|
12201 | return value.charCodeAt(index) | 0;
|
12202 | }
|
12203 | function substr(value, begin, end) {
|
12204 | return value.slice(begin, end);
|
12205 | }
|
12206 | function strlen(value) {
|
12207 | return value.length;
|
12208 | }
|
12209 | function sizeof(value) {
|
12210 | return value.length;
|
12211 | }
|
12212 | function append(value, array2) {
|
12213 | return array2.push(value), value;
|
12214 | }
|
12215 | var line = 1;
|
12216 | var column = 1;
|
12217 | var length = 0;
|
12218 | var position = 0;
|
12219 | var character = 0;
|
12220 | var characters = "";
|
12221 | function node(value, root2, parent, type2, props, children2, length2) {
|
12222 | return { value, root: root2, parent, type: type2, props, children: children2, line, column, length: length2, return: "" };
|
12223 | }
|
12224 | function char() {
|
12225 | return character;
|
12226 | }
|
12227 | function prev() {
|
12228 | character = position > 0 ? charat(characters, --position) : 0;
|
12229 | if (column--, character === 10)
|
12230 | column = 1, line--;
|
12231 | return character;
|
12232 | }
|
12233 | function next() {
|
12234 | character = position < length ? charat(characters, position++) : 0;
|
12235 | if (column++, character === 10)
|
12236 | column = 1, line++;
|
12237 | return character;
|
12238 | }
|
12239 | function peek() {
|
12240 | return charat(characters, position);
|
12241 | }
|
12242 | function caret() {
|
12243 | return position;
|
12244 | }
|
12245 | function slice(begin, end) {
|
12246 | return substr(characters, begin, end);
|
12247 | }
|
12248 | function token(type2) {
|
12249 | switch (type2) {
|
12250 | case 0:
|
12251 | case 9:
|
12252 | case 10:
|
12253 | case 13:
|
12254 | case 32:
|
12255 | return 5;
|
12256 | case 33:
|
12257 | case 43:
|
12258 | case 44:
|
12259 | case 47:
|
12260 | case 62:
|
12261 | case 64:
|
12262 | case 126:
|
12263 | case 59:
|
12264 | case 123:
|
12265 | case 125:
|
12266 | return 4;
|
12267 | case 58:
|
12268 | return 3;
|
12269 | case 34:
|
12270 | case 39:
|
12271 | case 40:
|
12272 | case 91:
|
12273 | return 2;
|
12274 | case 41:
|
12275 | case 93:
|
12276 | return 1;
|
12277 | }
|
12278 | return 0;
|
12279 | }
|
12280 | function alloc(value) {
|
12281 | return line = column = 1, length = strlen(characters = value), position = 0, [];
|
12282 | }
|
12283 | function dealloc(value) {
|
12284 | return characters = "", value;
|
12285 | }
|
12286 | function delimit(type2) {
|
12287 | return trim(slice(position - 1, delimiter(type2 === 91 ? type2 + 2 : type2 === 40 ? type2 + 1 : type2)));
|
12288 | }
|
12289 | function whitespace(type2) {
|
12290 | while (character = peek())
|
12291 | if (character < 33)
|
12292 | next();
|
12293 | else
|
12294 | break;
|
12295 | return token(type2) > 2 || token(character) > 3 ? "" : " ";
|
12296 | }
|
12297 | function escaping(index, count) {
|
12298 | while (--count && next())
|
12299 | if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
12300 | break;
|
12301 | return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
12302 | }
|
12303 | function delimiter(type2) {
|
12304 | while (next())
|
12305 | switch (character) {
|
12306 | case type2:
|
12307 | return position;
|
12308 | case 34:
|
12309 | case 39:
|
12310 | if (type2 !== 34 && type2 !== 39)
|
12311 | delimiter(character);
|
12312 | break;
|
12313 | case 40:
|
12314 | if (type2 === 41)
|
12315 | delimiter(type2);
|
12316 | break;
|
12317 | case 92:
|
12318 | next();
|
12319 | break;
|
12320 | }
|
12321 | return position;
|
12322 | }
|
12323 | function commenter(type2, index) {
|
12324 | while (next())
|
12325 | if (type2 + character === 47 + 10)
|
12326 | break;
|
12327 | else if (type2 + character === 42 + 42 && peek() === 47)
|
12328 | break;
|
12329 | return "/*" + slice(index, position - 1) + "*" + from(type2 === 47 ? type2 : next());
|
12330 | }
|
12331 | function identifier(index) {
|
12332 | while (!token(peek()))
|
12333 | next();
|
12334 | return slice(index, position);
|
12335 | }
|
12336 | function compile(value) {
|
12337 | return dealloc(parse$2("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
12338 | }
|
12339 | function parse$2(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
12340 | var index = 0;
|
12341 | var offset = 0;
|
12342 | var length2 = pseudo;
|
12343 | var atrule = 0;
|
12344 | var property = 0;
|
12345 | var previous = 0;
|
12346 | var variable = 1;
|
12347 | var scanning = 1;
|
12348 | var ampersand = 1;
|
12349 | var character2 = 0;
|
12350 | var type2 = "";
|
12351 | var props = rules;
|
12352 | var children2 = rulesets;
|
12353 | var reference = rule;
|
12354 | var characters2 = type2;
|
12355 | while (scanning)
|
12356 | switch (previous = character2, character2 = next()) {
|
12357 | case 40:
|
12358 | if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
12359 | if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
12360 | ampersand = -1;
|
12361 | break;
|
12362 | }
|
12363 | case 34:
|
12364 | case 39:
|
12365 | case 91:
|
12366 | characters2 += delimit(character2);
|
12367 | break;
|
12368 | case 9:
|
12369 | case 10:
|
12370 | case 13:
|
12371 | case 32:
|
12372 | characters2 += whitespace(previous);
|
12373 | break;
|
12374 | case 92:
|
12375 | characters2 += escaping(caret() - 1, 7);
|
12376 | continue;
|
12377 | case 47:
|
12378 | switch (peek()) {
|
12379 | case 42:
|
12380 | case 47:
|
12381 | append(comment(commenter(next(), caret()), root2, parent), declarations);
|
12382 | break;
|
12383 | default:
|
12384 | characters2 += "/";
|
12385 | }
|
12386 | break;
|
12387 | case 123 * variable:
|
12388 | points[index++] = strlen(characters2) * ampersand;
|
12389 | case 125 * variable:
|
12390 | case 59:
|
12391 | case 0:
|
12392 | switch (character2) {
|
12393 | case 0:
|
12394 | case 125:
|
12395 | scanning = 0;
|
12396 | case 59 + offset:
|
12397 | if (property > 0 && strlen(characters2) - length2)
|
12398 | append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
12399 | break;
|
12400 | case 59:
|
12401 | characters2 += ";";
|
12402 | default:
|
12403 | append(reference = ruleset(characters2, root2, parent, index, offset, rules, points, type2, props = [], children2 = [], length2), rulesets);
|
12404 | if (character2 === 123)
|
12405 | if (offset === 0)
|
12406 | parse$2(characters2, root2, reference, reference, props, rulesets, length2, points, children2);
|
12407 | else
|
12408 | switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
12409 | case 100:
|
12410 | case 109:
|
12411 | case 115:
|
12412 | parse$2(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type2, rules, props = [], length2), children2), rules, children2, length2, points, rule ? props : children2);
|
12413 | break;
|
12414 | default:
|
12415 | parse$2(characters2, reference, reference, reference, [""], children2, 0, points, children2);
|
12416 | }
|
12417 | }
|
12418 | index = offset = property = 0, variable = ampersand = 1, type2 = characters2 = "", length2 = pseudo;
|
12419 | break;
|
12420 | case 58:
|
12421 | length2 = 1 + strlen(characters2), property = previous;
|
12422 | default:
|
12423 | if (variable < 1) {
|
12424 | if (character2 == 123)
|
12425 | --variable;
|
12426 | else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
12427 | continue;
|
12428 | }
|
12429 | switch (characters2 += from(character2), character2 * variable) {
|
12430 | case 38:
|
12431 | ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
12432 | break;
|
12433 | case 44:
|
12434 | points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
12435 | break;
|
12436 | case 64:
|
12437 | if (peek() === 45)
|
12438 | characters2 += delimit(next());
|
12439 | atrule = peek(), offset = length2 = strlen(type2 = characters2 += identifier(caret())), character2++;
|
12440 | break;
|
12441 | case 45:
|
12442 | if (previous === 45 && strlen(characters2) == 2)
|
12443 | variable = 0;
|
12444 | }
|
12445 | }
|
12446 | return rulesets;
|
12447 | }
|
12448 | function ruleset(value, root2, parent, index, offset, rules, points, type2, props, children2, length2) {
|
12449 | var post = offset - 1;
|
12450 | var rule = offset === 0 ? rules : [""];
|
12451 | var size = sizeof(rule);
|
12452 | for (var i = 0, j = 0, k = 0; i < index; ++i)
|
12453 | for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
12454 | if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
|
12455 | props[k++] = z;
|
12456 | return node(value, root2, parent, offset === 0 ? RULESET : type2, props, children2, length2);
|
12457 | }
|
12458 | function comment(value, root2, parent) {
|
12459 | return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
|
12460 | }
|
12461 | function declaration(value, root2, parent, length2) {
|
12462 | return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
|
12463 | }
|
12464 | function serialize(children2, callback) {
|
12465 | var output = "";
|
12466 | var length2 = sizeof(children2);
|
12467 | for (var i = 0; i < length2; i++)
|
12468 | output += callback(children2[i], i, children2, callback) || "";
|
12469 | return output;
|
12470 | }
|
12471 | function stringify(element, index, children2, callback) {
|
12472 | switch (element.type) {
|
12473 | case IMPORT:
|
12474 | case DECLARATION:
|
12475 | return element.return = element.return || element.value;
|
12476 | case COMMENT:
|
12477 | return "";
|
12478 | case KEYFRAMES:
|
12479 | return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
12480 | case RULESET:
|
12481 | element.value = element.props.join(",");
|
12482 | }
|
12483 | return strlen(children2 = serialize(element.children, callback)) ? element.return = element.value + "{" + children2 + "}" : "";
|
12484 | }
|
12485 | const version = "10.2.0";
|
12486 | const id$i = "c4";
|
12487 | const detector$i = (txt) => {
|
12488 | return txt.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null;
|
12489 | };
|
12490 | const loader$i = async () => {
|
12491 | const { diagram: diagram2 } = await import("./c4Diagram-513b24e8.js");
|
12492 | return { id: id$i, diagram: diagram2 };
|
12493 | };
|
12494 | const plugin$i = {
|
12495 | id: id$i,
|
12496 | detector: detector$i,
|
12497 | loader: loader$i
|
12498 | };
|
12499 | const c4 = plugin$i;
|
12500 | const id$h = "flowchart";
|
12501 | const detector$h = (txt, config2) => {
|
12502 | var _a, _b;
|
12503 | if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") {
|
12504 | return false;
|
12505 | }
|
12506 | return txt.match(/^\s*graph/) !== null;
|
12507 | };
|
12508 | const loader$h = async () => {
|
12509 | const { diagram: diagram2 } = await import("./flowDiagram-6109f557.js");
|
12510 | return { id: id$h, diagram: diagram2 };
|
12511 | };
|
12512 | const plugin$h = {
|
12513 | id: id$h,
|
12514 | detector: detector$h,
|
12515 | loader: loader$h
|
12516 | };
|
12517 | const flowchart = plugin$h;
|
12518 | const id$g = "flowchart-v2";
|
12519 | const detector$g = (txt, config2) => {
|
12520 | var _a, _b, _c;
|
12521 | if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-d3" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") {
|
12522 | return false;
|
12523 | }
|
12524 | if (txt.match(/^\s*graph/) !== null && ((_c = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _c.defaultRenderer) === "dagre-wrapper") {
|
12525 | return true;
|
12526 | }
|
12527 | return txt.match(/^\s*flowchart/) !== null;
|
12528 | };
|
12529 | const loader$g = async () => {
|
12530 | const { diagram: diagram2 } = await import("./flowDiagram-v2-8e0e5a90.js");
|
12531 | return { id: id$g, diagram: diagram2 };
|
12532 | };
|
12533 | const plugin$g = {
|
12534 | id: id$g,
|
12535 | detector: detector$g,
|
12536 | loader: loader$g
|
12537 | };
|
12538 | const flowchartV2 = plugin$g;
|
12539 | const id$f = "er";
|
12540 | const detector$f = (txt) => {
|
12541 | return txt.match(/^\s*erDiagram/) !== null;
|
12542 | };
|
12543 | const loader$f = async () => {
|
12544 | const { diagram: diagram2 } = await import("./erDiagram-8104ad20.js");
|
12545 | return { id: id$f, diagram: diagram2 };
|
12546 | };
|
12547 | const plugin$f = {
|
12548 | id: id$f,
|
12549 | detector: detector$f,
|
12550 | loader: loader$f
|
12551 | };
|
12552 | const er = plugin$f;
|
12553 | const id$e = "gitGraph";
|
12554 | const detector$e = (txt) => {
|
12555 | return txt.match(/^\s*gitGraph/) !== null;
|
12556 | };
|
12557 | const loader$e = async () => {
|
12558 | const { diagram: diagram2 } = await import("./gitGraphDiagram-70b91930.js");
|
12559 | return { id: id$e, diagram: diagram2 };
|
12560 | };
|
12561 | const plugin$e = {
|
12562 | id: id$e,
|
12563 | detector: detector$e,
|
12564 | loader: loader$e
|
12565 | };
|
12566 | const git = plugin$e;
|
12567 | const id$d = "gantt";
|
12568 | const detector$d = (txt) => {
|
12569 | return txt.match(/^\s*gantt/) !== null;
|
12570 | };
|
12571 | const loader$d = async () => {
|
12572 | const { diagram: diagram2 } = await import("./ganttDiagram-528c8345.js");
|
12573 | return { id: id$d, diagram: diagram2 };
|
12574 | };
|
12575 | const plugin$d = {
|
12576 | id: id$d,
|
12577 | detector: detector$d,
|
12578 | loader: loader$d
|
12579 | };
|
12580 | const gantt = plugin$d;
|
12581 | const id$c = "info";
|
12582 | const detector$c = (txt) => {
|
12583 | return txt.match(/^\s*info/) !== null;
|
12584 | };
|
12585 | const loader$c = async () => {
|
12586 | const { diagram: diagram2 } = await import("./infoDiagram-6c45e6e5.js");
|
12587 | return { id: id$c, diagram: diagram2 };
|
12588 | };
|
12589 | const plugin$c = {
|
12590 | id: id$c,
|
12591 | detector: detector$c,
|
12592 | loader: loader$c
|
12593 | };
|
12594 | const info = plugin$c;
|
12595 | const id$b = "pie";
|
12596 | const detector$b = (txt) => {
|
12597 | return txt.match(/^\s*pie/) !== null;
|
12598 | };
|
12599 | const loader$b = async () => {
|
12600 | const { diagram: diagram2 } = await import("./pieDiagram-b37f1ea3.js");
|
12601 | return { id: id$b, diagram: diagram2 };
|
12602 | };
|
12603 | const plugin$b = {
|
12604 | id: id$b,
|
12605 | detector: detector$b,
|
12606 | loader: loader$b
|
12607 | };
|
12608 | const pie = plugin$b;
|
12609 | const id$a = "quadrantChart";
|
12610 | const detector$a = (txt) => {
|
12611 | return txt.match(/^\s*quadrantChart/) !== null;
|
12612 | };
|
12613 | const loader$a = async () => {
|
12614 | const { diagram: diagram2 } = await import("./quadrantDiagram-00f6f261.js");
|
12615 | return { id: id$a, diagram: diagram2 };
|
12616 | };
|
12617 | const plugin$a = {
|
12618 | id: id$a,
|
12619 | detector: detector$a,
|
12620 | loader: loader$a
|
12621 | };
|
12622 | const quadrantChart = plugin$a;
|
12623 | const id$9 = "requirement";
|
12624 | const detector$9 = (txt) => {
|
12625 | return txt.match(/^\s*requirement(Diagram)?/) !== null;
|
12626 | };
|
12627 | const loader$9 = async () => {
|
12628 | const { diagram: diagram2 } = await import("./requirementDiagram-9d006eb9.js");
|
12629 | return { id: id$9, diagram: diagram2 };
|
12630 | };
|
12631 | const plugin$9 = {
|
12632 | id: id$9,
|
12633 | detector: detector$9,
|
12634 | loader: loader$9
|
12635 | };
|
12636 | const requirement = plugin$9;
|
12637 | const id$8 = "sequence";
|
12638 | const detector$8 = (txt) => {
|
12639 | return txt.match(/^\s*sequenceDiagram/) !== null;
|
12640 | };
|
12641 | const loader$8 = async () => {
|
12642 | const { diagram: diagram2 } = await import("./sequenceDiagram-fd141e9d.js");
|
12643 | return { id: id$8, diagram: diagram2 };
|
12644 | };
|
12645 | const plugin$8 = {
|
12646 | id: id$8,
|
12647 | detector: detector$8,
|
12648 | loader: loader$8
|
12649 | };
|
12650 | const sequence = plugin$8;
|
12651 | const id$7 = "class";
|
12652 | const detector$7 = (txt, config2) => {
|
12653 | var _a;
|
12654 | if (((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
12655 | return false;
|
12656 | }
|
12657 | return txt.match(/^\s*classDiagram/) !== null;
|
12658 | };
|
12659 | const loader$7 = async () => {
|
12660 | const { diagram: diagram2 } = await import("./classDiagram-f485cf84.js");
|
12661 | return { id: id$7, diagram: diagram2 };
|
12662 | };
|
12663 | const plugin$7 = {
|
12664 | id: id$7,
|
12665 | detector: detector$7,
|
12666 | loader: loader$7
|
12667 | };
|
12668 | const classDiagram = plugin$7;
|
12669 | const id$6 = "classDiagram";
|
12670 | const detector$6 = (txt, config2) => {
|
12671 | var _a;
|
12672 | if (txt.match(/^\s*classDiagram/) !== null && ((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
12673 | return true;
|
12674 | }
|
12675 | return txt.match(/^\s*classDiagram-v2/) !== null;
|
12676 | };
|
12677 | const loader$6 = async () => {
|
12678 | const { diagram: diagram2 } = await import("./classDiagram-v2-227953d9.js");
|
12679 | return { id: id$6, diagram: diagram2 };
|
12680 | };
|
12681 | const plugin$6 = {
|
12682 | id: id$6,
|
12683 | detector: detector$6,
|
12684 | loader: loader$6
|
12685 | };
|
12686 | const classDiagramV2 = plugin$6;
|
12687 | const id$5 = "state";
|
12688 | const detector$5 = (txt, config2) => {
|
12689 | var _a;
|
12690 | if (((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
12691 | return false;
|
12692 | }
|
12693 | return txt.match(/^\s*stateDiagram/) !== null;
|
12694 | };
|
12695 | const loader$5 = async () => {
|
12696 | const { diagram: diagram2 } = await import("./stateDiagram-27a317c3.js");
|
12697 | return { id: id$5, diagram: diagram2 };
|
12698 | };
|
12699 | const plugin$5 = {
|
12700 | id: id$5,
|
12701 | detector: detector$5,
|
12702 | loader: loader$5
|
12703 | };
|
12704 | const state = plugin$5;
|
12705 | const id$4 = "stateDiagram";
|
12706 | const detector$4 = (text2, config2) => {
|
12707 | var _a, _b;
|
12708 | if (text2.match(/^\s*stateDiagram-v2/) !== null) {
|
12709 | return true;
|
12710 | }
|
12711 | if (text2.match(/^\s*stateDiagram/) && ((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
12712 | return true;
|
12713 | }
|
12714 | if (text2.match(/^\s*stateDiagram/) && ((_b = config2 == null ? void 0 : config2.state) == null ? void 0 : _b.defaultRenderer) === "dagre-wrapper") {
|
12715 | return true;
|
12716 | }
|
12717 | return false;
|
12718 | };
|
12719 | const loader$4 = async () => {
|
12720 | const { diagram: diagram2 } = await import("./stateDiagram-v2-f9cea4e2.js");
|
12721 | return { id: id$4, diagram: diagram2 };
|
12722 | };
|
12723 | const plugin$4 = {
|
12724 | id: id$4,
|
12725 | detector: detector$4,
|
12726 | loader: loader$4
|
12727 | };
|
12728 | const stateV2 = plugin$4;
|
12729 | const id$3 = "journey";
|
12730 | const detector$3 = (txt) => {
|
12731 | return txt.match(/^\s*journey/) !== null;
|
12732 | };
|
12733 | const loader$3 = async () => {
|
12734 | const { diagram: diagram2 } = await import("./journeyDiagram-5faf9fb3.js");
|
12735 | return { id: id$3, diagram: diagram2 };
|
12736 | };
|
12737 | const plugin$3 = {
|
12738 | id: id$3,
|
12739 | detector: detector$3,
|
12740 | loader: loader$3
|
12741 | };
|
12742 | const journey = plugin$3;
|
12743 | const getStyles = () => ``;
|
12744 | const styles = getStyles;
|
12745 | const setConf = function() {
|
12746 | };
|
12747 | const draw = (_text, id2, mermaidVersion) => {
|
12748 | try {
|
12749 | log$1.debug("Renering svg for syntax error\n");
|
12750 | const svg2 = select("#" + id2);
|
12751 | const g = svg2.append("g");
|
12752 | g.append("path").attr("class", "error-icon").attr(
|
12753 | "d",
|
12754 | "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
|
12755 | );
|
12756 | g.append("path").attr("class", "error-icon").attr(
|
12757 | "d",
|
12758 | "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
|
12759 | );
|
12760 | g.append("path").attr("class", "error-icon").attr(
|
12761 | "d",
|
12762 | "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
|
12763 | );
|
12764 | g.append("path").attr("class", "error-icon").attr(
|
12765 | "d",
|
12766 | "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
|
12767 | );
|
12768 | g.append("path").attr("class", "error-icon").attr(
|
12769 | "d",
|
12770 | "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
|
12771 | );
|
12772 | g.append("path").attr("class", "error-icon").attr(
|
12773 | "d",
|
12774 | "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
|
12775 | );
|
12776 | g.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text");
|
12777 | g.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text("mermaid version " + mermaidVersion);
|
12778 | svg2.attr("height", 100);
|
12779 | svg2.attr("width", 500);
|
12780 | svg2.attr("viewBox", "768 0 912 512");
|
12781 | } catch (e) {
|
12782 | log$1.error("Error while rendering info diagram");
|
12783 | log$1.error(getErrorMessage(e));
|
12784 | }
|
12785 | };
|
12786 | const errorRenderer = {
|
12787 | setConf,
|
12788 | draw
|
12789 | };
|
12790 | const diagram = {
|
12791 | db: {
|
12792 | clear: () => {
|
12793 | }
|
12794 | },
|
12795 | styles,
|
12796 | renderer: errorRenderer,
|
12797 | parser: {
|
12798 | parser: { yy: {} },
|
12799 | parse: () => {
|
12800 | }
|
12801 | },
|
12802 | init: () => {
|
12803 | }
|
12804 | };
|
12805 | const errorDiagram = diagram;
|
12806 | const id$2 = "flowchart-elk";
|
12807 | const detector$2 = (txt, config2) => {
|
12808 | var _a;
|
12809 | if (
|
12810 |
|
12811 | txt.match(/^\s*flowchart-elk/) ||
|
12812 | txt.match(/^\s*flowchart|graph/) && ((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "elk"
|
12813 | ) {
|
12814 | return true;
|
12815 | }
|
12816 | return false;
|
12817 | };
|
12818 | const loader$2 = async () => {
|
12819 | const { diagram: diagram2 } = await import("./flowchart-elk-definition-37ec854a.js");
|
12820 | return { id: id$2, diagram: diagram2 };
|
12821 | };
|
12822 | const plugin$2 = {
|
12823 | id: id$2,
|
12824 | detector: detector$2,
|
12825 | loader: loader$2
|
12826 | };
|
12827 | const flowchartElk = plugin$2;
|
12828 | const id$1 = "timeline";
|
12829 | const detector$1 = (txt) => {
|
12830 | return txt.match(/^\s*timeline/) !== null;
|
12831 | };
|
12832 | const loader$1 = async () => {
|
12833 | const { diagram: diagram2 } = await import("./timeline-definition-8c5f9700.js");
|
12834 | return { id: id$1, diagram: diagram2 };
|
12835 | };
|
12836 | const plugin$1 = {
|
12837 | id: id$1,
|
12838 | detector: detector$1,
|
12839 | loader: loader$1
|
12840 | };
|
12841 | const timeline = plugin$1;
|
12842 | const id = "mindmap";
|
12843 | const detector = (txt) => {
|
12844 | return txt.match(/^\s*mindmap/) !== null;
|
12845 | };
|
12846 | const loader = async () => {
|
12847 | const { diagram: diagram2 } = await import("./mindmap-definition-72dfd2cf.js");
|
12848 | return { id, diagram: diagram2 };
|
12849 | };
|
12850 | const plugin = {
|
12851 | id,
|
12852 | detector,
|
12853 | loader
|
12854 | };
|
12855 | const mindmap = plugin;
|
12856 | let hasLoadedDiagrams = false;
|
12857 | const addDiagrams = () => {
|
12858 | if (hasLoadedDiagrams) {
|
12859 | return;
|
12860 | }
|
12861 | hasLoadedDiagrams = true;
|
12862 | registerDiagram("error", errorDiagram, (text2) => {
|
12863 | return text2.toLowerCase().trim() === "error";
|
12864 | });
|
12865 | registerDiagram(
|
12866 | "---",
|
12867 |
|
12868 | {
|
12869 | db: {
|
12870 | clear: () => {
|
12871 | }
|
12872 | },
|
12873 | styles: {},
|
12874 |
|
12875 | renderer: {},
|
12876 |
|
12877 | parser: {
|
12878 | parser: { yy: {} },
|
12879 | parse: () => {
|
12880 | throw new Error(
|
12881 | "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
|
12882 | );
|
12883 | }
|
12884 | },
|
12885 | init: () => null
|
12886 |
|
12887 | },
|
12888 | (text2) => {
|
12889 | return text2.toLowerCase().trimStart().startsWith("---");
|
12890 | }
|
12891 | );
|
12892 | registerLazyLoadedDiagrams(
|
12893 | c4,
|
12894 | classDiagramV2,
|
12895 | classDiagram,
|
12896 | er,
|
12897 | gantt,
|
12898 | info,
|
12899 | pie,
|
12900 | requirement,
|
12901 | sequence,
|
12902 | flowchartElk,
|
12903 | flowchartV2,
|
12904 | flowchart,
|
12905 | mindmap,
|
12906 | timeline,
|
12907 | git,
|
12908 | stateV2,
|
12909 | state,
|
12910 | journey,
|
12911 | quadrantChart
|
12912 | );
|
12913 | };
|
12914 | const cleanupComments = (text2) => {
|
12915 | return text2.trimStart().replace(/^\s*%%(?!{)[^\n]+\n?/gm, "");
|
12916 | };
|
12917 | class Diagram {
|
12918 | constructor(text2) {
|
12919 | var _a, _b;
|
12920 | this.text = text2;
|
12921 | this.type = "graph";
|
12922 | this.text += "\n";
|
12923 | const cnf = getConfig$1();
|
12924 | try {
|
12925 | this.type = detectType(text2, cnf);
|
12926 | } catch (e) {
|
12927 | this.type = "error";
|
12928 | this.detectError = e;
|
12929 | }
|
12930 | const diagram2 = getDiagram(this.type);
|
12931 | log$1.debug("Type " + this.type);
|
12932 | this.db = diagram2.db;
|
12933 | (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a);
|
12934 | this.renderer = diagram2.renderer;
|
12935 | this.parser = diagram2.parser;
|
12936 | const originalParse = this.parser.parse.bind(this.parser);
|
12937 | this.parser.parse = (text22) => originalParse(cleanupComments(extractFrontMatter(text22, this.db)));
|
12938 | this.parser.parser.yy = this.db;
|
12939 | if (diagram2.init) {
|
12940 | diagram2.init(cnf);
|
12941 | log$1.info("Initialized diagram " + this.type, cnf);
|
12942 | }
|
12943 | this.parse();
|
12944 | }
|
12945 | parse() {
|
12946 | var _a, _b;
|
12947 | if (this.detectError) {
|
12948 | throw this.detectError;
|
12949 | }
|
12950 | (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a);
|
12951 | this.parser.parse(this.text);
|
12952 | }
|
12953 | async render(id2, version2) {
|
12954 | await this.renderer.draw(this.text, id2, version2, this);
|
12955 | }
|
12956 | getParser() {
|
12957 | return this.parser;
|
12958 | }
|
12959 | getType() {
|
12960 | return this.type;
|
12961 | }
|
12962 | }
|
12963 | const getDiagramFromText = async (text2) => {
|
12964 | const type2 = detectType(text2, getConfig$1());
|
12965 | try {
|
12966 | getDiagram(type2);
|
12967 | } catch (error) {
|
12968 | const loader2 = getDiagramLoader(type2);
|
12969 | if (!loader2) {
|
12970 | throw new UnknownDiagramError(`Diagram ${type2} not found.`);
|
12971 | }
|
12972 | const { id: id2, diagram: diagram2 } = await loader2();
|
12973 | registerDiagram(id2, diagram2);
|
12974 | }
|
12975 | return new Diagram(text2);
|
12976 | };
|
12977 | let interactionFunctions = [];
|
12978 | const addFunction = (func) => {
|
12979 | interactionFunctions.push(func);
|
12980 | };
|
12981 | const attachFunctions = () => {
|
12982 | interactionFunctions.forEach((f) => {
|
12983 | f();
|
12984 | });
|
12985 | interactionFunctions = [];
|
12986 | };
|
12987 | var objectProto$3 = Object.prototype;
|
12988 | function isPrototype(value) {
|
12989 | var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto$3;
|
12990 | return value === proto2;
|
12991 | }
|
12992 | function overArg(func, transform) {
|
12993 | return function(arg) {
|
12994 | return func(transform(arg));
|
12995 | };
|
12996 | }
|
12997 | var nativeKeys = overArg(Object.keys, Object);
|
12998 | const nativeKeys$1 = nativeKeys;
|
12999 | var objectProto$2 = Object.prototype;
|
13000 | var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
13001 | function baseKeys(object) {
|
13002 | if (!isPrototype(object)) {
|
13003 | return nativeKeys$1(object);
|
13004 | }
|
13005 | var result = [];
|
13006 | for (var key in Object(object)) {
|
13007 | if (hasOwnProperty$2.call(object, key) && key != "constructor") {
|
13008 | result.push(key);
|
13009 | }
|
13010 | }
|
13011 | return result;
|
13012 | }
|
13013 | var DataView = getNative(root$1, "DataView");
|
13014 | const DataView$1 = DataView;
|
13015 | var Promise$1 = getNative(root$1, "Promise");
|
13016 | const Promise$2 = Promise$1;
|
13017 | var Set = getNative(root$1, "Set");
|
13018 | const Set$1 = Set;
|
13019 | var WeakMap = getNative(root$1, "WeakMap");
|
13020 | const WeakMap$1 = WeakMap;
|
13021 | var mapTag$2 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$2 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
13022 | var dataViewTag$1 = "[object DataView]";
|
13023 | var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
|
13024 | var getTag = baseGetTag;
|
13025 | if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$1 || Map$2 && getTag(new Map$2()) != mapTag$2 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$2 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) {
|
13026 | getTag = function(value) {
|
13027 | var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
13028 | if (ctorString) {
|
13029 | switch (ctorString) {
|
13030 | case dataViewCtorString:
|
13031 | return dataViewTag$1;
|
13032 | case mapCtorString:
|
13033 | return mapTag$2;
|
13034 | case promiseCtorString:
|
13035 | return promiseTag;
|
13036 | case setCtorString:
|
13037 | return setTag$2;
|
13038 | case weakMapCtorString:
|
13039 | return weakMapTag$1;
|
13040 | }
|
13041 | }
|
13042 | return result;
|
13043 | };
|
13044 | }
|
13045 | const getTag$1 = getTag;
|
13046 | function isObjectLike(value) {
|
13047 | return value != null && typeof value == "object";
|
13048 | }
|
13049 | var argsTag$1 = "[object Arguments]";
|
13050 | function baseIsArguments(value) {
|
13051 | return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
13052 | }
|
13053 | var objectProto$1 = Object.prototype;
|
13054 | var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
13055 | var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
|
13056 | var isArguments = baseIsArguments(function() {
|
13057 | return arguments;
|
13058 | }()) ? baseIsArguments : function(value) {
|
13059 | return isObjectLike(value) && hasOwnProperty$1.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
13060 | };
|
13061 | const isArguments$1 = isArguments;
|
13062 | var isArray = Array.isArray;
|
13063 | const isArray$1 = isArray;
|
13064 | var MAX_SAFE_INTEGER = 9007199254740991;
|
13065 | function isLength(value) {
|
13066 | return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
13067 | }
|
13068 | function isArrayLike(value) {
|
13069 | return value != null && isLength(value.length) && !isFunction(value);
|
13070 | }
|
13071 | function stubFalse() {
|
13072 | return false;
|
13073 | }
|
13074 | var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
13075 | var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
13076 | var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
13077 | var Buffer = moduleExports$1 ? root$1.Buffer : void 0;
|
13078 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
13079 | var isBuffer = nativeIsBuffer || stubFalse;
|
13080 | const isBuffer$1 = isBuffer;
|
13081 | var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag$1 = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
|
13082 | var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
13083 | var typedArrayTags = {};
|
13084 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
13085 | typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
13086 | function baseIsTypedArray(value) {
|
13087 | return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
13088 | }
|
13089 | function baseUnary(func) {
|
13090 | return function(value) {
|
13091 | return func(value);
|
13092 | };
|
13093 | }
|
13094 | var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
13095 | var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
13096 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
13097 | var freeProcess = moduleExports && freeGlobal$1.process;
|
13098 | var nodeUtil = function() {
|
13099 | try {
|
13100 | var types = freeModule && freeModule.require && freeModule.require("util").types;
|
13101 | if (types) {
|
13102 | return types;
|
13103 | }
|
13104 | return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
13105 | } catch (e) {
|
13106 | }
|
13107 | }();
|
13108 | const nodeUtil$1 = nodeUtil;
|
13109 | var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
13110 | var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
13111 | const isTypedArray$1 = isTypedArray;
|
13112 | var mapTag = "[object Map]", setTag = "[object Set]";
|
13113 | var objectProto = Object.prototype;
|
13114 | var hasOwnProperty = objectProto.hasOwnProperty;
|
13115 | function isEmpty(value) {
|
13116 | if (value == null) {
|
13117 | return true;
|
13118 | }
|
13119 | if (isArrayLike(value) && (isArray$1(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer$1(value) || isTypedArray$1(value) || isArguments$1(value))) {
|
13120 | return !value.length;
|
13121 | }
|
13122 | var tag = getTag$1(value);
|
13123 | if (tag == mapTag || tag == setTag) {
|
13124 | return !value.size;
|
13125 | }
|
13126 | if (isPrototype(value)) {
|
13127 | return !baseKeys(value).length;
|
13128 | }
|
13129 | for (var key in value) {
|
13130 | if (hasOwnProperty.call(value, key)) {
|
13131 | return false;
|
13132 | }
|
13133 | }
|
13134 | return true;
|
13135 | }
|
13136 | const SVG_ROLE = "graphics-document document";
|
13137 | function setA11yDiagramInfo(svg2, diagramType) {
|
13138 | svg2.attr("role", SVG_ROLE);
|
13139 | if (!isEmpty(diagramType)) {
|
13140 | svg2.attr("aria-roledescription", diagramType);
|
13141 | }
|
13142 | }
|
13143 | function addSVGa11yTitleDescription(svg2, a11yTitle, a11yDesc, baseId) {
|
13144 | if (svg2.insert === void 0) {
|
13145 | return;
|
13146 | }
|
13147 | if (a11yTitle || a11yDesc) {
|
13148 | if (a11yDesc) {
|
13149 | const descId = "chart-desc-" + baseId;
|
13150 | svg2.attr("aria-describedby", descId);
|
13151 | svg2.insert("desc", ":first-child").attr("id", descId).text(a11yDesc);
|
13152 | }
|
13153 | if (a11yTitle) {
|
13154 | const titleId = "chart-title-" + baseId;
|
13155 | svg2.attr("aria-labelledby", titleId);
|
13156 | svg2.insert("title", ":first-child").attr("id", titleId).text(a11yTitle);
|
13157 | }
|
13158 | } else {
|
13159 | return;
|
13160 | }
|
13161 | }
|
13162 | const CLASSDEF_DIAGRAMS = [
|
13163 | "graph",
|
13164 | "flowchart",
|
13165 | "flowchart-v2",
|
13166 | "flowchart-elk",
|
13167 | "stateDiagram",
|
13168 | "stateDiagram-v2"
|
13169 | ];
|
13170 | const MAX_TEXTLENGTH = 5e4;
|
13171 | const MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa";
|
13172 | const SECURITY_LVL_SANDBOX = "sandbox";
|
13173 | const SECURITY_LVL_LOOSE = "loose";
|
13174 | const XMLNS_SVG_STD = "http://www.w3.org/2000/svg";
|
13175 | const XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink";
|
13176 | const XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml";
|
13177 | const IFRAME_WIDTH = "100%";
|
13178 | const IFRAME_HEIGHT = "100%";
|
13179 | const IFRAME_STYLES = "border:0;margin:0;";
|
13180 | const IFRAME_BODY_STYLE = "margin:0";
|
13181 | const IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups";
|
13182 | const IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.';
|
13183 | const DOMPURIFY_TAGS = ["foreignobject"];
|
13184 | const DOMPURIFY_ATTR = ["dominant-baseline"];
|
13185 | async function parse$1(text2, parseOptions) {
|
13186 | addDiagrams();
|
13187 | try {
|
13188 | const diagram2 = await getDiagramFromText(text2);
|
13189 | diagram2.parse();
|
13190 | } catch (error) {
|
13191 | if (parseOptions == null ? void 0 : parseOptions.suppressErrors) {
|
13192 | return false;
|
13193 | }
|
13194 | throw error;
|
13195 | }
|
13196 | return true;
|
13197 | }
|
13198 | const encodeEntities = function(text2) {
|
13199 | let txt = text2;
|
13200 | txt = txt.replace(/style.*:\S*#.*;/g, function(s) {
|
13201 | return s.substring(0, s.length - 1);
|
13202 | });
|
13203 | txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) {
|
13204 | return s.substring(0, s.length - 1);
|
13205 | });
|
13206 | txt = txt.replace(/#\w+;/g, function(s) {
|
13207 | const innerTxt = s.substring(1, s.length - 1);
|
13208 | const isInt = /^\+?\d+$/.test(innerTxt);
|
13209 | if (isInt) {
|
13210 | return "fl°°" + innerTxt + "¶ß";
|
13211 | } else {
|
13212 | return "fl°" + innerTxt + "¶ß";
|
13213 | }
|
13214 | });
|
13215 | return txt;
|
13216 | };
|
13217 | const decodeEntities = function(text2) {
|
13218 | return text2.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";");
|
13219 | };
|
13220 | const cssImportantStyles = (cssClass, element, cssClasses = []) => {
|
13221 | return `
|
13222 | .${cssClass} ${element} { ${cssClasses.join(" !important; ")} !important; }`;
|
13223 | };
|
13224 | const createCssStyles = (config2, graphType, classDefs = {}) => {
|
13225 | var _a;
|
13226 | let cssStyles = "";
|
13227 | if (config2.themeCSS !== void 0) {
|
13228 | cssStyles += `
|
13229 | ${config2.themeCSS}`;
|
13230 | }
|
13231 | if (config2.fontFamily !== void 0) {
|
13232 | cssStyles += `
|
13233 | :root { --mermaid-font-family: ${config2.fontFamily}}`;
|
13234 | }
|
13235 | if (config2.altFontFamily !== void 0) {
|
13236 | cssStyles += `
|
13237 | :root { --mermaid-alt-font-family: ${config2.altFontFamily}}`;
|
13238 | }
|
13239 | if (!isEmpty(classDefs) && CLASSDEF_DIAGRAMS.includes(graphType)) {
|
13240 | const htmlLabels = config2.htmlLabels || ((_a = config2.flowchart) == null ? void 0 : _a.htmlLabels);
|
13241 | const cssHtmlElements = ["> *", "span"];
|
13242 | const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"];
|
13243 | const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;
|
13244 | for (const classId in classDefs) {
|
13245 | const styleClassDef = classDefs[classId];
|
13246 | if (!isEmpty(styleClassDef.styles)) {
|
13247 | cssElements.forEach((cssElement) => {
|
13248 | cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);
|
13249 | });
|
13250 | }
|
13251 | if (!isEmpty(styleClassDef.textStyles)) {
|
13252 | cssStyles += cssImportantStyles(styleClassDef.id, "tspan", styleClassDef.textStyles);
|
13253 | }
|
13254 | }
|
13255 | }
|
13256 | return cssStyles;
|
13257 | };
|
13258 | const createUserStyles = (config2, graphType, classDefs, svgId) => {
|
13259 | const userCSSstyles = createCssStyles(config2, graphType, classDefs);
|
13260 | const allStyles = getStyles$2(graphType, userCSSstyles, config2.themeVariables);
|
13261 | return serialize(compile(`${svgId}{${allStyles}}`), stringify);
|
13262 | };
|
13263 | const cleanUpSvgCode = (svgCode = "", inSandboxMode, useArrowMarkerUrls) => {
|
13264 | let cleanedUpSvg = svgCode;
|
13265 | if (!useArrowMarkerUrls && !inSandboxMode) {
|
13266 | cleanedUpSvg = cleanedUpSvg.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#');
|
13267 | }
|
13268 | cleanedUpSvg = decodeEntities(cleanedUpSvg);
|
13269 | cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, "<br/>");
|
13270 | return cleanedUpSvg;
|
13271 | };
|
13272 | const putIntoIFrame = (svgCode = "", svgElement) => {
|
13273 | const height = svgElement ? svgElement.viewBox.baseVal.height + "px" : IFRAME_HEIGHT;
|
13274 | const base64encodedSrc = btoa('<body style="' + IFRAME_BODY_STYLE + '">' + svgCode + "</body>");
|
13275 | return `<iframe style="width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}" src="data:text/html;base64,${base64encodedSrc}" sandbox="${IFRAME_SANDBOX_OPTS}">
|
13276 | ${IFRAME_NOT_SUPPORTED_MSG}
|
13277 | </iframe>`;
|
13278 | };
|
13279 | const appendDivSvgG = (parentRoot, id2, enclosingDivId, divStyle, svgXlink) => {
|
13280 | const enclosingDiv = parentRoot.append("div");
|
13281 | enclosingDiv.attr("id", enclosingDivId);
|
13282 | if (divStyle) {
|
13283 | enclosingDiv.attr("style", divStyle);
|
13284 | }
|
13285 | const svgNode2 = enclosingDiv.append("svg").attr("id", id2).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
|
13286 | if (svgXlink) {
|
13287 | svgNode2.attr("xmlns:xlink", svgXlink);
|
13288 | }
|
13289 | svgNode2.append("g");
|
13290 | return parentRoot;
|
13291 | };
|
13292 | function sandboxedIframe(parentNode, iFrameId) {
|
13293 | return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
|
13294 | }
|
13295 | const removeExistingElements = (doc, id2, divId, iFrameId) => {
|
13296 | var _a, _b, _c;
|
13297 | (_a = doc.getElementById(id2)) == null ? void 0 : _a.remove();
|
13298 | (_b = doc.getElementById(divId)) == null ? void 0 : _b.remove();
|
13299 | (_c = doc.getElementById(iFrameId)) == null ? void 0 : _c.remove();
|
13300 | };
|
13301 | const render$1 = async function(id2, text2, svgContainingElement) {
|
13302 | var _a, _b, _c, _d;
|
13303 | addDiagrams();
|
13304 | reset();
|
13305 | const graphInit = utils.detectInit(text2);
|
13306 | if (graphInit) {
|
13307 | directiveSanitizer(graphInit);
|
13308 | addDirective(graphInit);
|
13309 | }
|
13310 | const config2 = getConfig$1();
|
13311 | log$1.debug(config2);
|
13312 | if (text2.length > ((config2 == null ? void 0 : config2.maxTextSize) ?? MAX_TEXTLENGTH)) {
|
13313 | text2 = MAX_TEXTLENGTH_EXCEEDED_MSG;
|
13314 | }
|
13315 | text2 = text2.replace(/\r\n?/g, "\n");
|
13316 | text2 = text2.replace(
|
13317 | /<(\w+)([^>]*)>/g,
|
13318 | (match, tag, attributes) => "<" + tag + attributes.replace(/="([^"]*)"/g, "='$1'") + ">"
|
13319 | );
|
13320 | const idSelector = "#" + id2;
|
13321 | const iFrameID = "i" + id2;
|
13322 | const iFrameID_selector = "#" + iFrameID;
|
13323 | const enclosingDivID = "d" + id2;
|
13324 | const enclosingDivID_selector = "#" + enclosingDivID;
|
13325 | let root2 = select("body");
|
13326 | const isSandboxed = config2.securityLevel === SECURITY_LVL_SANDBOX;
|
13327 | const isLooseSecurityLevel = config2.securityLevel === SECURITY_LVL_LOOSE;
|
13328 | const fontFamily = config2.fontFamily;
|
13329 | if (svgContainingElement !== void 0) {
|
13330 | if (svgContainingElement) {
|
13331 | svgContainingElement.innerHTML = "";
|
13332 | }
|
13333 | if (isSandboxed) {
|
13334 | const iframe = sandboxedIframe(select(svgContainingElement), iFrameID);
|
13335 | root2 = select(iframe.nodes()[0].contentDocument.body);
|
13336 | root2.node().style.margin = 0;
|
13337 | } else {
|
13338 | root2 = select(svgContainingElement);
|
13339 | }
|
13340 | appendDivSvgG(root2, id2, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);
|
13341 | } else {
|
13342 | removeExistingElements(document, id2, enclosingDivID, iFrameID);
|
13343 | if (isSandboxed) {
|
13344 | const iframe = sandboxedIframe(select("body"), iFrameID);
|
13345 | root2 = select(iframe.nodes()[0].contentDocument.body);
|
13346 | root2.node().style.margin = 0;
|
13347 | } else {
|
13348 | root2 = select("body");
|
13349 | }
|
13350 | appendDivSvgG(root2, id2, enclosingDivID);
|
13351 | }
|
13352 | text2 = encodeEntities(text2);
|
13353 | let diag;
|
13354 | let parseEncounteredException;
|
13355 | try {
|
13356 | diag = await getDiagramFromText(text2);
|
13357 | } catch (error) {
|
13358 | diag = new Diagram("error");
|
13359 | parseEncounteredException = error;
|
13360 | }
|
13361 | const element = root2.select(enclosingDivID_selector).node();
|
13362 | const graphType = diag.type;
|
13363 | const svg2 = element.firstChild;
|
13364 | const firstChild = svg2.firstChild;
|
13365 | const diagramClassDefs = CLASSDEF_DIAGRAMS.includes(graphType) ? diag.renderer.getClasses(text2, diag) : {};
|
13366 | const rules = createUserStyles(
|
13367 | config2,
|
13368 | graphType,
|
13369 | // @ts-ignore convert renderer to TS.
|
13370 | diagramClassDefs,
|
13371 | idSelector
|
13372 | );
|
13373 | const style1 = document.createElement("style");
|
13374 | style1.innerHTML = rules;
|
13375 | svg2.insertBefore(style1, firstChild);
|
13376 | try {
|
13377 | await diag.renderer.draw(text2, id2, version, diag);
|
13378 | } catch (e) {
|
13379 | errorRenderer.draw(text2, id2, version);
|
13380 | throw e;
|
13381 | }
|
13382 | const svgNode2 = root2.select(`${enclosingDivID_selector} svg`);
|
13383 | const a11yTitle = (_b = (_a = diag.db).getAccTitle) == null ? void 0 : _b.call(_a);
|
13384 | const a11yDescr = (_d = (_c = diag.db).getAccDescription) == null ? void 0 : _d.call(_c);
|
13385 | addA11yInfo(graphType, svgNode2, a11yTitle, a11yDescr);
|
13386 | root2.select(`[id="${id2}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD);
|
13387 | let svgCode = root2.select(enclosingDivID_selector).node().innerHTML;
|
13388 | log$1.debug("config.arrowMarkerAbsolute", config2.arrowMarkerAbsolute);
|
13389 | svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config2.arrowMarkerAbsolute));
|
13390 | if (isSandboxed) {
|
13391 | const svgEl = root2.select(enclosingDivID_selector + " svg").node();
|
13392 | svgCode = putIntoIFrame(svgCode, svgEl);
|
13393 | } else if (!isLooseSecurityLevel) {
|
13394 | svgCode = purify.sanitize(svgCode, {
|
13395 | ADD_TAGS: DOMPURIFY_TAGS,
|
13396 | ADD_ATTR: DOMPURIFY_ATTR
|
13397 | });
|
13398 | }
|
13399 | attachFunctions();
|
13400 | if (parseEncounteredException) {
|
13401 | throw parseEncounteredException;
|
13402 | }
|
13403 | const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;
|
13404 | const node2 = select(tmpElementSelector).node();
|
13405 | if (node2 && "remove" in node2) {
|
13406 | node2.remove();
|
13407 | }
|
13408 | return {
|
13409 | svg: svgCode,
|
13410 | bindFunctions: diag.db.bindFunctions
|
13411 | };
|
13412 | };
|
13413 | function initialize$1(options = {}) {
|
13414 | var _a;
|
13415 | if ((options == null ? void 0 : options.fontFamily) && !((_a = options.themeVariables) == null ? void 0 : _a.fontFamily)) {
|
13416 | if (!options.themeVariables) {
|
13417 | options.themeVariables = {};
|
13418 | }
|
13419 | options.themeVariables.fontFamily = options.fontFamily;
|
13420 | }
|
13421 | saveConfigFromInitialize(options);
|
13422 | if ((options == null ? void 0 : options.theme) && options.theme in theme) {
|
13423 | options.themeVariables = theme[options.theme].getThemeVariables(
|
13424 | options.themeVariables
|
13425 | );
|
13426 | } else if (options) {
|
13427 | options.themeVariables = theme.default.getThemeVariables(options.themeVariables);
|
13428 | }
|
13429 | const config2 = typeof options === "object" ? setSiteConfig(options) : getSiteConfig();
|
13430 | setLogLevel$1(config2.logLevel);
|
13431 | addDiagrams();
|
13432 | }
|
13433 | function addA11yInfo(graphType, svgNode2, a11yTitle, a11yDescr) {
|
13434 | setA11yDiagramInfo(svgNode2, graphType);
|
13435 | addSVGa11yTitleDescription(svgNode2, a11yTitle, a11yDescr, svgNode2.attr("id"));
|
13436 | }
|
13437 | const mermaidAPI = Object.freeze({
|
13438 | render: render$1,
|
13439 | parse: parse$1,
|
13440 | parseDirective: parseDirective$1,
|
13441 | getDiagramFromText,
|
13442 | initialize: initialize$1,
|
13443 | getConfig: getConfig$1,
|
13444 | setConfig,
|
13445 | getSiteConfig,
|
13446 | updateSiteConfig,
|
13447 | reset: () => {
|
13448 | reset();
|
13449 | },
|
13450 | globalReset: () => {
|
13451 | reset(defaultConfig);
|
13452 | },
|
13453 | defaultConfig
|
13454 | });
|
13455 | setLogLevel$1(getConfig$1().logLevel);
|
13456 | reset(getConfig$1());
|
13457 | const handleError = (error, errors, parseError) => {
|
13458 | log$1.warn(error);
|
13459 | if (isDetailedError(error)) {
|
13460 | if (parseError) {
|
13461 | parseError(error.str, error.hash);
|
13462 | }
|
13463 | errors.push({ ...error, message: error.str, error });
|
13464 | } else {
|
13465 | if (parseError) {
|
13466 | parseError(error);
|
13467 | }
|
13468 | if (error instanceof Error) {
|
13469 | errors.push({
|
13470 | str: error.message,
|
13471 | message: error.message,
|
13472 | hash: error.name,
|
13473 | error
|
13474 | });
|
13475 | }
|
13476 | }
|
13477 | };
|
13478 | const run = async function(options = {
|
13479 | querySelector: ".mermaid"
|
13480 | }) {
|
13481 | try {
|
13482 | await runThrowsErrors(options);
|
13483 | } catch (e) {
|
13484 | if (isDetailedError(e)) {
|
13485 | log$1.error(e.str);
|
13486 | }
|
13487 | if (mermaid.parseError) {
|
13488 | mermaid.parseError(e);
|
13489 | }
|
13490 | if (!options.suppressErrors) {
|
13491 | log$1.error("Use the suppressErrors option to suppress these errors");
|
13492 | throw e;
|
13493 | }
|
13494 | }
|
13495 | };
|
13496 | const runThrowsErrors = async function({ postRenderCallback, querySelector, nodes } = {
|
13497 | querySelector: ".mermaid"
|
13498 | }) {
|
13499 | const conf = mermaidAPI.getConfig();
|
13500 | log$1.debug(`${!postRenderCallback ? "No " : ""}Callback function found`);
|
13501 | let nodesToProcess;
|
13502 | if (nodes) {
|
13503 | nodesToProcess = nodes;
|
13504 | } else if (querySelector) {
|
13505 | nodesToProcess = document.querySelectorAll(querySelector);
|
13506 | } else {
|
13507 | throw new Error("Nodes and querySelector are both undefined");
|
13508 | }
|
13509 | log$1.debug(`Found ${nodesToProcess.length} diagrams`);
|
13510 | if ((conf == null ? void 0 : conf.startOnLoad) !== void 0) {
|
13511 | log$1.debug("Start On Load: " + (conf == null ? void 0 : conf.startOnLoad));
|
13512 | mermaidAPI.updateSiteConfig({ startOnLoad: conf == null ? void 0 : conf.startOnLoad });
|
13513 | }
|
13514 | const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
|
13515 | let txt;
|
13516 | const errors = [];
|
13517 | for (const element of Array.from(nodesToProcess)) {
|
13518 | log$1.info("Rendering diagram: " + element.id);
|
13519 | /*! Check if previously processed */
|
13520 | if (element.getAttribute("data-processed")) {
|
13521 | continue;
|
13522 | }
|
13523 | element.setAttribute("data-processed", "true");
|
13524 | const id2 = `mermaid-${idGenerator.next()}`;
|
13525 | txt = element.innerHTML;
|
13526 | txt = dedent(utils.entityDecode(txt)).trim().replace(/<br\s*\/?>/gi, "<br/>");
|
13527 | const init2 = utils.detectInit(txt);
|
13528 | if (init2) {
|
13529 | log$1.debug("Detected early reinit: ", init2);
|
13530 | }
|
13531 | try {
|
13532 | const { svg: svg2, bindFunctions } = await render(id2, txt, element);
|
13533 | element.innerHTML = svg2;
|
13534 | if (postRenderCallback) {
|
13535 | await postRenderCallback(id2);
|
13536 | }
|
13537 | if (bindFunctions) {
|
13538 | bindFunctions(element);
|
13539 | }
|
13540 | } catch (error) {
|
13541 | handleError(error, errors, mermaid.parseError);
|
13542 | }
|
13543 | }
|
13544 | if (errors.length > 0) {
|
13545 | throw errors[0];
|
13546 | }
|
13547 | };
|
13548 | const initialize = function(config2) {
|
13549 | mermaidAPI.initialize(config2);
|
13550 | };
|
13551 | const init = async function(config2, nodes, callback) {
|
13552 | log$1.warn("mermaid.init is deprecated. Please use run instead.");
|
13553 | if (config2) {
|
13554 | initialize(config2);
|
13555 | }
|
13556 | const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" };
|
13557 | if (typeof nodes === "string") {
|
13558 | runOptions.querySelector = nodes;
|
13559 | } else if (nodes) {
|
13560 | if (nodes instanceof HTMLElement) {
|
13561 | runOptions.nodes = [nodes];
|
13562 | } else {
|
13563 | runOptions.nodes = nodes;
|
13564 | }
|
13565 | }
|
13566 | await run(runOptions);
|
13567 | };
|
13568 | const registerExternalDiagrams = async (diagrams2, {
|
13569 | lazyLoad = true
|
13570 | } = {}) => {
|
13571 | registerLazyLoadedDiagrams(...diagrams2);
|
13572 | if (lazyLoad === false) {
|
13573 | await loadRegisteredDiagrams();
|
13574 | }
|
13575 | };
|
13576 | const contentLoaded = function() {
|
13577 | if (mermaid.startOnLoad) {
|
13578 | const { startOnLoad } = mermaidAPI.getConfig();
|
13579 | if (startOnLoad) {
|
13580 | mermaid.run().catch((err) => log$1.error("Mermaid failed to initialize", err));
|
13581 | }
|
13582 | }
|
13583 | };
|
13584 | if (typeof document !== "undefined") {
|
13585 | /*!
|
13586 | * Wait for document loaded before starting the execution
|
13587 | */
|
13588 | window.addEventListener("load", contentLoaded, false);
|
13589 | }
|
13590 | const setParseErrorHandler = function(parseErrorHandler) {
|
13591 | mermaid.parseError = parseErrorHandler;
|
13592 | };
|
13593 | const executionQueue = [];
|
13594 | let executionQueueRunning = false;
|
13595 | const executeQueue = async () => {
|
13596 | if (executionQueueRunning) {
|
13597 | return;
|
13598 | }
|
13599 | executionQueueRunning = true;
|
13600 | while (executionQueue.length > 0) {
|
13601 | const f = executionQueue.shift();
|
13602 | if (f) {
|
13603 | try {
|
13604 | await f();
|
13605 | } catch (e) {
|
13606 | log$1.error("Error executing queue", e);
|
13607 | }
|
13608 | }
|
13609 | }
|
13610 | executionQueueRunning = false;
|
13611 | };
|
13612 | const parse = async (text2, parseOptions) => {
|
13613 | return new Promise((resolve, reject) => {
|
13614 | const performCall = () => new Promise((res, rej) => {
|
13615 | mermaidAPI.parse(text2, parseOptions).then(
|
13616 | (r) => {
|
13617 | res(r);
|
13618 | resolve(r);
|
13619 | },
|
13620 | (e) => {
|
13621 | var _a;
|
13622 | log$1.error("Error parsing", e);
|
13623 | (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e);
|
13624 | rej(e);
|
13625 | reject(e);
|
13626 | }
|
13627 | );
|
13628 | });
|
13629 | executionQueue.push(performCall);
|
13630 | executeQueue().catch(reject);
|
13631 | });
|
13632 | };
|
13633 | const render = (id2, text2, container) => {
|
13634 | return new Promise((resolve, reject) => {
|
13635 | const performCall = () => new Promise((res, rej) => {
|
13636 | mermaidAPI.render(id2, text2, container).then(
|
13637 | (r) => {
|
13638 | res(r);
|
13639 | resolve(r);
|
13640 | },
|
13641 | (e) => {
|
13642 | var _a;
|
13643 | log$1.error("Error parsing", e);
|
13644 | (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e);
|
13645 | rej(e);
|
13646 | reject(e);
|
13647 | }
|
13648 | );
|
13649 | });
|
13650 | executionQueue.push(performCall);
|
13651 | executeQueue().catch(reject);
|
13652 | });
|
13653 | };
|
13654 | const mermaid = {
|
13655 | startOnLoad: true,
|
13656 | mermaidAPI,
|
13657 | parse,
|
13658 | render,
|
13659 | init,
|
13660 | run,
|
13661 | registerExternalDiagrams,
|
13662 | initialize,
|
13663 | parseError: void 0,
|
13664 | contentLoaded,
|
13665 | setParseErrorHandler,
|
13666 | detectType
|
13667 | };
|
13668 | export {
|
13669 | color as $,
|
13670 | getDiagramTitle as A,
|
13671 | clear as B,
|
13672 | Color$1 as C,
|
13673 | curveBasis as D,
|
13674 | parseGenericTypes as E,
|
13675 | random as F,
|
13676 | getConfig as G,
|
13677 | setupGraphViewbox as H,
|
13678 | define as I,
|
13679 | extend$1 as J,
|
13680 | Color$2 as K,
|
13681 | rgbConvert as L,
|
13682 | nogamma as M,
|
13683 | hue as N,
|
13684 | D as O,
|
13685 | FORMAT_DEFAULT as P,
|
13686 | dayjs as Q,
|
13687 | Rgb as R,
|
13688 | tau as S,
|
13689 | parseFontSize as T,
|
13690 | getThemeVariables$2 as U,
|
13691 | defaultConfig$1 as V,
|
13692 | W,
|
13693 | constant as X,
|
13694 | Y,
|
13695 | interpolateNumber as Z,
|
13696 | _,
|
13697 | getAccDescription as a,
|
13698 | interpolateRgb as a0,
|
13699 | interpolateString as a1,
|
13700 | addFunction as a2,
|
13701 | Selection$1 as a3,
|
13702 | root$2 as a4,
|
13703 | array as a5,
|
13704 | generateId as a6,
|
13705 | isObjectLike as a7,
|
13706 | baseGetTag as a8,
|
13707 | Symbol$2 as a9,
|
13708 | isDark$1 as aA,
|
13709 | lighten$1 as aB,
|
13710 | darken$1 as aC,
|
13711 | halfPi as aD,
|
13712 | epsilon as aE,
|
13713 | cos as aF,
|
13714 | sin as aG,
|
13715 | sqrt as aH,
|
13716 | min as aI,
|
13717 | abs$1 as aJ,
|
13718 | pi as aK,
|
13719 | atan2 as aL,
|
13720 | asin as aM,
|
13721 | acos as aN,
|
13722 | max as aO,
|
13723 | dedent as aP,
|
13724 | mermaid as aQ,
|
13725 | isArray$1 as aa,
|
13726 | isObject as ab,
|
13727 | getNative as ac,
|
13728 | eq as ad,
|
13729 | isArrayLike as ae,
|
13730 | isArguments$1 as af,
|
13731 | isBuffer$1 as ag,
|
13732 | isTypedArray$1 as ah,
|
13733 | baseKeys as ai,
|
13734 | isPrototype as aj,
|
13735 | memoize as ak,
|
13736 | overArg as al,
|
13737 | ListCache as am,
|
13738 | Map$2 as an,
|
13739 | MapCache as ao,
|
13740 | root$1 as ap,
|
13741 | getTag$1 as aq,
|
13742 | nodeUtil$1 as ar,
|
13743 | baseUnary as as,
|
13744 | isLength as at,
|
13745 | Set$1 as au,
|
13746 | isEmpty as av,
|
13747 | defaultConfig as aw,
|
13748 | decodeEntities as ax,
|
13749 | commonDb$1 as ay,
|
13750 | parseDirective$1 as az,
|
13751 | setAccDescription as b,
|
13752 | getConfig$1 as c,
|
13753 | sanitizeText$2 as d,
|
13754 | sanitizeUrl_1 as e,
|
13755 | common$1 as f,
|
13756 | getAccTitle as g,
|
13757 | assignWithDepth$1 as h,
|
13758 | calculateTextWidth as i,
|
13759 | select as j,
|
13760 | configureSvgSize as k,
|
13761 | log$1 as l,
|
13762 | mermaidAPI as m,
|
13763 | calculateTextHeight as n,
|
13764 | curveLinear as o,
|
13765 | getStylesFromArray as p,
|
13766 | evaluate as q,
|
13767 | interpolateToCurve as r,
|
13768 | setAccTitle as s,
|
13769 | setupGraphViewbox$1 as t,
|
13770 | setConfig as u,
|
13771 | isFunction as v,
|
13772 | wrapLabel as w,
|
13773 | utils as x,
|
13774 | rgba$1 as y,
|
13775 | setDiagramTitle as z
|
13776 | };
|