@umami/shiso 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/App.js +76 -49
- package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
- package/dist/chunks/arc.js +130 -0
- package/dist/chunks/architecture-7GRP2DOG.js +4 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
- package/dist/chunks/array.js +8 -0
- package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
- package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
- package/dist/chunks/channel.js +9 -0
- package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
- package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
- package/dist/chunks/chunk-5VM5RSS4.js +21 -0
- package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
- package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
- package/dist/chunks/chunk-F27PBJKO.js +95 -0
- package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
- package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
- package/dist/chunks/chunk-GVQU2GXP.js +58 -0
- package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
- package/dist/chunks/chunk-JWPE2WC7.js +12 -0
- package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
- package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
- package/dist/chunks/chunk-P2QGCYS3.js +95 -0
- package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
- package/dist/chunks/chunk-PWAF6VOD.js +467 -0
- package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
- package/dist/chunks/chunk-SVP7TREG.js +686 -0
- package/dist/chunks/chunk-TICWLB2K.js +3800 -0
- package/dist/chunks/chunk-XXDRQBXY.js +12 -0
- package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
- package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
- package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
- package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
- package/dist/chunks/cytoscape.esm.js +28282 -0
- package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
- package/dist/chunks/dagre.js +4235 -0
- package/dist/chunks/defaultLocale.js +246 -0
- package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
- package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
- package/dist/chunks/diagram-VSXAHHWV.js +553 -0
- package/dist/chunks/diagram-VX7I27RA.js +798 -0
- package/dist/chunks/diagram-Z3DM3KII.js +186 -0
- package/dist/chunks/dist.js +92 -0
- package/dist/chunks/docs.js +987 -91
- package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
- package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
- package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
- package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
- package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
- package/dist/chunks/graphlib.js +4194 -0
- package/dist/chunks/info-A6RAGUB7.js +4 -0
- package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
- package/dist/chunks/init.js +14 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
- package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
- package/dist/chunks/katex.js +26463 -0
- package/dist/chunks/line.js +48 -0
- package/dist/chunks/linear.js +391 -0
- package/dist/chunks/mermaid-parser.core.js +754 -0
- package/dist/chunks/mermaid.core.js +4898 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
- package/dist/chunks/ordinal.js +84 -0
- package/dist/chunks/packet-AYTQ26CC.js +4 -0
- package/dist/chunks/path.js +106 -0
- package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
- package/dist/chunks/pie-WAS4IAKB.js +4 -0
- package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
- package/dist/chunks/radar-RG4KPBEZ.js +4 -0
- package/dist/chunks/railroad-74A4TZTK.js +4 -0
- package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
- package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
- package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
- package/dist/chunks/rough.esm.js +1396 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
- package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
- package/dist/chunks/src.js +2653 -0
- package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
- package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
- package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
- package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
- package/dist/chunks/treemap-WGGIJYW6.js +4 -0
- package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
- package/dist/chunks/wardley-WFR3VGLG.js +4 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
- package/dist/components.js +2 -2
- package/dist/entry-client.js +1 -1
- package/dist/entry-server.js +1 -1
- package/docs.schema.json +1 -1
- package/package.json +2 -1
- package/scripts/expand-navigation-globs.mjs +77 -8
- package/src/components/CodeBlock.tsx +36 -0
- package/src/components/Docs.tsx +44 -21
- package/src/components/OpenApiOperation.tsx +28 -20
- package/src/components/SideNav.tsx +8 -3
- package/src/components/docs/Changelog.tsx +163 -0
- package/src/components/docs/Mermaid.tsx +164 -0
- package/src/components/docs/Panel.tsx +23 -0
- package/src/components/docs/ParamField.tsx +17 -5
- package/src/components/docs/PropertiesTable.tsx +2 -2
- package/src/components/docs/ResponseField.tsx +17 -5
- package/src/components/docs/Tiles.tsx +59 -0
- package/src/components/docs/Tree.tsx +359 -0
- package/src/components/docs/Update.tsx +72 -0
- package/src/components/docs/index.ts +7 -0
- package/src/components/docs/panel-context.tsx +25 -0
- package/src/components/docs/styles.ts +49 -0
- package/src/components/icons/index.ts +4 -0
- package/src/lib/rehype-shiki.ts +18 -1
- package/types/components.d.ts +79 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { n as parse } from "./mermaid-parser.core.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY.js";
|
|
3
|
+
import { m as log } from "./src.js";
|
|
4
|
+
import { H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, b as getConfig, c as configureSvgSize, f as defaultConfig_default, v as getAccDescription, w as getDiagramTitle, y as getAccTitle } from "./chunk-DU6HZSFF.js";
|
|
5
|
+
import { i as cleanAndMerge } from "./chunk-75Z2AOVW.js";
|
|
6
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7.js";
|
|
7
|
+
import { f as selectSvgElement } from "./mermaid.core.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/diagram-Z3DM3KII.mjs
|
|
10
|
+
var DEFAULT_PACKET_CONFIG = defaultConfig_default.packet;
|
|
11
|
+
var PacketDB = class {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.packet = [];
|
|
14
|
+
this.setAccTitle = setAccTitle;
|
|
15
|
+
this.getAccTitle = getAccTitle;
|
|
16
|
+
this.setDiagramTitle = setDiagramTitle;
|
|
17
|
+
this.getDiagramTitle = getDiagramTitle;
|
|
18
|
+
this.getAccDescription = getAccDescription;
|
|
19
|
+
this.setAccDescription = setAccDescription;
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
__name(this, "PacketDB");
|
|
23
|
+
}
|
|
24
|
+
getConfig() {
|
|
25
|
+
const config = cleanAndMerge({
|
|
26
|
+
...DEFAULT_PACKET_CONFIG,
|
|
27
|
+
...getConfig().packet
|
|
28
|
+
});
|
|
29
|
+
if (config.showBits) config.paddingY += 10;
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
getPacket() {
|
|
33
|
+
return this.packet;
|
|
34
|
+
}
|
|
35
|
+
pushWord(word) {
|
|
36
|
+
if (word.length > 0) this.packet.push(word);
|
|
37
|
+
}
|
|
38
|
+
clear() {
|
|
39
|
+
clear();
|
|
40
|
+
this.packet = [];
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var maxPacketSize = 1e4;
|
|
44
|
+
var populate = /* @__PURE__ */ __name((ast, db) => {
|
|
45
|
+
populateCommonDb(ast, db);
|
|
46
|
+
let lastBit = -1;
|
|
47
|
+
let word = [];
|
|
48
|
+
let row = 1;
|
|
49
|
+
const { bitsPerRow } = db.getConfig();
|
|
50
|
+
for (let { start, end, bits, label } of ast.blocks) {
|
|
51
|
+
if (start !== void 0 && end !== void 0 && end < start) throw new Error(`Packet block ${start} - ${end} is invalid. End must be greater than start.`);
|
|
52
|
+
start ??= lastBit + 1;
|
|
53
|
+
if (start !== lastBit + 1) throw new Error(`Packet block ${start} - ${end ?? start} is not contiguous. It should start from ${lastBit + 1}.`);
|
|
54
|
+
if (bits === 0) throw new Error(`Packet block ${start} is invalid. Cannot have a zero bit field.`);
|
|
55
|
+
end ??= start + (bits ?? 1) - 1;
|
|
56
|
+
bits ??= end - start + 1;
|
|
57
|
+
lastBit = end;
|
|
58
|
+
log.debug(`Packet block ${start} - ${lastBit} with label ${label}`);
|
|
59
|
+
while (word.length <= bitsPerRow + 1 && db.getPacket().length < maxPacketSize) {
|
|
60
|
+
const [block, nextBlock] = getNextFittingBlock({
|
|
61
|
+
start,
|
|
62
|
+
end,
|
|
63
|
+
bits,
|
|
64
|
+
label
|
|
65
|
+
}, row, bitsPerRow);
|
|
66
|
+
word.push(block);
|
|
67
|
+
if (block.end + 1 === row * bitsPerRow) {
|
|
68
|
+
db.pushWord(word);
|
|
69
|
+
word = [];
|
|
70
|
+
row++;
|
|
71
|
+
}
|
|
72
|
+
if (!nextBlock) break;
|
|
73
|
+
({start, end, bits, label} = nextBlock);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
db.pushWord(word);
|
|
77
|
+
}, "populate");
|
|
78
|
+
var getNextFittingBlock = /* @__PURE__ */ __name((block, row, bitsPerRow) => {
|
|
79
|
+
if (block.start === void 0) throw new Error("start should have been set during first phase");
|
|
80
|
+
if (block.end === void 0) throw new Error("end should have been set during first phase");
|
|
81
|
+
if (block.start > block.end) throw new Error(`Block start ${block.start} is greater than block end ${block.end}.`);
|
|
82
|
+
if (block.end + 1 <= row * bitsPerRow) return [block, void 0];
|
|
83
|
+
const rowEnd = row * bitsPerRow - 1;
|
|
84
|
+
const rowStart = row * bitsPerRow;
|
|
85
|
+
return [{
|
|
86
|
+
start: block.start,
|
|
87
|
+
end: rowEnd,
|
|
88
|
+
label: block.label,
|
|
89
|
+
bits: rowEnd - block.start
|
|
90
|
+
}, {
|
|
91
|
+
start: rowStart,
|
|
92
|
+
end: block.end,
|
|
93
|
+
label: block.label,
|
|
94
|
+
bits: block.end - rowStart
|
|
95
|
+
}];
|
|
96
|
+
}, "getNextFittingBlock");
|
|
97
|
+
var parser = {
|
|
98
|
+
parser: { yy: void 0 },
|
|
99
|
+
parse: /* @__PURE__ */ __name(async (input) => {
|
|
100
|
+
const ast = await parse("packet", input);
|
|
101
|
+
const db = parser.parser?.yy;
|
|
102
|
+
if (!(db instanceof PacketDB)) throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");
|
|
103
|
+
log.debug(ast);
|
|
104
|
+
populate(ast, db);
|
|
105
|
+
}, "parse")
|
|
106
|
+
};
|
|
107
|
+
var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
|
|
108
|
+
const db = diagram2.db;
|
|
109
|
+
const config = db.getConfig();
|
|
110
|
+
const { rowHeight, paddingY, bitWidth, bitsPerRow } = config;
|
|
111
|
+
const words = db.getPacket();
|
|
112
|
+
const title = db.getDiagramTitle();
|
|
113
|
+
const totalRowHeight = rowHeight + paddingY;
|
|
114
|
+
const svgHeight = totalRowHeight * (words.length + 1) - (title ? 0 : rowHeight);
|
|
115
|
+
const svgWidth = bitWidth * bitsPerRow + 2;
|
|
116
|
+
const svg = selectSvgElement(id);
|
|
117
|
+
svg.attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`);
|
|
118
|
+
configureSvgSize(svg, svgHeight, svgWidth, config.useMaxWidth);
|
|
119
|
+
for (const [word, packet] of words.entries()) drawWord(svg, packet, word, config);
|
|
120
|
+
svg.append("text").text(title).attr("x", svgWidth / 2).attr("y", svgHeight - totalRowHeight / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
121
|
+
}, "draw");
|
|
122
|
+
var drawWord = /* @__PURE__ */ __name((svg, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => {
|
|
123
|
+
const group = svg.append("g");
|
|
124
|
+
const wordY = rowNumber * (rowHeight + paddingY) + paddingY;
|
|
125
|
+
for (const block of word) {
|
|
126
|
+
const blockX = block.start % bitsPerRow * bitWidth + 1;
|
|
127
|
+
const width = (block.end - block.start + 1) * bitWidth - paddingX;
|
|
128
|
+
group.append("rect").attr("x", blockX).attr("y", wordY).attr("width", width).attr("height", rowHeight).attr("class", "packetBlock");
|
|
129
|
+
group.append("text").attr("x", blockX + width / 2).attr("y", wordY + rowHeight / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(block.label);
|
|
130
|
+
if (!showBits) continue;
|
|
131
|
+
const isSingleBlock = block.end === block.start;
|
|
132
|
+
const bitNumberY = wordY - 2;
|
|
133
|
+
group.append("text").attr("x", blockX + (isSingleBlock ? width / 2 : 0)).attr("y", bitNumberY).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", isSingleBlock ? "middle" : "start").text(block.start);
|
|
134
|
+
if (!isSingleBlock) group.append("text").attr("x", blockX + width).attr("y", bitNumberY).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(block.end);
|
|
135
|
+
}
|
|
136
|
+
}, "drawWord");
|
|
137
|
+
var renderer = { draw };
|
|
138
|
+
var defaultPacketStyleOptions = {
|
|
139
|
+
byteFontSize: "10px",
|
|
140
|
+
startByteColor: "black",
|
|
141
|
+
endByteColor: "black",
|
|
142
|
+
labelColor: "black",
|
|
143
|
+
labelFontSize: "12px",
|
|
144
|
+
titleColor: "black",
|
|
145
|
+
titleFontSize: "14px",
|
|
146
|
+
blockStrokeColor: "black",
|
|
147
|
+
blockStrokeWidth: "1",
|
|
148
|
+
blockFillColor: "#efefef"
|
|
149
|
+
};
|
|
150
|
+
var diagram = {
|
|
151
|
+
parser,
|
|
152
|
+
get db() {
|
|
153
|
+
return new PacketDB();
|
|
154
|
+
},
|
|
155
|
+
renderer,
|
|
156
|
+
styles: /* @__PURE__ */ __name(({ packet } = {}) => {
|
|
157
|
+
const options = cleanAndMerge(defaultPacketStyleOptions, packet);
|
|
158
|
+
return `
|
|
159
|
+
.packetByte {
|
|
160
|
+
font-size: ${options.byteFontSize};
|
|
161
|
+
}
|
|
162
|
+
.packetByte.start {
|
|
163
|
+
fill: ${options.startByteColor};
|
|
164
|
+
}
|
|
165
|
+
.packetByte.end {
|
|
166
|
+
fill: ${options.endByteColor};
|
|
167
|
+
}
|
|
168
|
+
.packetLabel {
|
|
169
|
+
fill: ${options.labelColor};
|
|
170
|
+
font-size: ${options.labelFontSize};
|
|
171
|
+
}
|
|
172
|
+
.packetTitle {
|
|
173
|
+
fill: ${options.titleColor};
|
|
174
|
+
font-size: ${options.titleFontSize};
|
|
175
|
+
}
|
|
176
|
+
.packetBlock {
|
|
177
|
+
stroke: ${options.blockStrokeColor};
|
|
178
|
+
stroke-width: ${options.blockStrokeWidth};
|
|
179
|
+
fill: ${options.blockFillColor};
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
}, "styles")
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
export { diagram };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Nr as __commonJSMin } from "./docs.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js
|
|
4
|
+
const abs = Math.abs;
|
|
5
|
+
const atan2 = Math.atan2;
|
|
6
|
+
const cos = Math.cos;
|
|
7
|
+
const max = Math.max;
|
|
8
|
+
const min = Math.min;
|
|
9
|
+
const sin = Math.sin;
|
|
10
|
+
const sqrt = Math.sqrt;
|
|
11
|
+
const epsilon = 1e-12;
|
|
12
|
+
const pi = Math.PI;
|
|
13
|
+
const halfPi = pi / 2;
|
|
14
|
+
const tau = 2 * pi;
|
|
15
|
+
function acos(x) {
|
|
16
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
17
|
+
}
|
|
18
|
+
function asin(x) {
|
|
19
|
+
return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.2/node_modules/@braintree/sanitize-url/dist/constants.js
|
|
24
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.BLANK_URL = exports.relativeFirstCharacters = exports.whitespaceEscapeCharsRegex = exports.urlSchemeRegex = exports.ctrlCharactersRegex = exports.htmlCtrlEntityRegex = exports.htmlEntitiesRegex = exports.invalidProtocolRegex = void 0;
|
|
27
|
+
exports.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
|
|
28
|
+
exports.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g;
|
|
29
|
+
exports.htmlCtrlEntityRegex = /&(newline|tab);/gi;
|
|
30
|
+
exports.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
|
|
31
|
+
exports.urlSchemeRegex = /^.+(:|:)/gim;
|
|
32
|
+
exports.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;
|
|
33
|
+
exports.relativeFirstCharacters = [".", "/"];
|
|
34
|
+
exports.BLANK_URL = "about:blank";
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.2/node_modules/@braintree/sanitize-url/dist/index.js
|
|
39
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.sanitizeUrl = sanitizeUrl;
|
|
42
|
+
var constants_1 = require_constants();
|
|
43
|
+
function isRelativeUrlWithoutProtocol(url) {
|
|
44
|
+
return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;
|
|
45
|
+
}
|
|
46
|
+
function decodeHtmlCharacters(str) {
|
|
47
|
+
return str.replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.htmlEntitiesRegex, function(match, dec) {
|
|
48
|
+
return String.fromCharCode(dec);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function isValidUrl(url) {
|
|
52
|
+
return URL.canParse(url);
|
|
53
|
+
}
|
|
54
|
+
function decodeURI(uri) {
|
|
55
|
+
try {
|
|
56
|
+
return decodeURIComponent(uri);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
return uri;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function sanitizeUrl(url) {
|
|
62
|
+
if (!url) return constants_1.BLANK_URL;
|
|
63
|
+
var charsToDecode;
|
|
64
|
+
var decodedUrl = decodeURI(url.trim());
|
|
65
|
+
do {
|
|
66
|
+
decodedUrl = decodeHtmlCharacters(decodedUrl).replace(constants_1.htmlCtrlEntityRegex, "").replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.whitespaceEscapeCharsRegex, "").trim();
|
|
67
|
+
decodedUrl = decodeURI(decodedUrl);
|
|
68
|
+
charsToDecode = decodedUrl.match(constants_1.ctrlCharactersRegex) || decodedUrl.match(constants_1.htmlEntitiesRegex) || decodedUrl.match(constants_1.htmlCtrlEntityRegex) || decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);
|
|
69
|
+
} while (charsToDecode && charsToDecode.length > 0);
|
|
70
|
+
var sanitizedUrl = decodedUrl;
|
|
71
|
+
if (!sanitizedUrl) return constants_1.BLANK_URL;
|
|
72
|
+
if (isRelativeUrlWithoutProtocol(sanitizedUrl)) return sanitizedUrl;
|
|
73
|
+
var trimmedUrl = sanitizedUrl.trimStart();
|
|
74
|
+
var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);
|
|
75
|
+
if (!urlSchemeParseResults) return sanitizedUrl;
|
|
76
|
+
var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();
|
|
77
|
+
if (constants_1.invalidProtocolRegex.test(urlScheme)) return constants_1.BLANK_URL;
|
|
78
|
+
var backSanitized = trimmedUrl.replace(/\\/g, "/");
|
|
79
|
+
if (urlScheme === "mailto:" || urlScheme.includes("://")) return backSanitized;
|
|
80
|
+
if (urlScheme === "http:" || urlScheme === "https:") {
|
|
81
|
+
if (!isValidUrl(backSanitized)) return constants_1.BLANK_URL;
|
|
82
|
+
var url_1 = new URL(backSanitized);
|
|
83
|
+
url_1.protocol = url_1.protocol.toLowerCase();
|
|
84
|
+
url_1.hostname = url_1.hostname.toLowerCase();
|
|
85
|
+
return url_1.toString();
|
|
86
|
+
}
|
|
87
|
+
return backSanitized;
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
export { atan2 as a, halfPi as c, pi as d, sin as f, asin as i, max as l, tau as m, abs as n, cos as o, sqrt as p, acos as r, epsilon as s, require_dist as t, min as u };
|