genesys-react-components 0.3.0 → 0.3.1-devengage-1574-implementing-code-fences.220

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.
@@ -0,0 +1,2232 @@
1
+ import { GenesysDevIcon, GenesysDevIcons } from 'genesys-dev-icons';
2
+ import React, { useState, useEffect, useRef } from 'react';
3
+ import { v4 } from 'uuid';
4
+
5
+ function styleInject(css, ref) {
6
+ if ( ref === void 0 ) ref = {};
7
+ var insertAt = ref.insertAt;
8
+
9
+ if (!css || typeof document === 'undefined') { return; }
10
+
11
+ var head = document.head || document.getElementsByTagName('head')[0];
12
+ var style = document.createElement('style');
13
+ style.type = 'text/css';
14
+
15
+ if (insertAt === 'top') {
16
+ if (head.firstChild) {
17
+ head.insertBefore(style, head.firstChild);
18
+ } else {
19
+ head.appendChild(style);
20
+ }
21
+ } else {
22
+ head.appendChild(style);
23
+ }
24
+
25
+ if (style.styleSheet) {
26
+ style.styleSheet.cssText = css;
27
+ } else {
28
+ style.appendChild(document.createTextNode(css));
29
+ }
30
+ }
31
+
32
+ var css_248z$h = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-accordion {\n margin: 0;\n}\n.dx-accordion .accordion-heading {\n border-width: 0 0 1px 0;\n border-style: solid;\n border-color: var(--theme-core-layout-border-color);\n font-style: normal;\n font-weight: bold;\n font-size: 14px;\n line-height: 14px;\n color: var(--theme-core-text-color);\n padding: 13px 20px;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n.dx-accordion .accordion-heading .icon {\n line-height: 0;\n}\n.dx-accordion .accordion-heading__left {\n align-self: left;\n}\n.dx-accordion .accordion-content {\n color: var(--theme-core-text-color);\n padding: 13px 20px 20px 20px;\n border-bottom: 1px solid var(--theme-core-layout-border-color);\n}\n.dx-accordion .accordion-content > *:first-child {\n margin-top: 0;\n}\n.dx-accordion .accordion-content > *:last-child {\n margin-bottom: 0;\n}";
33
+ styleInject(css_248z$h);
34
+
35
+ function DxAccordion(props) {
36
+ const [isOpen, setIsOpen] = useState(props.showOpen || false);
37
+ const [expandTrigger, setExpandTrigger] = useState(props.expandTrigger);
38
+ const [showOpenTrigger, setShowOpenTrigger] = useState(props.showOpenTrigger);
39
+ // This one forcibly opens the component
40
+ React.useEffect(() => {
41
+ if (props.expandTrigger !== expandTrigger) {
42
+ setIsOpen(true);
43
+ setExpandTrigger(props.expandTrigger);
44
+ }
45
+ }, [props.expandTrigger, expandTrigger]);
46
+ // This one forcibly recalculates the state based on the value for props.showOpen
47
+ React.useEffect(() => {
48
+ if (props.showOpenTrigger !== showOpenTrigger) {
49
+ setIsOpen(props.showOpen);
50
+ setShowOpenTrigger(props.showOpenTrigger);
51
+ }
52
+ }, [props.showOpenTrigger, showOpenTrigger, props.showOpen]);
53
+ React.useEffect(() => {
54
+ if (props.showOpen === true || props.showOpen === false)
55
+ setIsOpen(props.showOpen);
56
+ }, [props.showOpen]);
57
+ let style = {};
58
+ if (props.headingColor)
59
+ style.color = props.headingColor;
60
+ let icon;
61
+ if (props.headingIcon)
62
+ icon = React.createElement(GenesysDevIcon, { icon: props.headingIcon, className: "heading-icon" });
63
+ return (React.createElement("div", { id: props.containerId || undefined, className: `dx-accordion${props.className ? ' ' + props.className : ''}` },
64
+ React.createElement("div", { className: "accordion-heading", style: style, onClick: () => setIsOpen(!isOpen) },
65
+ React.createElement("span", { className: "accordion-heading__left" },
66
+ icon,
67
+ " ",
68
+ props.title),
69
+ ' ',
70
+ React.createElement(GenesysDevIcon, { icon: isOpen ? GenesysDevIcons.AppChevronUp : GenesysDevIcons.AppChevronDown })),
71
+ isOpen ? React.createElement("div", { className: "accordion-content" }, props.children) : undefined));
72
+ }
73
+
74
+ var css_248z$g = ".dx-accordion-group {\n margin: 40px 0;\n}";
75
+ styleInject(css_248z$g);
76
+
77
+ function DxAccordionGroup(props) {
78
+ return React.createElement("div", { className: `dx-accordion-group${props.className ? ' ' + props.className : ''}` }, props.children);
79
+ }
80
+
81
+ var css_248z$f = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-button {\n margin: 15px 10px;\n border-radius: 2px;\n padding: 8px 15px;\n cursor: pointer;\n font-weight: 500;\n}\n.dx-button-primary {\n color: var(--theme-dxbutton-primary-text-color);\n border: 1px solid var(--theme-dxbutton-primary-background-color);\n background-color: var(--theme-dxbutton-primary-background-color);\n}\n.dx-button-primary:hover {\n background-color: var(--theme-dxbutton-primary-hover-background-color);\n border-color: var(--theme-dxbutton-primary-hover-background-color);\n transition: 0.1s;\n}\n.dx-button-primary:focus {\n background-color: var(--theme-dxbutton-primary-background-color);\n border-color: var(--theme-dxbutton-primary-background-color);\n box-shadow: 0 0 0 2px var(--theme-dxbutton-primary-shadow-color);\n transition: 0.1s;\n}\n.dx-button-primary:disabled {\n background-color: var(--theme-dxbutton-primary-disabled-background-color);\n border-color: var(--theme-dxbutton-primary-disabled-background-color);\n transition: 0.1s;\n cursor: not-allowed;\n}\n.dx-button-secondary {\n background-color: var(--theme-dxbutton-secondary-background-color);\n border: 1px solid var(--theme-dxbutton-secondary-border-color);\n color: var(--theme-dxbutton-secondary-border-color);\n}\n.dx-button-secondary:hover {\n color: var(--theme-dxbutton-secondary-hover-border-color);\n border-color: var(--theme-dxbutton-secondary-border-color);\n transition: 0.1s;\n}\n.dx-button-secondary:focus {\n color: var(--theme-dxbutton-secondary-border-color);\n border-color: var(--theme-dxbutton-secondary-border-color);\n box-shadow: 0 0 0 2px var(--theme-dxbutton-secondary-shadow-color);\n transition: 0.1s;\n}\n.dx-button-secondary:disabled {\n color: var(--theme-dxbutton-secondary-disabled-text-color);\n background-color: var(--theme-dxbutton-secondary-disabled-background-color);\n border-color: var(--theme-dxbutton-secondary-disabled-background-color);\n transition: 0.1s;\n cursor: not-allowed;\n}\n.dx-button-link {\n color: var(--theme-core-link-color);\n background: transparent;\n margin: 0;\n padding: 0 2px;\n border: 0;\n}\n.dx-button-link:hover {\n color: var(--theme-core-link-hover-color);\n border-color: var(--theme-dxbutton-secondary-border-color);\n}\n.dx-button-link:disabled {\n color: #8a9a9e;\n transition: 0.1s;\n cursor: not-allowed;\n text-decoration: line-through;\n}";
82
+ styleInject(css_248z$f);
83
+
84
+ function DxButton(props) {
85
+ let classNames = ['dx-button'];
86
+ classNames.push(`dx-button-${props.type || 'primary'}`);
87
+ if (props.className)
88
+ classNames.push(props.className);
89
+ const handleClick = (e) => {
90
+ if (!props.onClick)
91
+ return;
92
+ e.preventDefault();
93
+ e.stopPropagation();
94
+ props.onClick();
95
+ };
96
+ return (React.createElement("button", { className: classNames.join(' '), type: "button", onClick: handleClick, disabled: props.disabled === true }, props.children));
97
+ }
98
+
99
+ var css_248z$e = ".dx-item-group {\n display: block;\n border: 0;\n margin: 0;\n padding: 0;\n}";
100
+ styleInject(css_248z$e);
101
+
102
+ var css_248z$d = "";
103
+ styleInject(css_248z$d);
104
+
105
+ var css_248z$c = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-select-group {\n appearance: none;\n position: relative;\n}\n.dx-select-group select {\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 2px;\n background-color: var(--theme-core-control-alt-background-color);\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 14px;\n color: var(--theme-core-control-textbox-text-color);\n padding: 8px 32px 8px 12px;\n width: 100%;\n appearance: none;\n}\n.dx-select-group select:focus-visible {\n outline: 2px solid var(--theme-core-control-focus-color);\n}\n.dx-select-group::after {\n position: absolute;\n bottom: 12px;\n right: 12px;\n content: \"\\f105\";\n font-size: 8px;\n font-family: genesys-dev-icons !important;\n font-style: normal;\n font-weight: normal !important;\n font-feature-settings: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n pointer-events: none;\n}\n.dx-select-group.disabled::after {\n color: var(--theme-core-control-disabled-text-color);\n}\n.dx-select-group.disabled select:disabled {\n background-color: var(--theme-core-control-disabled-background-color);\n border-color: var(--theme-core-control-disabled-border-color);\n color: var(--theme-core-control-disabled-text-color);\n cursor: not-allowed;\n}";
106
+ styleInject(css_248z$c);
107
+
108
+ var css_248z$b = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-multiselect-group {\n appearance: none;\n position: relative;\n}\n.dx-multiselect-group select {\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 2px;\n background-color: var(--theme-core-control-alt-background-color);\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 14px;\n color: var(--theme-core-control-textbox-text-color);\n width: 100%;\n appearance: none;\n scrollbar-color: #b0b2b5 transparent;\n}\n.dx-multiselect-group select:focus-visible {\n outline: 2px solid var(--theme-core-control-focus-color);\n}\n.dx-multiselect-group select option {\n overflow: hidden;\n white-space: pre;\n text-overflow: ellipsis;\n -webkit-appearance: none;\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 31px;\n padding: 8px 12px;\n color: var(--theme-core-control-textbox-text-color);\n}\n.dx-multiselect-group select option:checked {\n color: var(--theme-core-tag-text-color);\n background-color: var(--theme-core-tag-background-color);\n}\n.dx-multiselect-group select option:disabled {\n color: #8a9a9e;\n cursor: not-allowed;\n}\n.dx-multiselect-group select::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 7px;\n height: 7px;\n}\n.dx-multiselect-group select::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: #b0b2b5;\n}\n.dx-multiselect-group select::-webkit-scrollbar-corner {\n background: transparent;\n}\n.dx-multiselect-group.disabled select:disabled {\n background-color: var(--theme-core-control-disabled-background-color);\n border-color: var(--theme-core-control-disabled-border-color);\n cursor: not-allowed;\n}\n.dx-multiselect-group.disabled select:disabled option {\n color: var(--theme-core-control-disabled-text-color);\n}";
109
+ styleInject(css_248z$b);
110
+
111
+ var css_248z$a = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-label {\n margin: 20px 0;\n display: block;\n}\n.dx-label .label-text,\n.dx-label .input-description {\n display: block;\n font-family: Roboto;\n font-style: normal;\n font-weight: 400;\n font-size: 12px;\n line-height: 14px;\n color: var(--theme-core-control-label-color);\n}\n.dx-label .label-text {\n margin: 0 0 4px 0;\n}\n.dx-label .input-description {\n padding: 6px 20px;\n display: flex;\n flex-flow: row nowrap;\n gap: 8px;\n}\n.dx-label .input-description .icon {\n color: var(--theme-alertblock-info-icon-color);\n line-height: 0;\n}";
112
+ styleInject(css_248z$a);
113
+
114
+ function DxLabel(props) {
115
+ const hasLabel = props.label && props.label !== '';
116
+ const description = props.description ? (React.createElement("div", { className: 'input-description' },
117
+ React.createElement(GenesysDevIcon, { icon: GenesysDevIcons.AppInfoSolid }),
118
+ React.createElement("span", null, props.description))) : undefined;
119
+ const contents = (React.createElement(React.Fragment, null,
120
+ ' ',
121
+ hasLabel ? React.createElement("span", { className: 'label-text' }, props.label) : undefined,
122
+ props.children,
123
+ description));
124
+ const className = `dx-label${props.className ? ' ' + props.className : ''}`;
125
+ if (props.useFieldset) {
126
+ return React.createElement("fieldset", { className: className }, contents);
127
+ }
128
+ return React.createElement("label", { className: className }, contents);
129
+ }
130
+
131
+ var css_248z$9 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-checkbox {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n margin: 15px 0;\n}\n.dx-checkbox:first-of-type {\n margin-top: 0;\n}\n.dx-checkbox .label-text {\n font-family: Roboto;\n font-style: normal;\n font-weight: normal;\n font-size: 12px;\n line-height: 18px;\n color: var(--theme-core-text-color);\n}\n.dx-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n margin: 0 8px 0 0;\n width: 16px;\n height: 16px;\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 2px;\n background-color: var(--theme-core-control-background-color);\n flex-shrink: 0;\n}\n.dx-checkbox input[type=checkbox]::before {\n display: none;\n}\n.dx-checkbox input[type=checkbox]:checked {\n background-color: var(--theme-core-control-background-color);\n}\n.dx-checkbox input[type=checkbox]:checked::before {\n display: block;\n position: relative;\n top: 7px;\n left: 3px;\n font-size: 9px;\n line-height: 0;\n color: var(--theme-core-control-punch-color);\n content: \"\\f104\";\n font-family: genesys-dev-icons !important;\n font-style: normal;\n font-weight: normal !important;\n font-feature-settings: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.dx-checkbox input[type=checkbox]:not(:disabled):hover {\n border-color: var(--theme-core-control-punch-color);\n}\n.dx-checkbox input[type=checkbox]:not(:disabled):focus {\n outline: var(--theme-core-control-focus-color) solid 2px;\n}\n.dx-checkbox input[type=checkbox]:not(:disabled):focus-visible {\n outline: 0;\n}\n.dx-checkbox input[type=radio] {\n -webkit-appearance: none;\n appearance: none;\n margin: 0 8px 0 0;\n width: 16px;\n height: 16px;\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 8px;\n background-color: var(--theme-core-control-background-color);\n flex-shrink: 0;\n}\n.dx-checkbox input[type=radio]::before {\n display: none;\n}\n.dx-checkbox input[type=radio]:checked::before {\n content: \"\";\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 8px;\n position: relative;\n top: 2px;\n left: 2px;\n background-color: var(--theme-core-control-punch-color);\n}\n.dx-checkbox input[type=radio]:not(:disabled):hover {\n border-color: var(--theme-core-control-punch-color);\n}\n.dx-checkbox input[type=radio]:not(:disabled):focus {\n outline: var(--theme-core-control-focus-color) solid 2px;\n}\n.dx-checkbox input[type=radio]:not(:disabled):focus-visible {\n outline: 0;\n}\n.dx-checkbox.disabled {\n cursor: not-allowed;\n}\n.dx-checkbox.disabled input {\n border-color: var(--theme-core-control-disabled-border-color);\n cursor: not-allowed;\n}\n.dx-checkbox.disabled input:checked {\n background-color: var(--theme-core-control-disabled-background-color);\n cursor: not-allowed;\n}\n\n.dx-label .dx-checkbox .label-text {\n margin: 0;\n}";
132
+ styleInject(css_248z$9);
133
+
134
+ function DxCheckbox(props) {
135
+ let initialValue = props.checked !== undefined ? props.checked : props.initiallyChecked || false;
136
+ const [checked, setChecked] = useState(initialValue);
137
+ useEffect(() => {
138
+ if (props.checked === undefined || props.checked === checked)
139
+ return;
140
+ setChecked(props.checked);
141
+ }, [props.checked]);
142
+ useEffect(() => {
143
+ if (props.onCheckChanged)
144
+ props.onCheckChanged(checked);
145
+ }, [checked]);
146
+ return (React.createElement("label", { className: `dx-checkbox${props.className ? ' ' + props.className : ''}${props.disabled ? ' disabled' : ''}` },
147
+ React.createElement("input", { type: props.useRadioType ? 'radio' : 'checkbox', name: props.name, value: props.itemValue, checked: checked, onChange: (e) => setChecked(e.target.checked), disabled: props.disabled === true }),
148
+ React.createElement("span", { className: 'label-text' }, props.label)));
149
+ }
150
+
151
+ function DxItemGroup(props) {
152
+ var _a, _b;
153
+ const [data, setData] = useState(props.items.map((item) => {
154
+ return { item, isSelected: item.isSelected !== undefined ? item.isSelected : false };
155
+ }));
156
+ const [id] = useState(v4());
157
+ const [title, setTitle] = useState(props.title);
158
+ const [description, setDescription] = useState(props.description);
159
+ const [format, setFormat] = useState(props.format);
160
+ const [disabled, setDisabled] = useState(props.disabled);
161
+ const [className, setClassName] = useState(props.className);
162
+ // data changed
163
+ useEffect(() => {
164
+ if (props.onItemsChanged)
165
+ props.onItemsChanged(data);
166
+ // eslint-disable-next-line react-hooks/exhaustive-deps
167
+ }, [data]);
168
+ // Recalculate on props changed
169
+ useEffect(() => {
170
+ setTitle(props.title);
171
+ setDescription(props.description);
172
+ setFormat(props.format);
173
+ setDisabled(props.disabled);
174
+ setClassName(props.className);
175
+ }, [props.title, props.description, props.format, props.items, props.disabled, props.className]);
176
+ useEffect(() => {
177
+ setData(props.items.map((item) => {
178
+ return { item, isSelected: item.isSelected !== undefined ? item.isSelected : false };
179
+ }));
180
+ }, [props.items]);
181
+ // Handle individual item changed
182
+ const itemChanged = (idx, item, checked) => {
183
+ if (props.onItemChanged)
184
+ props.onItemChanged(item, checked);
185
+ let newData = [...data];
186
+ // Unselect everything if it's radio buttons
187
+ if (format === 'radio')
188
+ newData.forEach((value) => (value.isSelected = false));
189
+ // Set the selected state of the new item
190
+ newData[idx].isSelected = checked;
191
+ setData(newData);
192
+ };
193
+ const selectChanged = (e) => {
194
+ const options = e.target.options;
195
+ let newData = [...data];
196
+ // Assign selected value for each item in the list
197
+ for (let i = 0; i < options.length; i++) {
198
+ const thisItem = newData.find((value) => value.item.value === options[i].value);
199
+ thisItem.isSelected = options[i].selected;
200
+ }
201
+ // Update entire data list
202
+ setData(newData);
203
+ // Trigger individual update
204
+ const changedItemIdx = newData.findIndex((value) => value.item.value === e.target.value);
205
+ if (changedItemIdx >= 0)
206
+ itemChanged(changedItemIdx, newData[changedItemIdx].item, newData[changedItemIdx].isSelected);
207
+ };
208
+ switch (format) {
209
+ case 'multiselect':
210
+ case 'dropdown': {
211
+ const isMulti = format === 'multiselect';
212
+ return (React.createElement(DxLabel, { label: title, description: description, className: className },
213
+ React.createElement("div", { className: `dx-item-group${isMulti ? ' dx-multiselect-group' : ' dx-select-group'}${disabled ? ' disabled' : ''}` },
214
+ React.createElement("select", { multiple: isMulti, disabled: disabled === true, onChange: (e) => selectChanged(e), value: isMulti
215
+ ? (_a = data.filter((item) => item.isSelected)) === null || _a === void 0 ? void 0 : _a.map((item) => item.item.value)
216
+ : (_b = data.find((item) => item.isSelected)) === null || _b === void 0 ? void 0 : _b.item.value }, data.map((d, i) => (React.createElement("option", { key: i, value: d.item.value, disabled: d.item.disabled }, d.item.label)))))));
217
+ }
218
+ case 'checkbox':
219
+ case 'radio':
220
+ default: {
221
+ return (React.createElement(DxLabel, { label: title, description: description, className: `dx-item-group${disabled ? ' disabled' : ''}${className ? ' ' + className : ''}`, useFieldset: true },
222
+ React.createElement("div", { onChange: (e) => {
223
+ var _a;
224
+ const i = data.findIndex((d) => { var _a; return d.item.value === ((_a = e.target) === null || _a === void 0 ? void 0 : _a.value); });
225
+ if (i < 0)
226
+ return;
227
+ itemChanged(i, data[i].item, (_a = e.target) === null || _a === void 0 ? void 0 : _a.checked);
228
+ } }, data.map((d, i) => (React.createElement(DxCheckbox, { key: d.item.value, name: format === 'checkbox' ? `${id}-${d.item.value}` : id, label: d.item.label, itemValue: d.item.value, checked: d.isSelected, useRadioType: format === 'radio', disabled: disabled || d.item.disabled }))))));
229
+ }
230
+ }
231
+ }
232
+
233
+ var css_248z$8 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-tabbed-content {\n margin: 40px 0;\n}\n.dx-tabbed-content .tab-titles {\n border-bottom: 1px solid var(--theme-core-layout-border-color);\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n}\n.dx-tabbed-content .tab-titles .tab-title {\n display: inline-block;\n padding: 5px 20px;\n border-bottom: 1px solid transparent;\n cursor: pointer;\n}\n.dx-tabbed-content .tab-titles .tab-title:hover {\n border-color: var(--theme-core-control-punch-color);\n}\n.dx-tabbed-content .tab-titles .tab-title.active {\n border-bottom-color: var(--theme-core-control-punch-color);\n font-weight: bold;\n}\n.dx-tabbed-content .tab-titles .tab-title p {\n margin: 0;\n display: inline;\n}\n.dx-tabbed-content .tab-content {\n padding: 13px 20px 20px 20px;\n border-bottom: 1px solid var(--theme-core-layout-border-color);\n}\n.dx-tabbed-content .tab-content > *:first-child {\n margin-top: 0;\n}\n.dx-tabbed-content .tab-content > *:last-child {\n margin-bottom: 0;\n}";
234
+ styleInject(css_248z$8);
235
+
236
+ function DxTabbedContent(props) {
237
+ const [activeTab, setActiveTab] = useState(props.initialTabId || 0);
238
+ const [titles] = useState(
239
+ // Scrape titles from child elements
240
+ React.Children.toArray(props.children).map((child) => {
241
+ if (!child || !child.props || !child.props.title)
242
+ return 'Unknown title';
243
+ return child.props.title;
244
+ }));
245
+ return (React.createElement("div", { className: `dx-tabbed-content${props.className ? ' ' + props.className : ''}` },
246
+ React.createElement("div", { className: 'tab-titles' }, titles.map((title, i) => (React.createElement("span", { key: i, className: `tab-title${i === activeTab ? ' active' : ''}`, onClick: () => setActiveTab(i) }, title)))),
247
+ React.createElement("div", { className: 'tab-content' }, React.Children.toArray(props.children)[activeTab])));
248
+ }
249
+
250
+ var css_248z$7 = "";
251
+ styleInject(css_248z$7);
252
+
253
+ function DxTabPanel(props) {
254
+ return React.createElement("div", { className: `dx-tab-panel${props.className ? ' ' + props.className : ''}` }, props.children);
255
+ }
256
+
257
+ var css_248z$6 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-textbox {\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n gap: 10px;\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 2px;\n margin: 0;\n padding: 0 10px;\n height: 32px;\n background-color: var(--theme-core-control-alt-background-color);\n}\n.dx-textbox.with-label {\n margin-top: 0;\n}\n.dx-textbox:focus-within {\n outline: #aac9ff solid 2px;\n}\n.dx-textbox .icon {\n display: block;\n flex: none;\n color: var(--theme-core-control-textbox-text-color);\n}\n.dx-textbox .icon.input-icon {\n font-size: 14px;\n line-height: 0;\n}\n.dx-textbox .icon.clear-icon {\n font-size: 11px;\n line-height: 0;\n cursor: pointer;\n padding: 4px;\n margin-right: -4px;\n}\n.dx-textbox .dx-input {\n flex-grow: 1;\n border: 0;\n background: transparent;\n box-sizing: border-box;\n height: 32px;\n width: 100%;\n padding: 0;\n margin: 0;\n font-family: Roboto;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n line-height: 16px;\n color: var(--theme-core-control-textbox-text-color);\n}\n.dx-textbox .dx-input:focus-visible {\n outline: 0;\n}\n.dx-textbox .dx-input::placeholder {\n font-style: normal;\n font-weight: 300;\n font-size: 14px;\n line-height: 16px;\n color: var(--theme-core-control-textbox-placeholder-text-color);\n}\n.dx-textbox.disabled {\n background-color: var(--theme-dxbutton-secondary-disabled-background-color);\n cursor: not-allowed;\n}\n.dx-textbox.disabled input {\n cursor: not-allowed;\n color: var(--theme-dxbutton-secondary-disabled-text-color);\n}\n.dx-textbox.disabled .icon,\n.dx-textbox.disabled input::placeholder {\n color: var(--theme-dxbutton-secondary-disabled-text-color);\n}\n\n.dx-textarea {\n padding: 10px;\n border: 1px solid var(--theme-core-control-border-color);\n border-radius: 2px;\n width: 100%;\n font-family: \"Roboto\", sans-serif;\n box-sizing: border-box;\n background-color: var(--theme-core-control-alt-background-color);\n color: var(--theme-core-control-textbox-text-color);\n}\n.dx-textarea:focus-within {\n outline: var(--theme-core-control-focus-color) solid 2px;\n}\n.dx-textarea::placeholder {\n font-family: \"Roboto\", sans-serif;\n font-style: normal;\n font-weight: 300;\n font-size: 14px;\n line-height: 16px;\n color: var(--theme-core-control-textbox-placeholder-text-color);\n}";
258
+ styleInject(css_248z$6);
259
+
260
+ function DxTextbox(props) {
261
+ const [debounceMs, setDebounceMs] = useState(props.changeDebounceMs || 300);
262
+ const [value, setValue] = useState(props.initialValue || props.value || '');
263
+ const [isFocused, setIsFocused] = useState(false);
264
+ const [escapePressed, setEscapePressed] = useState(Date.now());
265
+ const [step, setStep] = useState(undefined);
266
+ let [timer, setTimer] = useState(undefined);
267
+ // Constructor
268
+ useEffect(() => {
269
+ // Register global key bindings
270
+ document.addEventListener('keydown', globalKeyBindings, false);
271
+ return () => {
272
+ document.removeEventListener('keydown', globalKeyBindings, false);
273
+ };
274
+ }, []);
275
+ // Value prop updated
276
+ useEffect(() => {
277
+ // Ignore value changed if initial value was set; they're mutually exclusive
278
+ if (!props.initialValue) {
279
+ setValue(props.value || '');
280
+ }
281
+ }, [props.value]);
282
+ // Escape pressed
283
+ useEffect(() => {
284
+ var _a;
285
+ if (!isFocused || props.clearOnEscape === false)
286
+ return;
287
+ setValue('');
288
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
289
+ // eslint-disable-next-line react-hooks/exhaustive-deps
290
+ }, [escapePressed]);
291
+ // Value changed
292
+ useEffect(() => {
293
+ if (props.inputType === 'decimal') {
294
+ // Normalize step setting
295
+ if (!isNaN(parseFloat(value))) {
296
+ const match = /\.(.+)/.exec(value);
297
+ console.log(match);
298
+ if (match) {
299
+ const s = `0.${Array.apply(null, Array(match[1].length - 1))
300
+ .map(() => '0')
301
+ .join('')}1`;
302
+ console.log(s);
303
+ setStep(s);
304
+ }
305
+ }
306
+ }
307
+ else if (props.inputType === 'integer') {
308
+ // Overwrite value as integer to forcibly truncate floating point numbers
309
+ setValue(parseInt(value).toString());
310
+ }
311
+ // Debounce onChange notification
312
+ if (!props.onChange)
313
+ return;
314
+ clearTimeout(timer);
315
+ setTimer(setTimeout(() => (props.onChange ? props.onChange(value) : undefined), debounceMs));
316
+ // eslint-disable-next-line react-hooks/exhaustive-deps
317
+ }, [value]);
318
+ // Update state from props
319
+ useEffect(() => {
320
+ setDebounceMs(props.changeDebounceMs || 300);
321
+ }, [props.changeDebounceMs]);
322
+ // Normalize inputRef
323
+ let inputRef; // = useRef<HTMLInputElement>(null);
324
+ if (props.inputRef)
325
+ inputRef = props.inputRef;
326
+ else if (props.inputType === 'textarea')
327
+ inputRef = useRef(null);
328
+ else
329
+ inputRef = useRef(null);
330
+ const hasLabel = props.label && props.label !== '';
331
+ // Global key bindings
332
+ function globalKeyBindings(event) {
333
+ // Escape - cancel search
334
+ if (event.key === 'Escape') {
335
+ event.stopPropagation();
336
+ event.preventDefault();
337
+ setEscapePressed(Date.now());
338
+ return;
339
+ }
340
+ }
341
+ // Normalize input type
342
+ let inputType = props.inputType;
343
+ if (inputType === 'integer' || inputType === 'decimal')
344
+ inputType = 'number';
345
+ let component;
346
+ switch (inputType) {
347
+ case 'textarea': {
348
+ component = (React.createElement("textarea", { className: "dx-textarea", placeholder: props.placeholder, ref: inputRef, value: value, onChange: (e) => setValue(e.target.value), onFocus: () => {
349
+ setIsFocused(true);
350
+ if (props.onFocus)
351
+ props.onFocus();
352
+ }, onBlur: () => {
353
+ setIsFocused(false);
354
+ if (props.onBlur)
355
+ props.onBlur();
356
+ }, disabled: props.disabled === true, autoFocus: props.autoFocus }));
357
+ break;
358
+ }
359
+ // TODO: special handling for other inputType values
360
+ default: {
361
+ component = (React.createElement("div", { className: `dx-textbox${hasLabel ? ' with-label' : ''}${props.disabled ? ' disabled' : ''}` },
362
+ props.icon ? React.createElement(GenesysDevIcon, { icon: props.icon, className: "input-icon" }) : undefined,
363
+ React.createElement("input", { className: "dx-input", type: inputType, step: step, value: value, placeholder: props.placeholder, onChange: (e) => setValue(e.target.value), ref: inputRef, onFocus: () => {
364
+ setIsFocused(true);
365
+ if (props.onFocus)
366
+ props.onFocus();
367
+ }, onBlur: () => {
368
+ setIsFocused(false);
369
+ if (props.onBlur)
370
+ props.onBlur();
371
+ }, disabled: props.disabled === true, autoFocus: props.autoFocus }),
372
+ props.clearButton && (value || isFocused) && !props.disabled ? (React.createElement(GenesysDevIcon, { icon: GenesysDevIcons.AppTimes, className: "clear-icon", onClick: () => setValue('') })) : undefined));
373
+ }
374
+ }
375
+ // Render
376
+ return (React.createElement(DxLabel, { label: props.label, description: props.description, className: props.className }, component));
377
+ }
378
+
379
+ var css_248z$5 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.dx-toggle-container {\n display: inline-block;\n}\n.dx-toggle-container .dx-toggle {\n border: 1px solid var(--theme-core-control-border-color);\n background: var(--theme-core-control-background-color);\n border-radius: 6px;\n height: 26px;\n padding: 0px 4px;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n gap: 2px;\n cursor: pointer;\n}\n.dx-toggle-container .dx-toggle:hover .slider {\n border-color: var(--theme-core-control-focus-color);\n}\n.dx-toggle-container .dx-toggle .icon {\n font-size: 10px;\n line-height: 0;\n margin: 0 5px;\n color: var(--theme-core-control-border-color);\n}\n.dx-toggle-container .dx-toggle .clear-placeholder {\n width: 19px;\n padding: 0 1px 0 0;\n margin: 0;\n display: block;\n}\n.dx-toggle-container .dx-toggle .slider {\n height: 22px;\n width: 22px;\n border-radius: 22px;\n background-color: var(--theme-core-control-punch-color);\n box-shadow: 0px 1px 2px var(--theme-core-box-shadow-color);\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid transparent;\n}\n.dx-toggle-container .dx-toggle .slider .icon {\n font-size: 10px;\n line-height: 0;\n color: var(--theme-core-control-background-color);\n padding: 0;\n margin: 0;\n}\n.dx-toggle-container.disabled .dx-toggle {\n cursor: not-allowed;\n opacity: 0.7;\n border-color: var(--theme-core-control-border-color);\n color: var(--theme-core-control-background-color);\n}\n.dx-toggle-container.disabled .dx-toggle:hover .slider {\n border-color: transparent;\n}\n.dx-toggle-container.disabled .dx-toggle .slider {\n opacity: 0.7;\n color: var(--theme-core-control-background-color);\n background-color: var(--theme-core-control-punch-color);\n}";
380
+ styleInject(css_248z$5);
381
+
382
+ function DxToggle(props) {
383
+ let initialValue = props.value !== undefined ? props.value : props.initialValue;
384
+ if (!props.isTriState)
385
+ initialValue = initialValue || false;
386
+ const [value, setValue] = useState(initialValue);
387
+ const trueIcon = props.trueIcon || GenesysDevIcons.AppCheck;
388
+ const falseIcon = props.falseIcon || GenesysDevIcons.AppTimes;
389
+ useEffect(() => {
390
+ if (props.initialValue || props.value === value || (!props.isTriState && props.value === undefined))
391
+ return;
392
+ setValue(props.value);
393
+ }, [props.value]);
394
+ useEffect(() => {
395
+ if (props.onChange)
396
+ props.onChange(value);
397
+ // eslint-disable-next-line react-hooks/exhaustive-deps
398
+ }, [value]);
399
+ const toggleValue = () => {
400
+ if (props.disabled)
401
+ return;
402
+ if (props.isTriState) {
403
+ if (value === undefined)
404
+ setValue(true);
405
+ else if (value === true)
406
+ setValue(false);
407
+ else
408
+ setValue(undefined);
409
+ }
410
+ else {
411
+ setValue(!value);
412
+ }
413
+ };
414
+ return (React.createElement(DxLabel, { label: props.label, description: props.description, className: props.className },
415
+ React.createElement("div", { className: `dx-toggle-container${props.disabled ? ' disabled' : ''}` },
416
+ React.createElement("div", { className: 'dx-toggle', onClick: toggleValue },
417
+ value !== false ? React.createElement(GenesysDevIcon, { icon: falseIcon }) : undefined,
418
+ value === true && props.isTriState ? React.createElement("div", { className: 'clear-placeholder' }, "\u00A0") : undefined,
419
+ React.createElement("div", { className: 'slider' }, value !== undefined ? React.createElement(GenesysDevIcon, { icon: value ? trueIcon : falseIcon }) : undefined),
420
+ value === false && props.isTriState ? React.createElement("div", { className: 'clear-placeholder' }, "\u00A0") : undefined,
421
+ value !== true ? React.createElement(GenesysDevIcon, { icon: trueIcon }) : undefined))));
422
+ }
423
+
424
+ var css_248z$4 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.alert-container {\n margin: 40px 0;\n padding: 0;\n}\n.toc-link + .alert-container {\n margin-top: 0;\n}\n.alert-container .alert {\n display: flex;\n flex-flow: row nowrap;\n gap: 20px;\n background-color: var(--theme-alertblock-default-background-color);\n border: 1px solid var(--theme-alertblock-default-border-color);\n color: var(--theme-alertblock-default-text-color);\n border-radius: 4px;\n padding: 15px 20px;\n font-size: 14px;\n line-height: 14px;\n}\n.alert-container .alert .clickable {\n cursor: pointer;\n}\n.alert-container .alert .info-icon {\n display: inline-block;\n font-size: 16px;\n line-height: 0;\n margin-top: 2px;\n color: var(--theme-alertblock-default-icon-color);\n}\n.alert-container .alert .alert-content {\n flex-grow: 1;\n font-size: 14px;\n line-height: 20px;\n margin: 0;\n}\n.alert-container .alert .alert-content .alert-title {\n font-size: 14px;\n line-height: 20px;\n font-weight: bold;\n margin-bottom: 6px;\n}\n.alert-container .alert .alert-content .alert-title.collapsed {\n margin-bottom: 0;\n}\n.alert-container .alert p:last-of-type {\n margin-bottom: 0;\n}\n.alert-container .alert.alert-info {\n color: var(--theme-alertblock-info-text-color);\n background-color: var(--theme-alertblock-info-background-color);\n border-color: var(--theme-alertblock-info-border-color);\n}\n.alert-container .alert.alert-info .icon {\n color: var(--theme-alertblock-info-icon-color);\n}\n.alert-container .alert.alert-warning {\n color: var(--theme-alertblock-warning-text-color);\n background-color: var(--theme-alertblock-warning-background-color);\n border-color: var(--theme-alertblock-warning-border-color);\n}\n.alert-container .alert.alert-warning .icon {\n color: var(--theme-alertblock-warning-icon-color);\n}\n.alert-container .alert.alert-critical {\n color: var(--theme-alertblock-critical-text-color);\n background-color: var(--theme-alertblock-critical-background-color);\n border-color: var(--theme-alertblock-critical-border-color);\n}\n.alert-container .alert.alert-critical .icon {\n color: var(--theme-alertblock-critical-icon-color);\n}\n.alert-container .alert.alert-success {\n color: var(--theme-alertblock-success-text-color);\n background-color: var(--theme-alertblock-success-background-color);\n border-color: var(--theme-alertblock-success-border-color);\n}\n.alert-container .alert.alert-success .icon {\n color: var(--theme-alertblock-success-icon-color);\n}\n.alert-container .alert.alert-toast {\n color: var(--theme-alertblock-toast-text-color);\n background-color: var(--theme-alertblock-toast-background-color);\n border-color: var(--theme-alertblock-toast-border-color);\n}\n.alert-container .alert.alert-toast .icon {\n color: var(--theme-alertblock-toast-icon-color);\n}";
425
+ styleInject(css_248z$4);
426
+
427
+ function AlertBlock(props) {
428
+ const isCollapsible = props.collapsible === false ? false : props.collapsible || props.autoCollapse || false;
429
+ const [isCollapsed, setIsCollapsed] = useState(isCollapsible ? props.autoCollapse || false : false);
430
+ let title;
431
+ if (props.title) {
432
+ title = (React.createElement("div", { className: `alert-title${isCollapsible ? ' clickable' : ''}${isCollapsed ? ' collapsed' : ''}`, onClick: isCollapsible ? () => setIsCollapsed(!isCollapsed) : undefined }, props.title));
433
+ }
434
+ let icon;
435
+ switch (props.alertType) {
436
+ case 'info': {
437
+ icon = React.createElement(GenesysDevIcon, { className: "info-icon", icon: GenesysDevIcons.AppInfoSolid });
438
+ break;
439
+ }
440
+ case 'success': {
441
+ icon = React.createElement(GenesysDevIcon, { className: "info-icon", icon: GenesysDevIcons.AppSuccessSolid });
442
+ break;
443
+ }
444
+ case 'critical': {
445
+ icon = React.createElement(GenesysDevIcon, { className: "info-icon", icon: GenesysDevIcons.AppCriticalSolid });
446
+ break;
447
+ }
448
+ case 'warning': {
449
+ icon = React.createElement(GenesysDevIcon, { className: "info-icon", icon: GenesysDevIcons.AppWarnSolid });
450
+ break;
451
+ }
452
+ }
453
+ if (icon && isCollapsible) {
454
+ icon = (React.createElement("span", { className: "clickable", onClick: () => setIsCollapsed(!isCollapsed) }, icon));
455
+ }
456
+ //TODO: remove the card fence classes and build a proper collapser
457
+ return (React.createElement("div", { className: `alert-container${props.indentation && props.indentation > 0 ? ` indent-${props.indentation}` : ''} ${props.className || ''}` },
458
+ React.createElement("div", { className: `alert alert-${props.alertType}`, role: "alert" },
459
+ icon,
460
+ React.createElement("div", { className: "alert-content" },
461
+ title,
462
+ isCollapsed ? undefined : React.createElement("div", null, props.children)),
463
+ isCollapsible ? (React.createElement("span", { className: "clickable", onClick: () => setIsCollapsed(!isCollapsed) },
464
+ React.createElement(GenesysDevIcon, { icon: isCollapsed ? GenesysDevIcons.AppChevronDown : GenesysDevIcons.AppChevronUp }))) : undefined)));
465
+ }
466
+
467
+ var css_248z$3 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.loading-placeholder {\n position: relative;\n width: 160px;\n height: 160px;\n margin: 60px auto;\n}\n.loading-placeholder .text {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n font-style: normal;\n font-weight: 300;\n font-size: 16px;\n line-height: 20px;\n color: var(--theme-loadingplaceholder-text-color);\n position: relative;\n top: 5px;\n left: 5px;\n opacity: 0.5;\n}\n.loading-placeholder div {\n position: absolute;\n border: 4px solid var(--theme-loadingplaceholder-wave-color);\n opacity: 1;\n border-radius: 50%;\n animation: loading-placeholder 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;\n}\n.loading-placeholder div:nth-child(2) {\n animation-delay: -0.5s;\n}\n@keyframes loading-placeholder {\n 0% {\n top: 80px;\n left: 80px;\n width: 0;\n height: 0;\n opacity: 1;\n }\n 100% {\n top: 0px;\n left: 0px;\n width: 160px;\n height: 160px;\n opacity: 0;\n }\n}";
468
+ styleInject(css_248z$3);
469
+
470
+ // SimCity loading messages! https://gist.github.com/erikcox/7e96d031d00d7ecb1a2f
471
+ const MESSAGES = [
472
+ 'Adding Hidden Agendas',
473
+ 'Adjusting Bell Curves',
474
+ 'Aesthesizing Industrial Areas',
475
+ 'Aligning Covariance Matrices',
476
+ 'Applying Feng Shui Shaders',
477
+ 'Applying Theatre Soda Layer',
478
+ 'Asserting Packed Exemplars',
479
+ 'Attempting to Lock Back-Buffer',
480
+ 'Binding Sapling Root System',
481
+ 'Building Data Trees',
482
+ 'Bureacritizing Bureaucracies',
483
+ 'Calculating Inverse Probability Matrices',
484
+ 'Calculating Llama Expectoration Trajectory',
485
+ 'Calibrating Blue Skies',
486
+ 'Charging Ozone Layer',
487
+ 'Coalescing Cloud Formations',
488
+ 'Cohorting Exemplars',
489
+ 'Collecting Meteor Particles',
490
+ 'Compounding Inert Tessellations',
491
+ 'Compressing Fish Files',
492
+ 'Computing Optimal Bin Packing',
493
+ 'Concatenating Sub-Contractors',
494
+ 'Containing Existential Buffer',
495
+ 'Debunching Unionized Commercial Services',
496
+ 'Deciding What Message to Display Next',
497
+ 'Decomposing Singular Values',
498
+ 'Decrementing Tectonic Plates',
499
+ 'Deleting Ferry Routes',
500
+ 'Depixelating Inner Mountain Surface Back Faces',
501
+ 'Deunionizing Bulldozers',
502
+ 'Dicing Models',
503
+ 'Diluting Livestock Nutrition Variables',
504
+ 'Downloading Satellite Terrain Data',
505
+ 'Exposing Flash Variables to Streak System',
506
+ 'Extracting Resources',
507
+ 'Flushing Pipe Network',
508
+ 'Gathering Particle Sources',
509
+ 'Generating Jobs',
510
+ 'Gesticulating Mimes',
511
+ 'Graphing Whale Migration',
512
+ 'Hiding Willio Webnet Mask',
513
+ 'Increasing Accuracy of RCI Simulators',
514
+ 'Increasing Magmafacation',
515
+ 'Initializing My Sim Tracking Mechanism',
516
+ 'Initializing Robotic Click-Path AI',
517
+ 'Inserting Sublimated Messages',
518
+ 'Integrating Curves',
519
+ 'Integrating Illumination Form Factors',
520
+ 'Integrating Population Graphs',
521
+ 'Iterating Cellular Automata',
522
+ 'Lecturing Errant Subsystems',
523
+ 'Modeling Object Components',
524
+ 'Mopping Occupant Leaks',
525
+ 'Normalizing Power',
526
+ 'Obfuscating Quigley Matrix',
527
+ 'Partitioning Singularities',
528
+ 'Perturbing Matrices',
529
+ 'Polishing Water Highlights',
530
+ 'Populating Lot Templates',
531
+ 'Preparing Sprites for Random Walks',
532
+ 'Prioritizing Landmarks',
533
+ 'Projecting Law Enforcement Pastry Intake',
534
+ 'Realigning Alternate Time Frames',
535
+ 'Relaxing Splines',
536
+ 'Removing Road Network Speed Bumps',
537
+ 'Removing Texture Gradients',
538
+ 'Removing Vehicle Avoidance Behavior',
539
+ 'Reticulating Splines',
540
+ 'Retracting Phong Shader',
541
+ 'Retrieving from Back Store',
542
+ 'Reverse Engineering Image Consultant',
543
+ 'Routing Neural Network Infanstructure',
544
+ 'Scattering Rhino Food Sources',
545
+ 'Scrubbing Terrain',
546
+ 'Searching for Llamas',
547
+ 'Seeding Architecture Simulation Parameters',
548
+ 'Sequencing Particles',
549
+ 'Setting Advisor Moods',
550
+ 'Setting Inner Deity Indicators',
551
+ 'Setting Universal Physical Constants',
552
+ 'Sonically Enhancing Occupant-Free Timber',
553
+ 'Speculating Stock Market Indices',
554
+ 'Splatting Transforms',
555
+ 'Stratifying Ground Layers',
556
+ 'Sub-Sampling Water Data',
557
+ 'Synthesizing Gravity',
558
+ 'Synthesizing Wavelets',
559
+ 'Time-Compressing Simulator Clock',
560
+ 'Unable to Reveal Current Activity',
561
+ ];
562
+ function LoadingPlaceholder(props) {
563
+ return (React.createElement("div", { className: "loading-placeholder" },
564
+ React.createElement("span", { className: "text" }, props.text || MESSAGES[Math.floor(Math.random() * (MESSAGES.length - 1))]),
565
+ React.createElement("div", null),
566
+ React.createElement("div", null)));
567
+ }
568
+
569
+ var css_248z$2 = "/* Custom properties */\n:root {\n --tooltip-text-color: white;\n --tooltip-background-color: black;\n --tooltip-margin: 10px;\n --tooltip-arrow-size: 6px;\n}\n\n/* Wrapping */\n.tooltip-container {\n display: inline-block;\n position: relative;\n line-height: 0;\n /* Absolute positioning */\n}\n.tooltip-container .tooltip-tip {\n position: absolute;\n border-radius: 4px;\n left: 50%;\n transform: translateX(-50%);\n padding: 6px;\n color: var(--tooltip-text-color);\n background: var(--tooltip-background-color);\n font-size: 14px;\n line-height: 1;\n z-index: 10000;\n max-width: 300px;\n width: max-content;\n opacity: 0;\n visibility: hidden;\n transition: visibility 1.1s ease-out, opacity 1s ease-out;\n /* CSS border triangles */\n /* Absolute positioning */\n /* Absolute positioning */\n /* Absolute positioning */\n /* Absolute positioning */\n}\n.tooltip-container .tooltip-tip.visible {\n opacity: 1;\n visibility: visible;\n transition: visibility 0s, opacity 0.1s ease-in;\n}\n.tooltip-container .tooltip-tip::before {\n content: \" \";\n left: 50%;\n border: solid transparent;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-width: var(--tooltip-arrow-size);\n margin-left: calc(var(--tooltip-arrow-size) * -1);\n}\n.tooltip-container .tooltip-tip.top {\n bottom: 130%;\n /* CSS border triangles */\n}\n.tooltip-container .tooltip-tip.top::before {\n top: 100%;\n border-top-color: var(--tooltip-background-color);\n}\n.tooltip-container .tooltip-tip.right {\n left: calc(100% + var(--tooltip-margin));\n top: 50%;\n transform: translateX(0) translateY(-50%);\n /* CSS border triangles */\n}\n.tooltip-container .tooltip-tip.right::before {\n left: calc(var(--tooltip-arrow-size) * -1);\n top: 50%;\n transform: translateX(0) translateY(-50%);\n border-right-color: var(--tooltip-background-color);\n}\n.tooltip-container .tooltip-tip.bottom {\n top: 110%;\n /* CSS border triangles */\n}\n.tooltip-container .tooltip-tip.bottom::before {\n bottom: 100%;\n border-bottom-color: var(--tooltip-background-color);\n}\n.tooltip-container .tooltip-tip.left {\n left: auto;\n right: calc(100% + var(--tooltip-margin));\n top: 50%;\n transform: translateX(0) translateY(-50%);\n /* CSS border triangles */\n}\n.tooltip-container .tooltip-tip.left::before {\n left: auto;\n right: calc(var(--tooltip-arrow-size) * -2);\n top: 50%;\n transform: translateX(0) translateY(-50%);\n border-left-color: var(--tooltip-background-color);\n}";
570
+ styleInject(css_248z$2);
571
+
572
+ // Inspired by https://paladini.dev/posts/how-to-make-an-extremely-reusable-tooltip-component-with-react--and-nothing-else/
573
+ function Tooltip(props) {
574
+ const [isShowing, setIsShowing] = useState(false);
575
+ const timeout = useRef();
576
+ useEffect(() => {
577
+ if (props.isShowing === undefined)
578
+ return;
579
+ setIsShowing(props.isShowing === true);
580
+ }, [props.isShowing]);
581
+ const showTip = (e) => {
582
+ // Ignore mouse events from the tooltip itself
583
+ if (e.target.className.includes('tooltip-tip'))
584
+ return;
585
+ // Ignore mouse events when manually controlled
586
+ if (props.isShowing !== undefined)
587
+ return;
588
+ timeout.current = setTimeout(() => {
589
+ setIsShowing(true);
590
+ }, 100);
591
+ };
592
+ const hideTip = () => {
593
+ if (props.isShowing !== undefined)
594
+ return;
595
+ if (timeout.current)
596
+ clearInterval(timeout.current);
597
+ setIsShowing(false);
598
+ };
599
+ return (React.createElement("div", { className: `tooltip-container ${props.className || ''}`, onMouseEnter: showTip, onMouseLeave: hideTip },
600
+ props.children,
601
+ React.createElement("div", { className: `tooltip-tip ${props.position || 'top'}${isShowing ? ' visible' : ''}` }, props.text)));
602
+ }
603
+
604
+ var css_248z$1 = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.copy-button {\n cursor: pointer;\n border: 0;\n background: transparent;\n color: var(--theme-core-text-color);\n}";
605
+ styleInject(css_248z$1);
606
+
607
+ function CopyButton(props) {
608
+ let [copyState, setCopyState] = useState(false);
609
+ // Copy function will set the component state to indicate we have copied the record and then show the tool tip. With the copyState set to true we will see 'Copied'
610
+ const copyCode = (e) => {
611
+ e.stopPropagation();
612
+ setCopyState(true);
613
+ navigator.clipboard.writeText(props.copyText);
614
+ return;
615
+ };
616
+ // Once we lose focus on the copy button, we want to set the copyState to false so that we can hide the tool tip and set the default tool tip to ''
617
+ const loseFocus = () => {
618
+ setCopyState(false);
619
+ return;
620
+ };
621
+ const buttonClasses = ['copy-button'];
622
+ if (props.className)
623
+ buttonClasses.push(props.className);
624
+ return (React.createElement(React.Fragment, null,
625
+ React.createElement(Tooltip, { isShowing: copyState, text: "Copied", position: props.tooltipPosition },
626
+ React.createElement("button", { type: "button", className: buttonClasses.join(' '), onClick: copyCode, onMouseOut: loseFocus },
627
+ React.createElement(GenesysDevIcon, { icon: GenesysDevIcons.AppCopy })))));
628
+ }
629
+
630
+ function _objectWithoutPropertiesLoose(source, excluded) {
631
+ if (source == null) return {};
632
+ var target = {};
633
+ var sourceKeys = Object.keys(source);
634
+ var key, i;
635
+ for (i = 0; i < sourceKeys.length; i++) {
636
+ key = sourceKeys[i];
637
+ if (excluded.indexOf(key) >= 0) continue;
638
+ target[key] = source[key];
639
+ }
640
+ return target;
641
+ }
642
+
643
+ function _objectWithoutProperties(source, excluded) {
644
+ if (source == null) return {};
645
+ var target = _objectWithoutPropertiesLoose(source, excluded);
646
+ var key, i;
647
+ if (Object.getOwnPropertySymbols) {
648
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
649
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
650
+ key = sourceSymbolKeys[i];
651
+ if (excluded.indexOf(key) >= 0) continue;
652
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
653
+ target[key] = source[key];
654
+ }
655
+ }
656
+ return target;
657
+ }
658
+
659
+ function _arrayLikeToArray(arr, len) {
660
+ if (len == null || len > arr.length) len = arr.length;
661
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
662
+ return arr2;
663
+ }
664
+
665
+ function _arrayWithoutHoles(arr) {
666
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
667
+ }
668
+
669
+ function _iterableToArray(iter) {
670
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
671
+ }
672
+
673
+ function _unsupportedIterableToArray(o, minLen) {
674
+ if (!o) return;
675
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
676
+ var n = Object.prototype.toString.call(o).slice(8, -1);
677
+ if (n === "Object" && o.constructor) n = o.constructor.name;
678
+ if (n === "Map" || n === "Set") return Array.from(o);
679
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
680
+ }
681
+
682
+ function _nonIterableSpread() {
683
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
684
+ }
685
+
686
+ function _toConsumableArray(arr) {
687
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
688
+ }
689
+
690
+ function _typeof$1(obj) {
691
+ "@babel/helpers - typeof";
692
+
693
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
694
+ return typeof obj;
695
+ } : function (obj) {
696
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
697
+ }, _typeof$1(obj);
698
+ }
699
+
700
+ function _toPrimitive(input, hint) {
701
+ if (_typeof$1(input) !== "object" || input === null) return input;
702
+ var prim = input[Symbol.toPrimitive];
703
+ if (prim !== undefined) {
704
+ var res = prim.call(input, hint || "default");
705
+ if (_typeof$1(res) !== "object") return res;
706
+ throw new TypeError("@@toPrimitive must return a primitive value.");
707
+ }
708
+ return (hint === "string" ? String : Number)(input);
709
+ }
710
+
711
+ function _toPropertyKey(arg) {
712
+ var key = _toPrimitive(arg, "string");
713
+ return _typeof$1(key) === "symbol" ? key : String(key);
714
+ }
715
+
716
+ function _defineProperty(obj, key, value) {
717
+ key = _toPropertyKey(key);
718
+ if (key in obj) {
719
+ Object.defineProperty(obj, key, {
720
+ value: value,
721
+ enumerable: true,
722
+ configurable: true,
723
+ writable: true
724
+ });
725
+ } else {
726
+ obj[key] = value;
727
+ }
728
+ return obj;
729
+ }
730
+
731
+ function _extends() {
732
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
733
+ for (var i = 1; i < arguments.length; i++) {
734
+ var source = arguments[i];
735
+ for (var key in source) {
736
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
737
+ target[key] = source[key];
738
+ }
739
+ }
740
+ }
741
+ return target;
742
+ };
743
+ return _extends.apply(this, arguments);
744
+ }
745
+
746
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
747
+
748
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
749
+ //
750
+ // Super simple, non-algorithmic solution since the
751
+ // number of class names will not be greater than 4
752
+
753
+ function powerSetPermutations(arr) {
754
+ var arrLength = arr.length;
755
+ if (arrLength === 0 || arrLength === 1) return arr;
756
+
757
+ if (arrLength === 2) {
758
+ // prettier-ignore
759
+ return [arr[0], arr[1], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0])];
760
+ }
761
+
762
+ if (arrLength === 3) {
763
+ return [arr[0], arr[1], arr[2], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2]), "".concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0])];
764
+ }
765
+
766
+ if (arrLength >= 4) {
767
+ // Currently does not support more than 4 extra
768
+ // class names (after `.token` has been removed)
769
+ return [arr[0], arr[1], arr[2], arr[3], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[3]), "".concat(arr[3], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[1], ".").concat(arr[0])];
770
+ }
771
+ }
772
+
773
+ var classNameCombinations = {};
774
+
775
+ function getClassNameCombinations(classNames) {
776
+ if (classNames.length === 0 || classNames.length === 1) return classNames;
777
+ var key = classNames.join('.');
778
+
779
+ if (!classNameCombinations[key]) {
780
+ classNameCombinations[key] = powerSetPermutations(classNames);
781
+ }
782
+
783
+ return classNameCombinations[key];
784
+ }
785
+
786
+ function createStyleObject(classNames) {
787
+ var elementStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
788
+ var stylesheet = arguments.length > 2 ? arguments[2] : undefined;
789
+ var nonTokenClassNames = classNames.filter(function (className) {
790
+ return className !== 'token';
791
+ });
792
+ var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
793
+ return classNamesCombinations.reduce(function (styleObject, className) {
794
+ return _objectSpread$1(_objectSpread$1({}, styleObject), stylesheet[className]);
795
+ }, elementStyle);
796
+ }
797
+ function createClassNameString(classNames) {
798
+ return classNames.join(' ');
799
+ }
800
+ function createChildren(stylesheet, useInlineStyles) {
801
+ var childrenCount = 0;
802
+ return function (children) {
803
+ childrenCount += 1;
804
+ return children.map(function (child, i) {
805
+ return createElement({
806
+ node: child,
807
+ stylesheet: stylesheet,
808
+ useInlineStyles: useInlineStyles,
809
+ key: "code-segment-".concat(childrenCount, "-").concat(i)
810
+ });
811
+ });
812
+ };
813
+ }
814
+ function createElement(_ref) {
815
+ var node = _ref.node,
816
+ stylesheet = _ref.stylesheet,
817
+ _ref$style = _ref.style,
818
+ style = _ref$style === void 0 ? {} : _ref$style,
819
+ useInlineStyles = _ref.useInlineStyles,
820
+ key = _ref.key;
821
+ var properties = node.properties,
822
+ type = node.type,
823
+ TagName = node.tagName,
824
+ value = node.value;
825
+
826
+ if (type === 'text') {
827
+ return value;
828
+ } else if (TagName) {
829
+ var childrenCreator = createChildren(stylesheet, useInlineStyles);
830
+ var props;
831
+
832
+ if (!useInlineStyles) {
833
+ props = _objectSpread$1(_objectSpread$1({}, properties), {}, {
834
+ className: createClassNameString(properties.className)
835
+ });
836
+ } else {
837
+ var allStylesheetSelectors = Object.keys(stylesheet).reduce(function (classes, selector) {
838
+ selector.split('.').forEach(function (className) {
839
+ if (!classes.includes(className)) classes.push(className);
840
+ });
841
+ return classes;
842
+ }, []); // For compatibility with older versions of react-syntax-highlighter
843
+
844
+ var startingClassName = properties.className && properties.className.includes('token') ? ['token'] : [];
845
+ var className = properties.className && startingClassName.concat(properties.className.filter(function (className) {
846
+ return !allStylesheetSelectors.includes(className);
847
+ }));
848
+ props = _objectSpread$1(_objectSpread$1({}, properties), {}, {
849
+ className: createClassNameString(className) || undefined,
850
+ style: createStyleObject(properties.className, Object.assign({}, properties.style, style), stylesheet)
851
+ });
852
+ }
853
+
854
+ var children = childrenCreator(node.children);
855
+ return /*#__PURE__*/React.createElement(TagName, _extends({
856
+ key: key
857
+ }, props), children);
858
+ }
859
+ }
860
+
861
+ var checkForListedLanguage = (function (astGenerator, language) {
862
+ var langs = astGenerator.listLanguages();
863
+ return langs.indexOf(language) !== -1;
864
+ });
865
+
866
+ var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
867
+
868
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
869
+
870
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
871
+ var newLineRegex = /\n/g;
872
+
873
+ function getNewLines(str) {
874
+ return str.match(newLineRegex);
875
+ }
876
+
877
+ function getAllLineNumbers(_ref) {
878
+ var lines = _ref.lines,
879
+ startingLineNumber = _ref.startingLineNumber,
880
+ style = _ref.style;
881
+ return lines.map(function (_, i) {
882
+ var number = i + startingLineNumber;
883
+ return /*#__PURE__*/React.createElement("span", {
884
+ key: "line-".concat(i),
885
+ className: "react-syntax-highlighter-line-number",
886
+ style: typeof style === 'function' ? style(number) : style
887
+ }, "".concat(number, "\n"));
888
+ });
889
+ }
890
+
891
+ function AllLineNumbers(_ref2) {
892
+ var codeString = _ref2.codeString,
893
+ codeStyle = _ref2.codeStyle,
894
+ _ref2$containerStyle = _ref2.containerStyle,
895
+ containerStyle = _ref2$containerStyle === void 0 ? {
896
+ "float": 'left',
897
+ paddingRight: '10px'
898
+ } : _ref2$containerStyle,
899
+ _ref2$numberStyle = _ref2.numberStyle,
900
+ numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle,
901
+ startingLineNumber = _ref2.startingLineNumber;
902
+ return /*#__PURE__*/React.createElement("code", {
903
+ style: Object.assign({}, codeStyle, containerStyle)
904
+ }, getAllLineNumbers({
905
+ lines: codeString.replace(/\n$/, '').split('\n'),
906
+ style: numberStyle,
907
+ startingLineNumber: startingLineNumber
908
+ }));
909
+ }
910
+
911
+ function getEmWidthOfNumber(num) {
912
+ return "".concat(num.toString().length, ".25em");
913
+ }
914
+
915
+ function getInlineLineNumber(lineNumber, inlineLineNumberStyle) {
916
+ return {
917
+ type: 'element',
918
+ tagName: 'span',
919
+ properties: {
920
+ key: "line-number--".concat(lineNumber),
921
+ className: ['comment', 'linenumber', 'react-syntax-highlighter-line-number'],
922
+ style: inlineLineNumberStyle
923
+ },
924
+ children: [{
925
+ type: 'text',
926
+ value: lineNumber
927
+ }]
928
+ };
929
+ }
930
+
931
+ function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber) {
932
+ // minimally necessary styling for line numbers
933
+ var defaultLineNumberStyle = {
934
+ display: 'inline-block',
935
+ minWidth: getEmWidthOfNumber(largestLineNumber),
936
+ paddingRight: '1em',
937
+ textAlign: 'right',
938
+ userSelect: 'none'
939
+ }; // prep custom styling
940
+
941
+ var customLineNumberStyle = typeof lineNumberStyle === 'function' ? lineNumberStyle(lineNumber) : lineNumberStyle; // combine
942
+
943
+ var assembledStyle = _objectSpread(_objectSpread({}, defaultLineNumberStyle), customLineNumberStyle);
944
+
945
+ return assembledStyle;
946
+ }
947
+
948
+ function createLineElement(_ref3) {
949
+ var children = _ref3.children,
950
+ lineNumber = _ref3.lineNumber,
951
+ lineNumberStyle = _ref3.lineNumberStyle,
952
+ largestLineNumber = _ref3.largestLineNumber,
953
+ showInlineLineNumbers = _ref3.showInlineLineNumbers,
954
+ _ref3$lineProps = _ref3.lineProps,
955
+ lineProps = _ref3$lineProps === void 0 ? {} : _ref3$lineProps,
956
+ _ref3$className = _ref3.className,
957
+ className = _ref3$className === void 0 ? [] : _ref3$className,
958
+ showLineNumbers = _ref3.showLineNumbers,
959
+ wrapLongLines = _ref3.wrapLongLines;
960
+ var properties = typeof lineProps === 'function' ? lineProps(lineNumber) : lineProps;
961
+ properties['className'] = className;
962
+
963
+ if (lineNumber && showInlineLineNumbers) {
964
+ var inlineLineNumberStyle = assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber);
965
+ children.unshift(getInlineLineNumber(lineNumber, inlineLineNumberStyle));
966
+ }
967
+
968
+ if (wrapLongLines & showLineNumbers) {
969
+ properties.style = _objectSpread(_objectSpread({}, properties.style), {}, {
970
+ display: 'flex'
971
+ });
972
+ }
973
+
974
+ return {
975
+ type: 'element',
976
+ tagName: 'span',
977
+ properties: properties,
978
+ children: children
979
+ };
980
+ }
981
+
982
+ function flattenCodeTree(tree) {
983
+ var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
984
+ var newTree = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
985
+
986
+ for (var i = 0; i < tree.length; i++) {
987
+ var node = tree[i];
988
+
989
+ if (node.type === 'text') {
990
+ newTree.push(createLineElement({
991
+ children: [node],
992
+ className: _toConsumableArray(new Set(className))
993
+ }));
994
+ } else if (node.children) {
995
+ var classNames = className.concat(node.properties.className);
996
+ flattenCodeTree(node.children, classNames).forEach(function (i) {
997
+ return newTree.push(i);
998
+ });
999
+ }
1000
+ }
1001
+
1002
+ return newTree;
1003
+ }
1004
+
1005
+ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines) {
1006
+ var _ref4;
1007
+
1008
+ var tree = flattenCodeTree(codeTree.value);
1009
+ var newTree = [];
1010
+ var lastLineBreakIndex = -1;
1011
+ var index = 0;
1012
+
1013
+ function createWrappedLine(children, lineNumber) {
1014
+ var className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1015
+ return createLineElement({
1016
+ children: children,
1017
+ lineNumber: lineNumber,
1018
+ lineNumberStyle: lineNumberStyle,
1019
+ largestLineNumber: largestLineNumber,
1020
+ showInlineLineNumbers: showInlineLineNumbers,
1021
+ lineProps: lineProps,
1022
+ className: className,
1023
+ showLineNumbers: showLineNumbers,
1024
+ wrapLongLines: wrapLongLines
1025
+ });
1026
+ }
1027
+
1028
+ function createUnwrappedLine(children, lineNumber) {
1029
+ if (showLineNumbers && lineNumber && showInlineLineNumbers) {
1030
+ var inlineLineNumberStyle = assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber);
1031
+ children.unshift(getInlineLineNumber(lineNumber, inlineLineNumberStyle));
1032
+ }
1033
+
1034
+ return children;
1035
+ }
1036
+
1037
+ function createLine(children, lineNumber) {
1038
+ var className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1039
+ return wrapLines || className.length > 0 ? createWrappedLine(children, lineNumber, className) : createUnwrappedLine(children, lineNumber);
1040
+ }
1041
+
1042
+ var _loop = function _loop() {
1043
+ var node = tree[index];
1044
+ var value = node.children[0].value;
1045
+ var newLines = getNewLines(value);
1046
+
1047
+ if (newLines) {
1048
+ var splitValue = value.split('\n');
1049
+ splitValue.forEach(function (text, i) {
1050
+ var lineNumber = showLineNumbers && newTree.length + startingLineNumber;
1051
+ var newChild = {
1052
+ type: 'text',
1053
+ value: "".concat(text, "\n")
1054
+ }; // if it's the first line
1055
+
1056
+ if (i === 0) {
1057
+ var _children = tree.slice(lastLineBreakIndex + 1, index).concat(createLineElement({
1058
+ children: [newChild],
1059
+ className: node.properties.className
1060
+ }));
1061
+
1062
+ var _line = createLine(_children, lineNumber);
1063
+
1064
+ newTree.push(_line); // if it's the last line
1065
+ } else if (i === splitValue.length - 1) {
1066
+ var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0];
1067
+ var lastLineInPreviousSpan = {
1068
+ type: 'text',
1069
+ value: "".concat(text)
1070
+ };
1071
+
1072
+ if (stringChild) {
1073
+ var newElem = createLineElement({
1074
+ children: [lastLineInPreviousSpan],
1075
+ className: node.properties.className
1076
+ });
1077
+ tree.splice(index + 1, 0, newElem);
1078
+ } else {
1079
+ var _children2 = [lastLineInPreviousSpan];
1080
+
1081
+ var _line2 = createLine(_children2, lineNumber, node.properties.className);
1082
+
1083
+ newTree.push(_line2);
1084
+ } // if it's neither the first nor the last line
1085
+
1086
+ } else {
1087
+ var _children3 = [newChild];
1088
+
1089
+ var _line3 = createLine(_children3, lineNumber, node.properties.className);
1090
+
1091
+ newTree.push(_line3);
1092
+ }
1093
+ });
1094
+ lastLineBreakIndex = index;
1095
+ }
1096
+
1097
+ index++;
1098
+ };
1099
+
1100
+ while (index < tree.length) {
1101
+ _loop();
1102
+ }
1103
+
1104
+ if (lastLineBreakIndex !== tree.length - 1) {
1105
+ var children = tree.slice(lastLineBreakIndex + 1, tree.length);
1106
+
1107
+ if (children && children.length) {
1108
+ var lineNumber = showLineNumbers && newTree.length + startingLineNumber;
1109
+ var line = createLine(children, lineNumber);
1110
+ newTree.push(line);
1111
+ }
1112
+ }
1113
+
1114
+ return wrapLines ? newTree : (_ref4 = []).concat.apply(_ref4, newTree);
1115
+ }
1116
+
1117
+ function defaultRenderer(_ref5) {
1118
+ var rows = _ref5.rows,
1119
+ stylesheet = _ref5.stylesheet,
1120
+ useInlineStyles = _ref5.useInlineStyles;
1121
+ return rows.map(function (node, i) {
1122
+ return createElement({
1123
+ node: node,
1124
+ stylesheet: stylesheet,
1125
+ useInlineStyles: useInlineStyles,
1126
+ key: "code-segement".concat(i)
1127
+ });
1128
+ });
1129
+ } // only highlight.js has the highlightAuto method
1130
+
1131
+
1132
+ function isHighlightJs(astGenerator) {
1133
+ return astGenerator && typeof astGenerator.highlightAuto !== 'undefined';
1134
+ }
1135
+
1136
+ function getCodeTree(_ref6) {
1137
+ var astGenerator = _ref6.astGenerator,
1138
+ language = _ref6.language,
1139
+ code = _ref6.code,
1140
+ defaultCodeValue = _ref6.defaultCodeValue;
1141
+
1142
+ // figure out whether we're using lowlight/highlight or refractor/prism
1143
+ // then attempt highlighting accordingly
1144
+ // lowlight/highlight?
1145
+ if (isHighlightJs(astGenerator)) {
1146
+ var hasLanguage = checkForListedLanguage(astGenerator, language);
1147
+
1148
+ if (language === 'text') {
1149
+ return {
1150
+ value: defaultCodeValue,
1151
+ language: 'text'
1152
+ };
1153
+ } else if (hasLanguage) {
1154
+ return astGenerator.highlight(language, code);
1155
+ } else {
1156
+ return astGenerator.highlightAuto(code);
1157
+ }
1158
+ } // must be refractor/prism, then
1159
+
1160
+
1161
+ try {
1162
+ return language && language !== 'text' ? {
1163
+ value: astGenerator.highlight(code, language)
1164
+ } : {
1165
+ value: defaultCodeValue
1166
+ };
1167
+ } catch (e) {
1168
+ return {
1169
+ value: defaultCodeValue
1170
+ };
1171
+ }
1172
+ }
1173
+
1174
+ function highlight (defaultAstGenerator, defaultStyle) {
1175
+ return function SyntaxHighlighter(_ref7) {
1176
+ var language = _ref7.language,
1177
+ children = _ref7.children,
1178
+ _ref7$style = _ref7.style,
1179
+ style = _ref7$style === void 0 ? defaultStyle : _ref7$style,
1180
+ _ref7$customStyle = _ref7.customStyle,
1181
+ customStyle = _ref7$customStyle === void 0 ? {} : _ref7$customStyle,
1182
+ _ref7$codeTagProps = _ref7.codeTagProps,
1183
+ codeTagProps = _ref7$codeTagProps === void 0 ? {
1184
+ className: language ? "language-".concat(language) : undefined,
1185
+ style: _objectSpread(_objectSpread({}, style['code[class*="language-"]']), style["code[class*=\"language-".concat(language, "\"]")])
1186
+ } : _ref7$codeTagProps,
1187
+ _ref7$useInlineStyles = _ref7.useInlineStyles,
1188
+ useInlineStyles = _ref7$useInlineStyles === void 0 ? true : _ref7$useInlineStyles,
1189
+ _ref7$showLineNumbers = _ref7.showLineNumbers,
1190
+ showLineNumbers = _ref7$showLineNumbers === void 0 ? false : _ref7$showLineNumbers,
1191
+ _ref7$showInlineLineN = _ref7.showInlineLineNumbers,
1192
+ showInlineLineNumbers = _ref7$showInlineLineN === void 0 ? true : _ref7$showInlineLineN,
1193
+ _ref7$startingLineNum = _ref7.startingLineNumber,
1194
+ startingLineNumber = _ref7$startingLineNum === void 0 ? 1 : _ref7$startingLineNum,
1195
+ lineNumberContainerStyle = _ref7.lineNumberContainerStyle,
1196
+ _ref7$lineNumberStyle = _ref7.lineNumberStyle,
1197
+ lineNumberStyle = _ref7$lineNumberStyle === void 0 ? {} : _ref7$lineNumberStyle,
1198
+ wrapLines = _ref7.wrapLines,
1199
+ _ref7$wrapLongLines = _ref7.wrapLongLines,
1200
+ wrapLongLines = _ref7$wrapLongLines === void 0 ? false : _ref7$wrapLongLines,
1201
+ _ref7$lineProps = _ref7.lineProps,
1202
+ lineProps = _ref7$lineProps === void 0 ? {} : _ref7$lineProps,
1203
+ renderer = _ref7.renderer,
1204
+ _ref7$PreTag = _ref7.PreTag,
1205
+ PreTag = _ref7$PreTag === void 0 ? 'pre' : _ref7$PreTag,
1206
+ _ref7$CodeTag = _ref7.CodeTag,
1207
+ CodeTag = _ref7$CodeTag === void 0 ? 'code' : _ref7$CodeTag,
1208
+ _ref7$code = _ref7.code,
1209
+ code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
1210
+ astGenerator = _ref7.astGenerator,
1211
+ rest = _objectWithoutProperties(_ref7, _excluded);
1212
+
1213
+ astGenerator = astGenerator || defaultAstGenerator;
1214
+ var allLineNumbers = showLineNumbers ? /*#__PURE__*/React.createElement(AllLineNumbers, {
1215
+ containerStyle: lineNumberContainerStyle,
1216
+ codeStyle: codeTagProps.style || {},
1217
+ numberStyle: lineNumberStyle,
1218
+ startingLineNumber: startingLineNumber,
1219
+ codeString: code
1220
+ }) : null;
1221
+ var defaultPreStyle = style.hljs || style['pre[class*="language-"]'] || {
1222
+ backgroundColor: '#fff'
1223
+ };
1224
+ var generatorClassName = isHighlightJs(astGenerator) ? 'hljs' : 'prismjs';
1225
+ var preProps = useInlineStyles ? Object.assign({}, rest, {
1226
+ style: Object.assign({}, defaultPreStyle, customStyle)
1227
+ }) : Object.assign({}, rest, {
1228
+ className: rest.className ? "".concat(generatorClassName, " ").concat(rest.className) : generatorClassName,
1229
+ style: Object.assign({}, customStyle)
1230
+ });
1231
+
1232
+ if (wrapLongLines) {
1233
+ codeTagProps.style = _objectSpread(_objectSpread({}, codeTagProps.style), {}, {
1234
+ whiteSpace: 'pre-wrap'
1235
+ });
1236
+ } else {
1237
+ codeTagProps.style = _objectSpread(_objectSpread({}, codeTagProps.style), {}, {
1238
+ whiteSpace: 'pre'
1239
+ });
1240
+ }
1241
+
1242
+ if (!astGenerator) {
1243
+ return /*#__PURE__*/React.createElement(PreTag, preProps, allLineNumbers, /*#__PURE__*/React.createElement(CodeTag, codeTagProps, code));
1244
+ }
1245
+ /*
1246
+ * Some custom renderers rely on individual row elements so we need to turn wrapLines on
1247
+ * if renderer is provided and wrapLines is undefined.
1248
+ */
1249
+
1250
+
1251
+ if (wrapLines === undefined && renderer || wrapLongLines) wrapLines = true;
1252
+ renderer = renderer || defaultRenderer;
1253
+ var defaultCodeValue = [{
1254
+ type: 'text',
1255
+ value: code
1256
+ }];
1257
+ var codeTree = getCodeTree({
1258
+ astGenerator: astGenerator,
1259
+ language: language,
1260
+ code: code,
1261
+ defaultCodeValue: defaultCodeValue
1262
+ });
1263
+
1264
+ if (codeTree.language === null) {
1265
+ codeTree.value = defaultCodeValue;
1266
+ } // determine largest line number so that we can force minWidth on all linenumber elements
1267
+
1268
+
1269
+ var largestLineNumber = codeTree.value.length + startingLineNumber;
1270
+ var rows = processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines);
1271
+ return /*#__PURE__*/React.createElement(PreTag, preProps, /*#__PURE__*/React.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
1272
+ rows: rows,
1273
+ stylesheet: style,
1274
+ useInlineStyles: useInlineStyles
1275
+ })));
1276
+ };
1277
+ }
1278
+
1279
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1280
+ try {
1281
+ var info = gen[key](arg);
1282
+ var value = info.value;
1283
+ } catch (error) {
1284
+ reject(error);
1285
+ return;
1286
+ }
1287
+ if (info.done) {
1288
+ resolve(value);
1289
+ } else {
1290
+ Promise.resolve(value).then(_next, _throw);
1291
+ }
1292
+ }
1293
+ function _asyncToGenerator(fn) {
1294
+ return function () {
1295
+ var self = this,
1296
+ args = arguments;
1297
+ return new Promise(function (resolve, reject) {
1298
+ var gen = fn.apply(self, args);
1299
+ function _next(value) {
1300
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1301
+ }
1302
+ function _throw(err) {
1303
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1304
+ }
1305
+ _next(undefined);
1306
+ });
1307
+ };
1308
+ }
1309
+
1310
+ function _classCallCheck(instance, Constructor) {
1311
+ if (!(instance instanceof Constructor)) {
1312
+ throw new TypeError("Cannot call a class as a function");
1313
+ }
1314
+ }
1315
+
1316
+ function _defineProperties(target, props) {
1317
+ for (var i = 0; i < props.length; i++) {
1318
+ var descriptor = props[i];
1319
+ descriptor.enumerable = descriptor.enumerable || false;
1320
+ descriptor.configurable = true;
1321
+ if ("value" in descriptor) descriptor.writable = true;
1322
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
1323
+ }
1324
+ }
1325
+ function _createClass(Constructor, protoProps, staticProps) {
1326
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1327
+ if (staticProps) _defineProperties(Constructor, staticProps);
1328
+ Object.defineProperty(Constructor, "prototype", {
1329
+ writable: false
1330
+ });
1331
+ return Constructor;
1332
+ }
1333
+
1334
+ function _setPrototypeOf(o, p) {
1335
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1336
+ o.__proto__ = p;
1337
+ return o;
1338
+ };
1339
+ return _setPrototypeOf(o, p);
1340
+ }
1341
+
1342
+ function _inherits(subClass, superClass) {
1343
+ if (typeof superClass !== "function" && superClass !== null) {
1344
+ throw new TypeError("Super expression must either be null or a function");
1345
+ }
1346
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1347
+ constructor: {
1348
+ value: subClass,
1349
+ writable: true,
1350
+ configurable: true
1351
+ }
1352
+ });
1353
+ Object.defineProperty(subClass, "prototype", {
1354
+ writable: false
1355
+ });
1356
+ if (superClass) _setPrototypeOf(subClass, superClass);
1357
+ }
1358
+
1359
+ function _assertThisInitialized(self) {
1360
+ if (self === void 0) {
1361
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1362
+ }
1363
+ return self;
1364
+ }
1365
+
1366
+ function _possibleConstructorReturn(self, call) {
1367
+ if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
1368
+ return call;
1369
+ } else if (call !== void 0) {
1370
+ throw new TypeError("Derived constructors may only return object or undefined");
1371
+ }
1372
+ return _assertThisInitialized(self);
1373
+ }
1374
+
1375
+ function _getPrototypeOf(o) {
1376
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
1377
+ return o.__proto__ || Object.getPrototypeOf(o);
1378
+ };
1379
+ return _getPrototypeOf(o);
1380
+ }
1381
+
1382
+ var regeneratorRuntime$1 = {exports: {}};
1383
+
1384
+ var _typeof = {exports: {}};
1385
+
1386
+ (function (module) {
1387
+ function _typeof(obj) {
1388
+ "@babel/helpers - typeof";
1389
+
1390
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1391
+ return typeof obj;
1392
+ } : function (obj) {
1393
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1394
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
1395
+ }
1396
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1397
+ }(_typeof));
1398
+
1399
+ (function (module) {
1400
+ var _typeof$1 = _typeof.exports["default"];
1401
+ function _regeneratorRuntime() {
1402
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
1403
+ return exports;
1404
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
1405
+ var exports = {},
1406
+ Op = Object.prototype,
1407
+ hasOwn = Op.hasOwnProperty,
1408
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
1409
+ obj[key] = desc.value;
1410
+ },
1411
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
1412
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
1413
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
1414
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1415
+ function define(obj, key, value) {
1416
+ return Object.defineProperty(obj, key, {
1417
+ value: value,
1418
+ enumerable: !0,
1419
+ configurable: !0,
1420
+ writable: !0
1421
+ }), obj[key];
1422
+ }
1423
+ try {
1424
+ define({}, "");
1425
+ } catch (err) {
1426
+ define = function define(obj, key, value) {
1427
+ return obj[key] = value;
1428
+ };
1429
+ }
1430
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1431
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
1432
+ generator = Object.create(protoGenerator.prototype),
1433
+ context = new Context(tryLocsList || []);
1434
+ return defineProperty(generator, "_invoke", {
1435
+ value: makeInvokeMethod(innerFn, self, context)
1436
+ }), generator;
1437
+ }
1438
+ function tryCatch(fn, obj, arg) {
1439
+ try {
1440
+ return {
1441
+ type: "normal",
1442
+ arg: fn.call(obj, arg)
1443
+ };
1444
+ } catch (err) {
1445
+ return {
1446
+ type: "throw",
1447
+ arg: err
1448
+ };
1449
+ }
1450
+ }
1451
+ exports.wrap = wrap;
1452
+ var ContinueSentinel = {};
1453
+ function Generator() {}
1454
+ function GeneratorFunction() {}
1455
+ function GeneratorFunctionPrototype() {}
1456
+ var IteratorPrototype = {};
1457
+ define(IteratorPrototype, iteratorSymbol, function () {
1458
+ return this;
1459
+ });
1460
+ var getProto = Object.getPrototypeOf,
1461
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1462
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
1463
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
1464
+ function defineIteratorMethods(prototype) {
1465
+ ["next", "throw", "return"].forEach(function (method) {
1466
+ define(prototype, method, function (arg) {
1467
+ return this._invoke(method, arg);
1468
+ });
1469
+ });
1470
+ }
1471
+ function AsyncIterator(generator, PromiseImpl) {
1472
+ function invoke(method, arg, resolve, reject) {
1473
+ var record = tryCatch(generator[method], generator, arg);
1474
+ if ("throw" !== record.type) {
1475
+ var result = record.arg,
1476
+ value = result.value;
1477
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
1478
+ invoke("next", value, resolve, reject);
1479
+ }, function (err) {
1480
+ invoke("throw", err, resolve, reject);
1481
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
1482
+ result.value = unwrapped, resolve(result);
1483
+ }, function (error) {
1484
+ return invoke("throw", error, resolve, reject);
1485
+ });
1486
+ }
1487
+ reject(record.arg);
1488
+ }
1489
+ var previousPromise;
1490
+ defineProperty(this, "_invoke", {
1491
+ value: function value(method, arg) {
1492
+ function callInvokeWithMethodAndArg() {
1493
+ return new PromiseImpl(function (resolve, reject) {
1494
+ invoke(method, arg, resolve, reject);
1495
+ });
1496
+ }
1497
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1498
+ }
1499
+ });
1500
+ }
1501
+ function makeInvokeMethod(innerFn, self, context) {
1502
+ var state = "suspendedStart";
1503
+ return function (method, arg) {
1504
+ if ("executing" === state) throw new Error("Generator is already running");
1505
+ if ("completed" === state) {
1506
+ if ("throw" === method) throw arg;
1507
+ return doneResult();
1508
+ }
1509
+ for (context.method = method, context.arg = arg;;) {
1510
+ var delegate = context.delegate;
1511
+ if (delegate) {
1512
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1513
+ if (delegateResult) {
1514
+ if (delegateResult === ContinueSentinel) continue;
1515
+ return delegateResult;
1516
+ }
1517
+ }
1518
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
1519
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
1520
+ context.dispatchException(context.arg);
1521
+ } else "return" === context.method && context.abrupt("return", context.arg);
1522
+ state = "executing";
1523
+ var record = tryCatch(innerFn, self, context);
1524
+ if ("normal" === record.type) {
1525
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
1526
+ return {
1527
+ value: record.arg,
1528
+ done: context.done
1529
+ };
1530
+ }
1531
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
1532
+ }
1533
+ };
1534
+ }
1535
+ function maybeInvokeDelegate(delegate, context) {
1536
+ var methodName = context.method,
1537
+ method = delegate.iterator[methodName];
1538
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
1539
+ var record = tryCatch(method, delegate.iterator, context.arg);
1540
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
1541
+ var info = record.arg;
1542
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
1543
+ }
1544
+ function pushTryEntry(locs) {
1545
+ var entry = {
1546
+ tryLoc: locs[0]
1547
+ };
1548
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
1549
+ }
1550
+ function resetTryEntry(entry) {
1551
+ var record = entry.completion || {};
1552
+ record.type = "normal", delete record.arg, entry.completion = record;
1553
+ }
1554
+ function Context(tryLocsList) {
1555
+ this.tryEntries = [{
1556
+ tryLoc: "root"
1557
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
1558
+ }
1559
+ function values(iterable) {
1560
+ if (iterable) {
1561
+ var iteratorMethod = iterable[iteratorSymbol];
1562
+ if (iteratorMethod) return iteratorMethod.call(iterable);
1563
+ if ("function" == typeof iterable.next) return iterable;
1564
+ if (!isNaN(iterable.length)) {
1565
+ var i = -1,
1566
+ next = function next() {
1567
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
1568
+ return next.value = undefined, next.done = !0, next;
1569
+ };
1570
+ return next.next = next;
1571
+ }
1572
+ }
1573
+ return {
1574
+ next: doneResult
1575
+ };
1576
+ }
1577
+ function doneResult() {
1578
+ return {
1579
+ value: undefined,
1580
+ done: !0
1581
+ };
1582
+ }
1583
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
1584
+ value: GeneratorFunctionPrototype,
1585
+ configurable: !0
1586
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
1587
+ value: GeneratorFunction,
1588
+ configurable: !0
1589
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
1590
+ var ctor = "function" == typeof genFun && genFun.constructor;
1591
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
1592
+ }, exports.mark = function (genFun) {
1593
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
1594
+ }, exports.awrap = function (arg) {
1595
+ return {
1596
+ __await: arg
1597
+ };
1598
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1599
+ return this;
1600
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1601
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
1602
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
1603
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
1604
+ return result.done ? result.value : iter.next();
1605
+ });
1606
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
1607
+ return this;
1608
+ }), define(Gp, "toString", function () {
1609
+ return "[object Generator]";
1610
+ }), exports.keys = function (val) {
1611
+ var object = Object(val),
1612
+ keys = [];
1613
+ for (var key in object) keys.push(key);
1614
+ return keys.reverse(), function next() {
1615
+ for (; keys.length;) {
1616
+ var key = keys.pop();
1617
+ if (key in object) return next.value = key, next.done = !1, next;
1618
+ }
1619
+ return next.done = !0, next;
1620
+ };
1621
+ }, exports.values = values, Context.prototype = {
1622
+ constructor: Context,
1623
+ reset: function reset(skipTempReset) {
1624
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
1625
+ },
1626
+ stop: function stop() {
1627
+ this.done = !0;
1628
+ var rootRecord = this.tryEntries[0].completion;
1629
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
1630
+ return this.rval;
1631
+ },
1632
+ dispatchException: function dispatchException(exception) {
1633
+ if (this.done) throw exception;
1634
+ var context = this;
1635
+ function handle(loc, caught) {
1636
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
1637
+ }
1638
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1639
+ var entry = this.tryEntries[i],
1640
+ record = entry.completion;
1641
+ if ("root" === entry.tryLoc) return handle("end");
1642
+ if (entry.tryLoc <= this.prev) {
1643
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
1644
+ hasFinally = hasOwn.call(entry, "finallyLoc");
1645
+ if (hasCatch && hasFinally) {
1646
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1647
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1648
+ } else if (hasCatch) {
1649
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1650
+ } else {
1651
+ if (!hasFinally) throw new Error("try statement without catch or finally");
1652
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1653
+ }
1654
+ }
1655
+ }
1656
+ },
1657
+ abrupt: function abrupt(type, arg) {
1658
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1659
+ var entry = this.tryEntries[i];
1660
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1661
+ var finallyEntry = entry;
1662
+ break;
1663
+ }
1664
+ }
1665
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
1666
+ var record = finallyEntry ? finallyEntry.completion : {};
1667
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
1668
+ },
1669
+ complete: function complete(record, afterLoc) {
1670
+ if ("throw" === record.type) throw record.arg;
1671
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
1672
+ },
1673
+ finish: function finish(finallyLoc) {
1674
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1675
+ var entry = this.tryEntries[i];
1676
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
1677
+ }
1678
+ },
1679
+ "catch": function _catch(tryLoc) {
1680
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1681
+ var entry = this.tryEntries[i];
1682
+ if (entry.tryLoc === tryLoc) {
1683
+ var record = entry.completion;
1684
+ if ("throw" === record.type) {
1685
+ var thrown = record.arg;
1686
+ resetTryEntry(entry);
1687
+ }
1688
+ return thrown;
1689
+ }
1690
+ }
1691
+ throw new Error("illegal catch attempt");
1692
+ },
1693
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1694
+ return this.delegate = {
1695
+ iterator: values(iterable),
1696
+ resultName: resultName,
1697
+ nextLoc: nextLoc
1698
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
1699
+ }
1700
+ }, exports;
1701
+ }
1702
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
1703
+ }(regeneratorRuntime$1));
1704
+
1705
+ // TODO(Babel 8): Remove this file.
1706
+
1707
+ var runtime = regeneratorRuntime$1.exports();
1708
+ var regenerator = runtime;
1709
+
1710
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
1711
+ try {
1712
+ regeneratorRuntime = runtime;
1713
+ } catch (accidentalStrictMode) {
1714
+ if (typeof globalThis === "object") {
1715
+ globalThis.regeneratorRuntime = runtime;
1716
+ } else {
1717
+ Function("r", "regeneratorRuntime = r")(runtime);
1718
+ }
1719
+ }
1720
+
1721
+ var _regeneratorRuntime = regenerator;
1722
+
1723
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1724
+
1725
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1726
+ var createAsyncLoadingHighlighter = (function (options) {
1727
+ var loader = options.loader,
1728
+ isLanguageRegistered = options.isLanguageRegistered,
1729
+ registerLanguage = options.registerLanguage,
1730
+ languageLoaders = options.languageLoaders,
1731
+ noAsyncLoadingLanguages = options.noAsyncLoadingLanguages;
1732
+
1733
+ var ReactAsyncHighlighter = /*#__PURE__*/function (_React$PureComponent) {
1734
+ _inherits(ReactAsyncHighlighter, _React$PureComponent);
1735
+
1736
+ var _super = _createSuper(ReactAsyncHighlighter);
1737
+
1738
+ function ReactAsyncHighlighter() {
1739
+ _classCallCheck(this, ReactAsyncHighlighter);
1740
+
1741
+ return _super.apply(this, arguments);
1742
+ }
1743
+
1744
+ _createClass(ReactAsyncHighlighter, [{
1745
+ key: "componentDidUpdate",
1746
+ value: function componentDidUpdate() {
1747
+ if (!ReactAsyncHighlighter.isRegistered(this.props.language) && languageLoaders) {
1748
+ this.loadLanguage();
1749
+ }
1750
+ }
1751
+ }, {
1752
+ key: "componentDidMount",
1753
+ value: function componentDidMount() {
1754
+ var _this = this;
1755
+
1756
+ if (!ReactAsyncHighlighter.astGeneratorPromise) {
1757
+ ReactAsyncHighlighter.loadAstGenerator();
1758
+ }
1759
+
1760
+ if (!ReactAsyncHighlighter.astGenerator) {
1761
+ ReactAsyncHighlighter.astGeneratorPromise.then(function () {
1762
+ _this.forceUpdate();
1763
+ });
1764
+ }
1765
+
1766
+ if (!ReactAsyncHighlighter.isRegistered(this.props.language) && languageLoaders) {
1767
+ this.loadLanguage();
1768
+ }
1769
+ }
1770
+ }, {
1771
+ key: "loadLanguage",
1772
+ value: function loadLanguage() {
1773
+ var _this2 = this;
1774
+
1775
+ var language = this.props.language;
1776
+
1777
+ if (language === 'text') {
1778
+ return;
1779
+ }
1780
+
1781
+ ReactAsyncHighlighter.loadLanguage(language).then(function () {
1782
+ return _this2.forceUpdate();
1783
+ })["catch"](function () {});
1784
+ }
1785
+ }, {
1786
+ key: "normalizeLanguage",
1787
+ value: function normalizeLanguage(language) {
1788
+ return ReactAsyncHighlighter.isSupportedLanguage(language) ? language : 'text';
1789
+ }
1790
+ }, {
1791
+ key: "render",
1792
+ value: function render() {
1793
+ return /*#__PURE__*/React.createElement(ReactAsyncHighlighter.highlightInstance, _extends({}, this.props, {
1794
+ language: this.normalizeLanguage(this.props.language),
1795
+ astGenerator: ReactAsyncHighlighter.astGenerator
1796
+ }));
1797
+ }
1798
+ }], [{
1799
+ key: "preload",
1800
+ value: function preload() {
1801
+ return ReactAsyncHighlighter.loadAstGenerator();
1802
+ }
1803
+ }, {
1804
+ key: "loadLanguage",
1805
+ value: function () {
1806
+ var _loadLanguage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(language) {
1807
+ var languageLoader;
1808
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1809
+ while (1) {
1810
+ switch (_context.prev = _context.next) {
1811
+ case 0:
1812
+ languageLoader = languageLoaders[language];
1813
+
1814
+ if (!(typeof languageLoader === 'function')) {
1815
+ _context.next = 5;
1816
+ break;
1817
+ }
1818
+
1819
+ return _context.abrupt("return", languageLoader(ReactAsyncHighlighter.registerLanguage));
1820
+
1821
+ case 5:
1822
+ throw new Error("Language ".concat(language, " not supported"));
1823
+
1824
+ case 6:
1825
+ case "end":
1826
+ return _context.stop();
1827
+ }
1828
+ }
1829
+ }, _callee);
1830
+ }));
1831
+
1832
+ function loadLanguage(_x) {
1833
+ return _loadLanguage.apply(this, arguments);
1834
+ }
1835
+
1836
+ return loadLanguage;
1837
+ }()
1838
+ }, {
1839
+ key: "isSupportedLanguage",
1840
+ value: function isSupportedLanguage(language) {
1841
+ return ReactAsyncHighlighter.isRegistered(language) || typeof languageLoaders[language] === 'function';
1842
+ }
1843
+ }, {
1844
+ key: "loadAstGenerator",
1845
+ value: function loadAstGenerator() {
1846
+ ReactAsyncHighlighter.astGeneratorPromise = loader().then(function (astGenerator) {
1847
+ ReactAsyncHighlighter.astGenerator = astGenerator;
1848
+
1849
+ if (registerLanguage) {
1850
+ ReactAsyncHighlighter.languages.forEach(function (language, name) {
1851
+ return registerLanguage(astGenerator, name, language);
1852
+ });
1853
+ }
1854
+ });
1855
+ return ReactAsyncHighlighter.astGeneratorPromise;
1856
+ }
1857
+ }]);
1858
+
1859
+ return ReactAsyncHighlighter;
1860
+ }(React.PureComponent);
1861
+
1862
+ _defineProperty(ReactAsyncHighlighter, "astGenerator", null);
1863
+
1864
+ _defineProperty(ReactAsyncHighlighter, "highlightInstance", highlight(null, {}));
1865
+
1866
+ _defineProperty(ReactAsyncHighlighter, "astGeneratorPromise", null);
1867
+
1868
+ _defineProperty(ReactAsyncHighlighter, "languages", new Map());
1869
+
1870
+ _defineProperty(ReactAsyncHighlighter, "supportedLanguages", options.supportedLanguages || Object.keys(languageLoaders || {}));
1871
+
1872
+ _defineProperty(ReactAsyncHighlighter, "isRegistered", function (language) {
1873
+ if (noAsyncLoadingLanguages) {
1874
+ return true;
1875
+ }
1876
+
1877
+ if (!registerLanguage) {
1878
+ throw new Error("Current syntax highlighter doesn't support registration of languages");
1879
+ }
1880
+
1881
+ if (!ReactAsyncHighlighter.astGenerator) {
1882
+ // Ast generator not available yet, but language will be registered once it is.
1883
+ return ReactAsyncHighlighter.languages.has(language);
1884
+ }
1885
+
1886
+ return isLanguageRegistered(ReactAsyncHighlighter.astGenerator, language);
1887
+ });
1888
+
1889
+ _defineProperty(ReactAsyncHighlighter, "registerLanguage", function (name, language) {
1890
+ if (!registerLanguage) {
1891
+ throw new Error("Current syntax highlighter doesn't support registration of languages");
1892
+ }
1893
+
1894
+ if (ReactAsyncHighlighter.astGenerator) {
1895
+ return registerLanguage(ReactAsyncHighlighter.astGenerator, name, language);
1896
+ } else {
1897
+ ReactAsyncHighlighter.languages.set(name, language);
1898
+ }
1899
+ });
1900
+
1901
+ return ReactAsyncHighlighter;
1902
+ });
1903
+
1904
+ //
1905
+ // This file has been auto-generated by the `npm run build-languages-prism` task
1906
+ //
1907
+ var supportedLanguages = ['abap', 'abnf', 'actionscript', 'ada', 'agda', 'al', 'antlr4', 'apacheconf', 'apex', 'apl', 'applescript', 'aql', 'arduino', 'arff', 'asciidoc', 'asm6502', 'asmatmel', 'aspnet', 'autohotkey', 'autoit', 'avisynth', 'avro-idl', 'bash', 'basic', 'batch', 'bbcode', 'bicep', 'birb', 'bison', 'bnf', 'brainfuck', 'brightscript', 'bro', 'bsl', 'c', 'cfscript', 'chaiscript', 'cil', 'clike', 'clojure', 'cmake', 'cobol', 'coffeescript', 'concurnas', 'coq', 'cpp', 'crystal', 'csharp', 'cshtml', 'csp', 'css-extras', 'css', 'csv', 'cypher', 'd', 'dart', 'dataweave', 'dax', 'dhall', 'diff', 'django', 'dns-zone-file', 'docker', 'dot', 'ebnf', 'editorconfig', 'eiffel', 'ejs', 'elixir', 'elm', 'erb', 'erlang', 'etlua', 'excel-formula', 'factor', 'false', 'firestore-security-rules', 'flow', 'fortran', 'fsharp', 'ftl', 'gap', 'gcode', 'gdscript', 'gedcom', 'gherkin', 'git', 'glsl', 'gml', 'gn', 'go-module', 'go', 'graphql', 'groovy', 'haml', 'handlebars', 'haskell', 'haxe', 'hcl', 'hlsl', 'hoon', 'hpkp', 'hsts', 'http', 'ichigojam', 'icon', 'icu-message-format', 'idris', 'iecst', 'ignore', 'inform7', 'ini', 'io', 'j', 'java', 'javadoc', 'javadoclike', 'javascript', 'javastacktrace', 'jexl', 'jolie', 'jq', 'js-extras', 'js-templates', 'jsdoc', 'json', 'json5', 'jsonp', 'jsstacktrace', 'jsx', 'julia', 'keepalived', 'keyman', 'kotlin', 'kumir', 'kusto', 'latex', 'latte', 'less', 'lilypond', 'liquid', 'lisp', 'livescript', 'llvm', 'log', 'lolcode', 'lua', 'magma', 'makefile', 'markdown', 'markup-templating', 'markup', 'matlab', 'maxscript', 'mel', 'mermaid', 'mizar', 'mongodb', 'monkey', 'moonscript', 'n1ql', 'n4js', 'nand2tetris-hdl', 'naniscript', 'nasm', 'neon', 'nevod', 'nginx', 'nim', 'nix', 'nsis', 'objectivec', 'ocaml', 'opencl', 'openqasm', 'oz', 'parigp', 'parser', 'pascal', 'pascaligo', 'pcaxis', 'peoplecode', 'perl', 'php-extras', 'php', 'phpdoc', 'plsql', 'powerquery', 'powershell', 'processing', 'prolog', 'promql', 'properties', 'protobuf', 'psl', 'pug', 'puppet', 'pure', 'purebasic', 'purescript', 'python', 'q', 'qml', 'qore', 'qsharp', 'r', 'racket', 'reason', 'regex', 'rego', 'renpy', 'rest', 'rip', 'roboconf', 'robotframework', 'ruby', 'rust', 'sas', 'sass', 'scala', 'scheme', 'scss', 'shell-session', 'smali', 'smalltalk', 'smarty', 'sml', 'solidity', 'solution-file', 'soy', 'sparql', 'splunk-spl', 'sqf', 'sql', 'squirrel', 'stan', 'stylus', 'swift', 'systemd', 't4-cs', 't4-templating', 't4-vb', 'tap', 'tcl', 'textile', 'toml', 'tremor', 'tsx', 'tt2', 'turtle', 'twig', 'typescript', 'typoscript', 'unrealscript', 'uorazor', 'uri', 'v', 'vala', 'vbnet', 'velocity', 'verilog', 'vhdl', 'vim', 'visual-basic', 'warpscript', 'wasm', 'web-idl', 'wiki', 'wolfram', 'wren', 'xeora', 'xml-doc', 'xojo', 'xquery', 'yaml', 'yang', 'zig'];
1908
+
1909
+ var SyntaxHighlighter = createAsyncLoadingHighlighter({
1910
+ loader: function loader() {
1911
+ return import(
1912
+ /* webpackChunkName:"react-syntax-highlighter/refractor-import" */
1913
+ './index-a1accecb.js').then(function (n) { return n.i; }).then(function (module) {
1914
+ // Webpack 3 returns module.exports as default as module, but webpack 4 returns module.exports as module.default
1915
+ return module["default"] || module;
1916
+ });
1917
+ },
1918
+ noAsyncLoadingLanguages: true,
1919
+ supportedLanguages: supportedLanguages
1920
+ });
1921
+
1922
+ var vscDarkPlus = {
1923
+ "pre[class*=\"language-\"]": {
1924
+ "color": "#d4d4d4",
1925
+ "fontSize": "13px",
1926
+ "textShadow": "none",
1927
+ "fontFamily": "Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace",
1928
+ "direction": "ltr",
1929
+ "textAlign": "left",
1930
+ "whiteSpace": "pre",
1931
+ "wordSpacing": "normal",
1932
+ "wordBreak": "normal",
1933
+ "lineHeight": "1.5",
1934
+ "MozTabSize": "4",
1935
+ "OTabSize": "4",
1936
+ "tabSize": "4",
1937
+ "WebkitHyphens": "none",
1938
+ "MozHyphens": "none",
1939
+ "msHyphens": "none",
1940
+ "hyphens": "none",
1941
+ "padding": "1em",
1942
+ "margin": ".5em 0",
1943
+ "overflow": "auto",
1944
+ "background": "#1e1e1e"
1945
+ },
1946
+ "code[class*=\"language-\"]": {
1947
+ "color": "#d4d4d4",
1948
+ "fontSize": "13px",
1949
+ "textShadow": "none",
1950
+ "fontFamily": "Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace",
1951
+ "direction": "ltr",
1952
+ "textAlign": "left",
1953
+ "whiteSpace": "pre",
1954
+ "wordSpacing": "normal",
1955
+ "wordBreak": "normal",
1956
+ "lineHeight": "1.5",
1957
+ "MozTabSize": "4",
1958
+ "OTabSize": "4",
1959
+ "tabSize": "4",
1960
+ "WebkitHyphens": "none",
1961
+ "MozHyphens": "none",
1962
+ "msHyphens": "none",
1963
+ "hyphens": "none"
1964
+ },
1965
+ "pre[class*=\"language-\"]::selection": {
1966
+ "textShadow": "none",
1967
+ "background": "#264F78"
1968
+ },
1969
+ "code[class*=\"language-\"]::selection": {
1970
+ "textShadow": "none",
1971
+ "background": "#264F78"
1972
+ },
1973
+ "pre[class*=\"language-\"] *::selection": {
1974
+ "textShadow": "none",
1975
+ "background": "#264F78"
1976
+ },
1977
+ "code[class*=\"language-\"] *::selection": {
1978
+ "textShadow": "none",
1979
+ "background": "#264F78"
1980
+ },
1981
+ ":not(pre) > code[class*=\"language-\"]": {
1982
+ "padding": ".1em .3em",
1983
+ "borderRadius": ".3em",
1984
+ "color": "#db4c69",
1985
+ "background": "#1e1e1e"
1986
+ },
1987
+ ".namespace": {
1988
+ "Opacity": ".7"
1989
+ },
1990
+ "doctype.doctype-tag": {
1991
+ "color": "#569CD6"
1992
+ },
1993
+ "doctype.name": {
1994
+ "color": "#9cdcfe"
1995
+ },
1996
+ "comment": {
1997
+ "color": "#6a9955"
1998
+ },
1999
+ "prolog": {
2000
+ "color": "#6a9955"
2001
+ },
2002
+ "punctuation": {
2003
+ "color": "#d4d4d4"
2004
+ },
2005
+ ".language-html .language-css .token.punctuation": {
2006
+ "color": "#d4d4d4"
2007
+ },
2008
+ ".language-html .language-javascript .token.punctuation": {
2009
+ "color": "#d4d4d4"
2010
+ },
2011
+ "property": {
2012
+ "color": "#9cdcfe"
2013
+ },
2014
+ "tag": {
2015
+ "color": "#569cd6"
2016
+ },
2017
+ "boolean": {
2018
+ "color": "#569cd6"
2019
+ },
2020
+ "number": {
2021
+ "color": "#b5cea8"
2022
+ },
2023
+ "constant": {
2024
+ "color": "#9cdcfe"
2025
+ },
2026
+ "symbol": {
2027
+ "color": "#b5cea8"
2028
+ },
2029
+ "inserted": {
2030
+ "color": "#b5cea8"
2031
+ },
2032
+ "unit": {
2033
+ "color": "#b5cea8"
2034
+ },
2035
+ "selector": {
2036
+ "color": "#d7ba7d"
2037
+ },
2038
+ "attr-name": {
2039
+ "color": "#9cdcfe"
2040
+ },
2041
+ "string": {
2042
+ "color": "#ce9178"
2043
+ },
2044
+ "char": {
2045
+ "color": "#ce9178"
2046
+ },
2047
+ "builtin": {
2048
+ "color": "#ce9178"
2049
+ },
2050
+ "deleted": {
2051
+ "color": "#ce9178"
2052
+ },
2053
+ ".language-css .token.string.url": {
2054
+ "textDecoration": "underline"
2055
+ },
2056
+ "operator": {
2057
+ "color": "#d4d4d4"
2058
+ },
2059
+ "entity": {
2060
+ "color": "#569cd6"
2061
+ },
2062
+ "operator.arrow": {
2063
+ "color": "#569CD6"
2064
+ },
2065
+ "atrule": {
2066
+ "color": "#ce9178"
2067
+ },
2068
+ "atrule.rule": {
2069
+ "color": "#c586c0"
2070
+ },
2071
+ "atrule.url": {
2072
+ "color": "#9cdcfe"
2073
+ },
2074
+ "atrule.url.function": {
2075
+ "color": "#dcdcaa"
2076
+ },
2077
+ "atrule.url.punctuation": {
2078
+ "color": "#d4d4d4"
2079
+ },
2080
+ "keyword": {
2081
+ "color": "#569CD6"
2082
+ },
2083
+ "keyword.module": {
2084
+ "color": "#c586c0"
2085
+ },
2086
+ "keyword.control-flow": {
2087
+ "color": "#c586c0"
2088
+ },
2089
+ "function": {
2090
+ "color": "#dcdcaa"
2091
+ },
2092
+ "function.maybe-class-name": {
2093
+ "color": "#dcdcaa"
2094
+ },
2095
+ "regex": {
2096
+ "color": "#d16969"
2097
+ },
2098
+ "important": {
2099
+ "color": "#569cd6"
2100
+ },
2101
+ "italic": {
2102
+ "fontStyle": "italic"
2103
+ },
2104
+ "class-name": {
2105
+ "color": "#4ec9b0"
2106
+ },
2107
+ "maybe-class-name": {
2108
+ "color": "#4ec9b0"
2109
+ },
2110
+ "console": {
2111
+ "color": "#9cdcfe"
2112
+ },
2113
+ "parameter": {
2114
+ "color": "#9cdcfe"
2115
+ },
2116
+ "interpolation": {
2117
+ "color": "#9cdcfe"
2118
+ },
2119
+ "punctuation.interpolation-punctuation": {
2120
+ "color": "#569cd6"
2121
+ },
2122
+ "variable": {
2123
+ "color": "#9cdcfe"
2124
+ },
2125
+ "imports.maybe-class-name": {
2126
+ "color": "#9cdcfe"
2127
+ },
2128
+ "exports.maybe-class-name": {
2129
+ "color": "#9cdcfe"
2130
+ },
2131
+ "escape": {
2132
+ "color": "#d7ba7d"
2133
+ },
2134
+ "tag.punctuation": {
2135
+ "color": "#808080"
2136
+ },
2137
+ "cdata": {
2138
+ "color": "#808080"
2139
+ },
2140
+ "attr-value": {
2141
+ "color": "#ce9178"
2142
+ },
2143
+ "attr-value.punctuation": {
2144
+ "color": "#ce9178"
2145
+ },
2146
+ "attr-value.punctuation.attr-equals": {
2147
+ "color": "#d4d4d4"
2148
+ },
2149
+ "namespace": {
2150
+ "color": "#4ec9b0"
2151
+ },
2152
+ "pre[class*=\"language-javascript\"]": {
2153
+ "color": "#9cdcfe"
2154
+ },
2155
+ "code[class*=\"language-javascript\"]": {
2156
+ "color": "#9cdcfe"
2157
+ },
2158
+ "pre[class*=\"language-jsx\"]": {
2159
+ "color": "#9cdcfe"
2160
+ },
2161
+ "code[class*=\"language-jsx\"]": {
2162
+ "color": "#9cdcfe"
2163
+ },
2164
+ "pre[class*=\"language-typescript\"]": {
2165
+ "color": "#9cdcfe"
2166
+ },
2167
+ "code[class*=\"language-typescript\"]": {
2168
+ "color": "#9cdcfe"
2169
+ },
2170
+ "pre[class*=\"language-tsx\"]": {
2171
+ "color": "#9cdcfe"
2172
+ },
2173
+ "code[class*=\"language-tsx\"]": {
2174
+ "color": "#9cdcfe"
2175
+ },
2176
+ "pre[class*=\"language-css\"]": {
2177
+ "color": "#ce9178"
2178
+ },
2179
+ "code[class*=\"language-css\"]": {
2180
+ "color": "#ce9178"
2181
+ },
2182
+ "pre[class*=\"language-html\"]": {
2183
+ "color": "#d4d4d4"
2184
+ },
2185
+ "code[class*=\"language-html\"]": {
2186
+ "color": "#d4d4d4"
2187
+ },
2188
+ ".language-regex .token.anchor": {
2189
+ "color": "#dcdcaa"
2190
+ },
2191
+ ".language-html .token.punctuation": {
2192
+ "color": "#808080"
2193
+ },
2194
+ "pre[class*=\"language-\"] > code[class*=\"language-\"]": {
2195
+ "position": "relative",
2196
+ "zIndex": "1"
2197
+ },
2198
+ ".line-highlight.line-highlight": {
2199
+ "background": "#f7ebc6",
2200
+ "boxShadow": "inset 5px 0 0 #f7d87c",
2201
+ "zIndex": "0"
2202
+ }
2203
+ };
2204
+
2205
+ var css_248z = "/*** \n * Core colors\n ***/\n/*** \n\t* Component-specific properties \n\t***/\n/*** \n\t* Theme definitions\n\t***/\n.fence {\n border-radius: 0;\n margin: 40px 0;\n position: relative;\n}\n.fence.json-editor-fence {\n margin: 1rem 0 0 0 !important;\n height: 80%;\n width: 100%;\n overflow: hidden;\n}\n.fence .fence-header {\n background-color: var(--theme-codefence-header-background-color);\n color: var(--theme-codefence-header-text-color);\n font-size: 14px;\n border-radius: 4px 4px 0px 0px;\n border-bottom: 1px solid var(--theme-codefence-border-color);\n margin: 0;\n padding: 5px 16px;\n min-height: 24px;\n display: flex;\n flex-direction: row-reverse;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n}\n.fence .fence-header.clickable {\n cursor: pointer;\n}\n.fence .fence-header > * {\n flex-grow: 0;\n flex-shrink: 0;\n}\n.fence .fence-header .copy-button {\n font-size: 14px;\n padding: 0;\n color: var(--theme-codefence-header-text-color);\n}\n.fence .fence-header .fence-title {\n flex-grow: 1;\n}\n.fence .fence-header .icon {\n line-height: 0;\n}\n.fence .fence-body {\n padding: 0;\n overflow: auto;\n border-radius: 0 0 4px 4px;\n}\n.fence .fence-body.json-editor-body {\n height: 100%;\n line-height: 21px;\n}\n.fence .fence-body.collapsed {\n max-height: 15px;\n}\n.fence .fence-body.collapsed pre {\n padding-top: 3px;\n}\n.fence .fence-body pre {\n display: block;\n margin: 0 !important;\n padding: 0 !important;\n border-radius: 0 0 4px 4px !important;\n background: var(--theme-codefence-background-color) !important;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n}\n.fence .fence-body pre.json-editor-pre {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n}\n.fence .fence-body pre code {\n background-color: transparent;\n margin: 0 !important;\n padding: 20px !important;\n display: block !important;\n max-height: 600px;\n color: white;\n}\n.fence .fence-body pre code .linenumber {\n min-width: 26px !important;\n}";
2206
+ styleInject(css_248z);
2207
+
2208
+ function CodeFence(props) {
2209
+ const [collapsed, setCollapsed] = useState(props.noCollapse ? false : props.autoCollapse || false);
2210
+ const bodyClassNames = ['fence-body'];
2211
+ if (props.jsonEditor)
2212
+ bodyClassNames.push('json-editor-body');
2213
+ const classNames = ['fence'];
2214
+ if (props.className)
2215
+ classNames.push(props.className);
2216
+ if (props.noCollapse)
2217
+ classNames.push('nocollapse');
2218
+ if (props.indentation)
2219
+ classNames.push(`indent-${props.indentation}`);
2220
+ if (props.jsonEditor)
2221
+ classNames.push('json-editor-fence');
2222
+ return (React.createElement("div", { className: classNames.join(' ') },
2223
+ props.noHeader || typeof props.value !== 'string' ? ('') : (React.createElement("div", { className: `fence-header${props.noCollapse ? '' : ' clickable'}`, onClick: () => setCollapsed(props.noCollapse ? false : !collapsed) },
2224
+ props.noCollapse ? undefined : (React.createElement(GenesysDevIcon, { icon: collapsed ? GenesysDevIcons.AppChevronDown : GenesysDevIcons.AppChevronUp })),
2225
+ React.createElement(CopyButton, { copyText: props.value }),
2226
+ React.createElement("span", { className: "fence-title" }, props.title))),
2227
+ collapsed ? undefined : (React.createElement("div", { ref: props.innerRef || undefined, className: bodyClassNames.join(' ') },
2228
+ React.createElement(SyntaxHighlighter, { language: props.language, style: vscDarkPlus, showLineNumbers: props.showLineNumbers }, props.value)))));
2229
+ }
2230
+
2231
+ export { AlertBlock, CodeFence, CopyButton, DxAccordion, DxAccordionGroup, DxButton, DxCheckbox, DxItemGroup, DxLabel, DxTabPanel, DxTabbedContent, DxTextbox, DxToggle, LoadingPlaceholder, Tooltip };
2232
+ //# sourceMappingURL=index.js.map