9
|
1 |
this["wp"] = this["wp"] || {}; this["wp"]["element"] = |
|
2 |
/******/ (function(modules) { // webpackBootstrap |
|
3 |
/******/ // The module cache |
|
4 |
/******/ var installedModules = {}; |
|
5 |
/******/ |
|
6 |
/******/ // The require function |
|
7 |
/******/ function __webpack_require__(moduleId) { |
|
8 |
/******/ |
|
9 |
/******/ // Check if module is in cache |
|
10 |
/******/ if(installedModules[moduleId]) { |
|
11 |
/******/ return installedModules[moduleId].exports; |
|
12 |
/******/ } |
|
13 |
/******/ // Create a new module (and put it into the cache) |
|
14 |
/******/ var module = installedModules[moduleId] = { |
|
15 |
/******/ i: moduleId, |
|
16 |
/******/ l: false, |
|
17 |
/******/ exports: {} |
|
18 |
/******/ }; |
|
19 |
/******/ |
|
20 |
/******/ // Execute the module function |
|
21 |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|
22 |
/******/ |
|
23 |
/******/ // Flag the module as loaded |
|
24 |
/******/ module.l = true; |
|
25 |
/******/ |
|
26 |
/******/ // Return the exports of the module |
|
27 |
/******/ return module.exports; |
|
28 |
/******/ } |
|
29 |
/******/ |
|
30 |
/******/ |
|
31 |
/******/ // expose the modules object (__webpack_modules__) |
|
32 |
/******/ __webpack_require__.m = modules; |
|
33 |
/******/ |
|
34 |
/******/ // expose the module cache |
|
35 |
/******/ __webpack_require__.c = installedModules; |
|
36 |
/******/ |
|
37 |
/******/ // define getter function for harmony exports |
|
38 |
/******/ __webpack_require__.d = function(exports, name, getter) { |
|
39 |
/******/ if(!__webpack_require__.o(exports, name)) { |
|
40 |
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
41 |
/******/ } |
|
42 |
/******/ }; |
|
43 |
/******/ |
|
44 |
/******/ // define __esModule on exports |
|
45 |
/******/ __webpack_require__.r = function(exports) { |
|
46 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
47 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
48 |
/******/ } |
|
49 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
50 |
/******/ }; |
|
51 |
/******/ |
|
52 |
/******/ // create a fake namespace object |
|
53 |
/******/ // mode & 1: value is a module id, require it |
|
54 |
/******/ // mode & 2: merge all properties of value into the ns |
|
55 |
/******/ // mode & 4: return value when already ns object |
|
56 |
/******/ // mode & 8|1: behave like require |
|
57 |
/******/ __webpack_require__.t = function(value, mode) { |
|
58 |
/******/ if(mode & 1) value = __webpack_require__(value); |
|
59 |
/******/ if(mode & 8) return value; |
|
60 |
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
61 |
/******/ var ns = Object.create(null); |
|
62 |
/******/ __webpack_require__.r(ns); |
|
63 |
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
64 |
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
65 |
/******/ return ns; |
|
66 |
/******/ }; |
|
67 |
/******/ |
|
68 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
|
69 |
/******/ __webpack_require__.n = function(module) { |
|
70 |
/******/ var getter = module && module.__esModule ? |
|
71 |
/******/ function getDefault() { return module['default']; } : |
|
72 |
/******/ function getModuleExports() { return module; }; |
|
73 |
/******/ __webpack_require__.d(getter, 'a', getter); |
|
74 |
/******/ return getter; |
|
75 |
/******/ }; |
|
76 |
/******/ |
|
77 |
/******/ // Object.prototype.hasOwnProperty.call |
|
78 |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
79 |
/******/ |
|
80 |
/******/ // __webpack_public_path__ |
|
81 |
/******/ __webpack_require__.p = ""; |
|
82 |
/******/ |
|
83 |
/******/ |
|
84 |
/******/ // Load entry module and return exports |
16
|
85 |
/******/ return __webpack_require__(__webpack_require__.s = 453); |
9
|
86 |
/******/ }) |
|
87 |
/************************************************************************/ |
|
88 |
/******/ ({ |
|
89 |
|
16
|
90 |
/***/ 13: |
|
91 |
/***/ (function(module, exports) { |
|
92 |
|
|
93 |
(function() { module.exports = this["React"]; }()); |
|
94 |
|
|
95 |
/***/ }), |
|
96 |
|
|
97 |
/***/ 14: |
|
98 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
99 |
|
|
100 |
"use strict"; |
|
101 |
|
|
102 |
// EXPORTS |
|
103 |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); |
|
104 |
|
|
105 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
|
106 |
var arrayWithHoles = __webpack_require__(38); |
|
107 |
|
|
108 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
|
109 |
function _iterableToArrayLimit(arr, i) { |
|
110 |
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; |
|
111 |
var _arr = []; |
|
112 |
var _n = true; |
|
113 |
var _d = false; |
|
114 |
var _e = undefined; |
|
115 |
|
|
116 |
try { |
|
117 |
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { |
|
118 |
_arr.push(_s.value); |
|
119 |
|
|
120 |
if (i && _arr.length === i) break; |
|
121 |
} |
|
122 |
} catch (err) { |
|
123 |
_d = true; |
|
124 |
_e = err; |
|
125 |
} finally { |
|
126 |
try { |
|
127 |
if (!_n && _i["return"] != null) _i["return"](); |
|
128 |
} finally { |
|
129 |
if (_d) throw _e; |
|
130 |
} |
|
131 |
} |
|
132 |
|
|
133 |
return _arr; |
|
134 |
} |
|
135 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
136 |
var unsupportedIterableToArray = __webpack_require__(29); |
|
137 |
|
|
138 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
|
139 |
var nonIterableRest = __webpack_require__(39); |
|
140 |
|
|
141 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
function _slicedToArray(arr, i) { |
|
147 |
return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); |
|
148 |
} |
|
149 |
|
|
150 |
/***/ }), |
|
151 |
|
|
152 |
/***/ 144: |
|
153 |
/***/ (function(module, exports) { |
|
154 |
|
|
155 |
(function() { module.exports = this["ReactDOM"]; }()); |
|
156 |
|
|
157 |
/***/ }), |
|
158 |
|
9
|
159 |
/***/ 15: |
|
160 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
161 |
|
|
162 |
"use strict"; |
|
163 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); |
16
|
164 |
/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41); |
9
|
165 |
|
|
166 |
function _objectWithoutProperties(source, excluded) { |
|
167 |
if (source == null) return {}; |
16
|
168 |
var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); |
9
|
169 |
var key, i; |
|
170 |
|
|
171 |
if (Object.getOwnPropertySymbols) { |
|
172 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); |
|
173 |
|
|
174 |
for (i = 0; i < sourceSymbolKeys.length; i++) { |
|
175 |
key = sourceSymbolKeys[i]; |
|
176 |
if (excluded.indexOf(key) >= 0) continue; |
|
177 |
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; |
|
178 |
target[key] = source[key]; |
|
179 |
} |
|
180 |
} |
|
181 |
|
|
182 |
return target; |
|
183 |
} |
|
184 |
|
|
185 |
/***/ }), |
|
186 |
|
16
|
187 |
/***/ 18: |
|
188 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
189 |
|
|
190 |
"use strict"; |
|
191 |
|
|
192 |
// EXPORTS |
|
193 |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); |
|
194 |
|
|
195 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
|
196 |
var arrayLikeToArray = __webpack_require__(26); |
|
197 |
|
|
198 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
|
199 |
|
|
200 |
function _arrayWithoutHoles(arr) { |
|
201 |
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); |
|
202 |
} |
|
203 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
204 |
var iterableToArray = __webpack_require__(35); |
|
205 |
|
|
206 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
207 |
var unsupportedIterableToArray = __webpack_require__(29); |
|
208 |
|
|
209 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
210 |
function _nonIterableSpread() { |
|
211 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
212 |
} |
|
213 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
214 |
|
|
215 |
|
|
216 |
|
|
217 |
|
|
218 |
function _toConsumableArray(arr) { |
|
219 |
return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
|
220 |
} |
|
221 |
|
|
222 |
/***/ }), |
|
223 |
|
|
224 |
/***/ 2: |
9
|
225 |
/***/ (function(module, exports) { |
|
226 |
|
16
|
227 |
(function() { module.exports = this["lodash"]; }()); |
9
|
228 |
|
|
229 |
/***/ }), |
|
230 |
|
16
|
231 |
/***/ 26: |
|
232 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
233 |
|
|
234 |
"use strict"; |
|
235 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); |
|
236 |
function _arrayLikeToArray(arr, len) { |
|
237 |
if (len == null || len > arr.length) len = arr.length; |
|
238 |
|
|
239 |
for (var i = 0, arr2 = new Array(len); i < len; i++) { |
|
240 |
arr2[i] = arr[i]; |
|
241 |
} |
|
242 |
|
|
243 |
return arr2; |
|
244 |
} |
|
245 |
|
|
246 |
/***/ }), |
|
247 |
|
|
248 |
/***/ 29: |
|
249 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
250 |
|
|
251 |
"use strict"; |
|
252 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); |
|
253 |
/* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26); |
|
254 |
|
|
255 |
function _unsupportedIterableToArray(o, minLen) { |
|
256 |
if (!o) return; |
|
257 |
if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
258 |
var n = Object.prototype.toString.call(o).slice(8, -1); |
|
259 |
if (n === "Object" && o.constructor) n = o.constructor.name; |
|
260 |
if (n === "Map" || n === "Set") return Array.from(o); |
|
261 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
262 |
} |
|
263 |
|
|
264 |
/***/ }), |
|
265 |
|
|
266 |
/***/ 35: |
|
267 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
268 |
|
|
269 |
"use strict"; |
|
270 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
|
271 |
function _iterableToArray(iter) { |
|
272 |
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); |
|
273 |
} |
|
274 |
|
|
275 |
/***/ }), |
|
276 |
|
|
277 |
/***/ 38: |
|
278 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
279 |
|
|
280 |
"use strict"; |
|
281 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); |
|
282 |
function _arrayWithHoles(arr) { |
|
283 |
if (Array.isArray(arr)) return arr; |
|
284 |
} |
|
285 |
|
|
286 |
/***/ }), |
|
287 |
|
|
288 |
/***/ 39: |
|
289 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
290 |
|
|
291 |
"use strict"; |
|
292 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); |
|
293 |
function _nonIterableRest() { |
|
294 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
295 |
} |
|
296 |
|
|
297 |
/***/ }), |
|
298 |
|
|
299 |
/***/ 40: |
9
|
300 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
301 |
|
|
302 |
"use strict"; |
|
303 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); |
16
|
304 |
function _typeof(obj) { |
|
305 |
"@babel/helpers - typeof"; |
9
|
306 |
|
16
|
307 |
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
9
|
308 |
_typeof = function _typeof(obj) { |
16
|
309 |
return typeof obj; |
9
|
310 |
}; |
|
311 |
} else { |
|
312 |
_typeof = function _typeof(obj) { |
16
|
313 |
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
9
|
314 |
}; |
|
315 |
} |
|
316 |
|
|
317 |
return _typeof(obj); |
|
318 |
} |
|
319 |
|
|
320 |
/***/ }), |
|
321 |
|
16
|
322 |
/***/ 41: |
|
323 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
324 |
|
|
325 |
"use strict"; |
|
326 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); |
|
327 |
function _objectWithoutPropertiesLoose(source, excluded) { |
|
328 |
if (source == null) return {}; |
|
329 |
var target = {}; |
|
330 |
var sourceKeys = Object.keys(source); |
|
331 |
var key, i; |
|
332 |
|
|
333 |
for (i = 0; i < sourceKeys.length; i++) { |
|
334 |
key = sourceKeys[i]; |
|
335 |
if (excluded.indexOf(key) >= 0) continue; |
|
336 |
target[key] = source[key]; |
|
337 |
} |
|
338 |
|
|
339 |
return target; |
|
340 |
} |
|
341 |
|
|
342 |
/***/ }), |
|
343 |
|
|
344 |
/***/ 453: |
9
|
345 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
346 |
|
|
347 |
"use strict"; |
16
|
348 |
// ESM COMPAT FLAG |
9
|
349 |
__webpack_require__.r(__webpack_exports__); |
|
350 |
|
16
|
351 |
// EXPORTS |
|
352 |
__webpack_require__.d(__webpack_exports__, "createInterpolateElement", function() { return /* reexport */ create_interpolate_element; }); |
|
353 |
__webpack_require__.d(__webpack_exports__, "Children", function() { return /* reexport */ external_this_React_["Children"]; }); |
|
354 |
__webpack_require__.d(__webpack_exports__, "cloneElement", function() { return /* reexport */ external_this_React_["cloneElement"]; }); |
|
355 |
__webpack_require__.d(__webpack_exports__, "Component", function() { return /* reexport */ external_this_React_["Component"]; }); |
|
356 |
__webpack_require__.d(__webpack_exports__, "createContext", function() { return /* reexport */ external_this_React_["createContext"]; }); |
|
357 |
__webpack_require__.d(__webpack_exports__, "createElement", function() { return /* reexport */ external_this_React_["createElement"]; }); |
|
358 |
__webpack_require__.d(__webpack_exports__, "createRef", function() { return /* reexport */ external_this_React_["createRef"]; }); |
|
359 |
__webpack_require__.d(__webpack_exports__, "forwardRef", function() { return /* reexport */ external_this_React_["forwardRef"]; }); |
|
360 |
__webpack_require__.d(__webpack_exports__, "Fragment", function() { return /* reexport */ external_this_React_["Fragment"]; }); |
|
361 |
__webpack_require__.d(__webpack_exports__, "isValidElement", function() { return /* reexport */ external_this_React_["isValidElement"]; }); |
|
362 |
__webpack_require__.d(__webpack_exports__, "memo", function() { return /* reexport */ external_this_React_["memo"]; }); |
|
363 |
__webpack_require__.d(__webpack_exports__, "StrictMode", function() { return /* reexport */ external_this_React_["StrictMode"]; }); |
|
364 |
__webpack_require__.d(__webpack_exports__, "useCallback", function() { return /* reexport */ external_this_React_["useCallback"]; }); |
|
365 |
__webpack_require__.d(__webpack_exports__, "useContext", function() { return /* reexport */ external_this_React_["useContext"]; }); |
|
366 |
__webpack_require__.d(__webpack_exports__, "useDebugValue", function() { return /* reexport */ external_this_React_["useDebugValue"]; }); |
|
367 |
__webpack_require__.d(__webpack_exports__, "useEffect", function() { return /* reexport */ external_this_React_["useEffect"]; }); |
|
368 |
__webpack_require__.d(__webpack_exports__, "useImperativeHandle", function() { return /* reexport */ external_this_React_["useImperativeHandle"]; }); |
|
369 |
__webpack_require__.d(__webpack_exports__, "useLayoutEffect", function() { return /* reexport */ external_this_React_["useLayoutEffect"]; }); |
|
370 |
__webpack_require__.d(__webpack_exports__, "useMemo", function() { return /* reexport */ external_this_React_["useMemo"]; }); |
|
371 |
__webpack_require__.d(__webpack_exports__, "useReducer", function() { return /* reexport */ external_this_React_["useReducer"]; }); |
|
372 |
__webpack_require__.d(__webpack_exports__, "useRef", function() { return /* reexport */ external_this_React_["useRef"]; }); |
|
373 |
__webpack_require__.d(__webpack_exports__, "useState", function() { return /* reexport */ external_this_React_["useState"]; }); |
|
374 |
__webpack_require__.d(__webpack_exports__, "lazy", function() { return /* reexport */ external_this_React_["lazy"]; }); |
|
375 |
__webpack_require__.d(__webpack_exports__, "Suspense", function() { return /* reexport */ external_this_React_["Suspense"]; }); |
|
376 |
__webpack_require__.d(__webpack_exports__, "concatChildren", function() { return /* reexport */ concatChildren; }); |
|
377 |
__webpack_require__.d(__webpack_exports__, "switchChildrenNodeName", function() { return /* reexport */ switchChildrenNodeName; }); |
|
378 |
__webpack_require__.d(__webpack_exports__, "createPortal", function() { return /* reexport */ external_this_ReactDOM_["createPortal"]; }); |
|
379 |
__webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return /* reexport */ external_this_ReactDOM_["findDOMNode"]; }); |
|
380 |
__webpack_require__.d(__webpack_exports__, "render", function() { return /* reexport */ external_this_ReactDOM_["render"]; }); |
|
381 |
__webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return /* reexport */ external_this_ReactDOM_["unmountComponentAtNode"]; }); |
|
382 |
__webpack_require__.d(__webpack_exports__, "isEmptyElement", function() { return /* reexport */ utils_isEmptyElement; }); |
|
383 |
__webpack_require__.d(__webpack_exports__, "Platform", function() { return /* reexport */ platform; }); |
|
384 |
__webpack_require__.d(__webpack_exports__, "renderToString", function() { return /* reexport */ serialize; }); |
|
385 |
__webpack_require__.d(__webpack_exports__, "RawHTML", function() { return /* reexport */ RawHTML; }); |
9
|
386 |
|
16
|
387 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules |
|
388 |
var slicedToArray = __webpack_require__(14); |
|
389 |
|
|
390 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js |
|
391 |
var esm_typeof = __webpack_require__(40); |
9
|
392 |
|
16
|
393 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
|
394 |
var toConsumableArray = __webpack_require__(18); |
9
|
395 |
|
16
|
396 |
// EXTERNAL MODULE: external {"this":"React"} |
|
397 |
var external_this_React_ = __webpack_require__(13); |
|
398 |
|
|
399 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/create-interpolate-element.js |
|
400 |
|
9
|
401 |
|
|
402 |
|
|
403 |
|
|
404 |
/** |
|
405 |
* External dependencies |
|
406 |
*/ |
|
407 |
|
16
|
408 |
/** @typedef {import('./react').WPElement} WPElement */ |
|
409 |
|
|
410 |
var indoc, offset, output, stack; |
|
411 |
/** |
|
412 |
* Matches tags in the localized string |
|
413 |
* |
|
414 |
* This is used for extracting the tag pattern groups for parsing the localized |
|
415 |
* string and along with the map converting it to a react element. |
|
416 |
* |
|
417 |
* There are four references extracted using this tokenizer: |
|
418 |
* |
|
419 |
* match: Full match of the tag (i.e. <strong>, </strong>, <br/>) |
|
420 |
* isClosing: The closing slash, it it exists. |
|
421 |
* name: The name portion of the tag (strong, br) (if ) |
|
422 |
* isSelfClosed: The slash on a self closing tag, if it exists. |
|
423 |
* |
|
424 |
* @type {RegExp} |
|
425 |
*/ |
|
426 |
|
|
427 |
var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; |
|
428 |
/** |
|
429 |
* The stack frame tracking parse progress. |
|
430 |
* |
|
431 |
* @typedef Frame |
|
432 |
* |
|
433 |
* @property {WPElement} element A parent element which may still have |
|
434 |
* @property {number} tokenStart Offset at which parent element first |
|
435 |
* appears. |
|
436 |
* @property {number} tokenLength Length of string marking start of parent |
|
437 |
* element. |
|
438 |
* @property {number} [prevOffset] Running offset at which parsing should |
|
439 |
* continue. |
|
440 |
* @property {number} [leadingTextStart] Offset at which last closing element |
|
441 |
* finished, used for finding text between |
|
442 |
* elements. |
|
443 |
* @property {WPElement[]} children Children. |
|
444 |
*/ |
|
445 |
|
|
446 |
/** |
|
447 |
* Tracks recursive-descent parse state. |
|
448 |
* |
|
449 |
* This is a Stack frame holding parent elements until all children have been |
|
450 |
* parsed. |
|
451 |
* |
|
452 |
* @private |
|
453 |
* @param {WPElement} element A parent element which may still have |
|
454 |
* nested children not yet parsed. |
|
455 |
* @param {number} tokenStart Offset at which parent element first |
|
456 |
* appears. |
|
457 |
* @param {number} tokenLength Length of string marking start of parent |
|
458 |
* element. |
|
459 |
* @param {number} [prevOffset] Running offset at which parsing should |
|
460 |
* continue. |
|
461 |
* @param {number} [leadingTextStart] Offset at which last closing element |
|
462 |
* finished, used for finding text between |
|
463 |
* elements. |
|
464 |
* |
|
465 |
* @return {Frame} The stack frame tracking parse progress. |
|
466 |
*/ |
|
467 |
|
|
468 |
function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { |
|
469 |
return { |
|
470 |
element: element, |
|
471 |
tokenStart: tokenStart, |
|
472 |
tokenLength: tokenLength, |
|
473 |
prevOffset: prevOffset, |
|
474 |
leadingTextStart: leadingTextStart, |
|
475 |
children: [] |
|
476 |
}; |
|
477 |
} |
|
478 |
/** |
|
479 |
* This function creates an interpolated element from a passed in string with |
|
480 |
* specific tags matching how the string should be converted to an element via |
|
481 |
* the conversion map value. |
|
482 |
* |
|
483 |
* @example |
|
484 |
* For example, for the given string: |
|
485 |
* |
|
486 |
* "This is a <span>string</span> with <a>a link</a> and a self-closing |
|
487 |
* <CustomComponentB/> tag" |
|
488 |
* |
|
489 |
* You would have something like this as the conversionMap value: |
|
490 |
* |
|
491 |
* ```js |
|
492 |
* { |
|
493 |
* span: <span />, |
|
494 |
* a: <a href={ 'https://github.com' } />, |
|
495 |
* CustomComponentB: <CustomComponent />, |
|
496 |
* } |
|
497 |
* ``` |
|
498 |
* |
|
499 |
* @param {string} interpolatedString The interpolation string to be parsed. |
|
500 |
* @param {Object} conversionMap The map used to convert the string to |
|
501 |
* a react element. |
|
502 |
* @throws {TypeError} |
|
503 |
* @return {WPElement} A wp element. |
|
504 |
*/ |
|
505 |
|
|
506 |
|
|
507 |
var create_interpolate_element_createInterpolateElement = function createInterpolateElement(interpolatedString, conversionMap) { |
|
508 |
indoc = interpolatedString; |
|
509 |
offset = 0; |
|
510 |
output = []; |
|
511 |
stack = []; |
|
512 |
tokenizer.lastIndex = 0; |
|
513 |
|
|
514 |
if (!create_interpolate_element_isValidConversionMap(conversionMap)) { |
|
515 |
throw new TypeError('The conversionMap provided is not valid. It must be an object with values that are WPElements'); |
|
516 |
} |
|
517 |
|
|
518 |
do {// twiddle our thumbs |
|
519 |
} while (proceed(conversionMap)); |
|
520 |
|
|
521 |
return external_this_React_["createElement"].apply(void 0, [external_this_React_["Fragment"], null].concat(Object(toConsumableArray["a" /* default */])(output))); |
|
522 |
}; |
|
523 |
/** |
|
524 |
* Validate conversion map. |
|
525 |
* |
|
526 |
* A map is considered valid if it's an object and every value in the object |
|
527 |
* is a WPElement |
|
528 |
* |
|
529 |
* @private |
|
530 |
* |
|
531 |
* @param {Object} conversionMap The map being validated. |
|
532 |
* |
|
533 |
* @return {boolean} True means the map is valid. |
|
534 |
*/ |
|
535 |
|
|
536 |
|
|
537 |
var create_interpolate_element_isValidConversionMap = function isValidConversionMap(conversionMap) { |
|
538 |
var isObject = Object(esm_typeof["a" /* default */])(conversionMap) === 'object'; |
|
539 |
var values = isObject && Object.values(conversionMap); |
|
540 |
return isObject && values.length && values.every(function (element) { |
|
541 |
return Object(external_this_React_["isValidElement"])(element); |
|
542 |
}); |
|
543 |
}; |
|
544 |
/** |
|
545 |
* This is the iterator over the matches in the string. |
|
546 |
* |
|
547 |
* @private |
|
548 |
* |
|
549 |
* @param {Object} conversionMap The conversion map for the string. |
|
550 |
* |
|
551 |
* @return {boolean} true for continuing to iterate, false for finished. |
|
552 |
*/ |
|
553 |
|
|
554 |
|
|
555 |
function proceed(conversionMap) { |
|
556 |
var next = nextToken(); |
|
557 |
|
|
558 |
var _next = Object(slicedToArray["a" /* default */])(next, 4), |
|
559 |
tokenType = _next[0], |
|
560 |
name = _next[1], |
|
561 |
startOffset = _next[2], |
|
562 |
tokenLength = _next[3]; |
|
563 |
|
|
564 |
var stackDepth = stack.length; |
|
565 |
var leadingTextStart = startOffset > offset ? offset : null; |
|
566 |
|
|
567 |
if (!conversionMap[name]) { |
|
568 |
addText(); |
|
569 |
return false; |
|
570 |
} |
|
571 |
|
|
572 |
switch (tokenType) { |
|
573 |
case 'no-more-tokens': |
|
574 |
if (stackDepth !== 0) { |
|
575 |
var _stack$pop = stack.pop(), |
|
576 |
stackLeadingText = _stack$pop.leadingTextStart, |
|
577 |
tokenStart = _stack$pop.tokenStart; |
|
578 |
|
|
579 |
output.push(indoc.substr(stackLeadingText, tokenStart)); |
|
580 |
} |
|
581 |
|
|
582 |
addText(); |
|
583 |
return false; |
|
584 |
|
|
585 |
case 'self-closed': |
|
586 |
if (0 === stackDepth) { |
|
587 |
if (null !== leadingTextStart) { |
|
588 |
output.push(indoc.substr(leadingTextStart, startOffset - leadingTextStart)); |
|
589 |
} |
|
590 |
|
|
591 |
output.push(conversionMap[name]); |
|
592 |
offset = startOffset + tokenLength; |
|
593 |
return true; |
|
594 |
} // otherwise we found an inner element |
|
595 |
|
|
596 |
|
|
597 |
addChild(createFrame(conversionMap[name], startOffset, tokenLength)); |
|
598 |
offset = startOffset + tokenLength; |
|
599 |
return true; |
|
600 |
|
|
601 |
case 'opener': |
|
602 |
stack.push(createFrame(conversionMap[name], startOffset, tokenLength, startOffset + tokenLength, leadingTextStart)); |
|
603 |
offset = startOffset + tokenLength; |
|
604 |
return true; |
|
605 |
|
|
606 |
case 'closer': |
|
607 |
// if we're not nesting then this is easy - close the block |
|
608 |
if (1 === stackDepth) { |
|
609 |
closeOuterElement(startOffset); |
|
610 |
offset = startOffset + tokenLength; |
|
611 |
return true; |
|
612 |
} // otherwise we're nested and we have to close out the current |
|
613 |
// block and add it as a innerBlock to the parent |
|
614 |
|
|
615 |
|
|
616 |
var stackTop = stack.pop(); |
|
617 |
var text = indoc.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset); |
|
618 |
stackTop.children.push(text); |
|
619 |
stackTop.prevOffset = startOffset + tokenLength; |
|
620 |
var frame = createFrame(stackTop.element, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength); |
|
621 |
frame.children = stackTop.children; |
|
622 |
addChild(frame); |
|
623 |
offset = startOffset + tokenLength; |
|
624 |
return true; |
|
625 |
|
|
626 |
default: |
|
627 |
addText(); |
|
628 |
return false; |
|
629 |
} |
|
630 |
} |
|
631 |
/** |
|
632 |
* Grabs the next token match in the string and returns it's details. |
|
633 |
* |
|
634 |
* @private |
|
635 |
* |
|
636 |
* @return {Array} An array of details for the token matched. |
|
637 |
*/ |
|
638 |
|
|
639 |
|
|
640 |
function nextToken() { |
|
641 |
var matches = tokenizer.exec(indoc); // we have no more tokens |
|
642 |
|
|
643 |
if (null === matches) { |
|
644 |
return ['no-more-tokens']; |
|
645 |
} |
|
646 |
|
|
647 |
var startedAt = matches.index; |
|
648 |
|
|
649 |
var _matches = Object(slicedToArray["a" /* default */])(matches, 4), |
|
650 |
match = _matches[0], |
|
651 |
isClosing = _matches[1], |
|
652 |
name = _matches[2], |
|
653 |
isSelfClosed = _matches[3]; |
|
654 |
|
|
655 |
var length = match.length; |
|
656 |
|
|
657 |
if (isSelfClosed) { |
|
658 |
return ['self-closed', name, startedAt, length]; |
|
659 |
} |
|
660 |
|
|
661 |
if (isClosing) { |
|
662 |
return ['closer', name, startedAt, length]; |
|
663 |
} |
|
664 |
|
|
665 |
return ['opener', name, startedAt, length]; |
|
666 |
} |
|
667 |
/** |
|
668 |
* Pushes text extracted from the indoc string to the output stack given the |
|
669 |
* current rawLength value and offset (if rawLength is provided ) or the |
|
670 |
* indoc.length and offset. |
|
671 |
* |
|
672 |
* @private |
|
673 |
*/ |
|
674 |
|
|
675 |
|
|
676 |
function addText() { |
|
677 |
var length = indoc.length - offset; |
|
678 |
|
|
679 |
if (0 === length) { |
|
680 |
return; |
|
681 |
} |
|
682 |
|
|
683 |
output.push(indoc.substr(offset, length)); |
|
684 |
} |
|
685 |
/** |
|
686 |
* Pushes a child element to the associated parent element's children for the |
|
687 |
* parent currently active in the stack. |
|
688 |
* |
|
689 |
* @private |
|
690 |
* |
|
691 |
* @param {Frame} frame The Frame containing the child element and it's |
|
692 |
* token information. |
|
693 |
*/ |
|
694 |
|
|
695 |
|
|
696 |
function addChild(frame) { |
|
697 |
var element = frame.element, |
|
698 |
tokenStart = frame.tokenStart, |
|
699 |
tokenLength = frame.tokenLength, |
|
700 |
prevOffset = frame.prevOffset, |
|
701 |
children = frame.children; |
|
702 |
var parent = stack[stack.length - 1]; |
|
703 |
var text = indoc.substr(parent.prevOffset, tokenStart - parent.prevOffset); |
|
704 |
|
|
705 |
if (text) { |
|
706 |
parent.children.push(text); |
|
707 |
} |
|
708 |
|
|
709 |
parent.children.push(external_this_React_["cloneElement"].apply(void 0, [element, null].concat(Object(toConsumableArray["a" /* default */])(children)))); |
|
710 |
parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; |
|
711 |
} |
|
712 |
/** |
|
713 |
* This is called for closing tags. It creates the element currently active in |
|
714 |
* the stack. |
|
715 |
* |
|
716 |
* @private |
|
717 |
* |
|
718 |
* @param {number} endOffset Offset at which the closing tag for the element |
|
719 |
* begins in the string. If this is greater than the |
|
720 |
* prevOffset attached to the element, then this |
|
721 |
* helps capture any remaining nested text nodes in |
|
722 |
* the element. |
|
723 |
*/ |
|
724 |
|
|
725 |
|
|
726 |
function closeOuterElement(endOffset) { |
|
727 |
var _stack$pop2 = stack.pop(), |
|
728 |
element = _stack$pop2.element, |
|
729 |
leadingTextStart = _stack$pop2.leadingTextStart, |
|
730 |
prevOffset = _stack$pop2.prevOffset, |
|
731 |
tokenStart = _stack$pop2.tokenStart, |
|
732 |
children = _stack$pop2.children; |
|
733 |
|
|
734 |
var text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); |
|
735 |
|
|
736 |
if (text) { |
|
737 |
children.push(text); |
|
738 |
} |
|
739 |
|
|
740 |
if (null !== leadingTextStart) { |
|
741 |
output.push(indoc.substr(leadingTextStart, tokenStart - leadingTextStart)); |
|
742 |
} |
|
743 |
|
|
744 |
output.push(external_this_React_["cloneElement"].apply(void 0, [element, null].concat(Object(toConsumableArray["a" /* default */])(children)))); |
|
745 |
} |
|
746 |
|
|
747 |
/* harmony default export */ var create_interpolate_element = (create_interpolate_element_createInterpolateElement); |
|
748 |
|
|
749 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
750 |
var defineProperty = __webpack_require__(5); |
|
751 |
|
|
752 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js |
|
753 |
var objectWithoutProperties = __webpack_require__(15); |
|
754 |
|
|
755 |
// EXTERNAL MODULE: external {"this":"lodash"} |
|
756 |
var external_this_lodash_ = __webpack_require__(2); |
|
757 |
|
|
758 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react.js |
|
759 |
|
|
760 |
|
|
761 |
|
|
762 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
763 |
|
|
764 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
765 |
|
|
766 |
/** |
|
767 |
* External dependencies |
|
768 |
*/ |
|
769 |
|
|
770 |
|
|
771 |
/** |
|
772 |
* Object containing a React element. |
|
773 |
* |
|
774 |
* @typedef {import('react').ReactElement} WPElement |
|
775 |
*/ |
|
776 |
|
|
777 |
/** |
|
778 |
* Object containing a React component. |
|
779 |
* |
|
780 |
* @typedef {import('react').ComponentType} WPComponent |
|
781 |
*/ |
|
782 |
|
|
783 |
/** |
|
784 |
* Object containing a React synthetic event. |
|
785 |
* |
|
786 |
* @typedef {import('react').SyntheticEvent} WPSyntheticEvent |
|
787 |
*/ |
9
|
788 |
|
|
789 |
/** |
|
790 |
* Object that provides utilities for dealing with React children. |
|
791 |
*/ |
|
792 |
|
|
793 |
|
|
794 |
/** |
|
795 |
* Creates a copy of an element with extended props. |
|
796 |
* |
|
797 |
* @param {WPElement} element Element |
|
798 |
* @param {?Object} props Props to apply to cloned element |
|
799 |
* |
|
800 |
* @return {WPElement} Cloned element. |
|
801 |
*/ |
|
802 |
|
|
803 |
|
|
804 |
/** |
|
805 |
* A base class to create WordPress Components (Refs, state and lifecycle hooks) |
|
806 |
*/ |
|
807 |
|
|
808 |
|
|
809 |
/** |
|
810 |
* Creates a context object containing two components: a provider and consumer. |
|
811 |
* |
|
812 |
* @param {Object} defaultValue A default data stored in the context. |
|
813 |
* |
|
814 |
* @return {Object} Context object. |
|
815 |
*/ |
|
816 |
|
|
817 |
|
|
818 |
/** |
|
819 |
* Returns a new element of given type. Type can be either a string tag name or |
|
820 |
* another function which itself returns an element. |
|
821 |
* |
|
822 |
* @param {?(string|Function)} type Tag name or element creator |
|
823 |
* @param {Object} props Element properties, either attribute |
16
|
824 |
* set to apply to DOM node or values to |
|
825 |
* pass through to element creator |
9
|
826 |
* @param {...WPElement} children Descendant elements |
|
827 |
* |
|
828 |
* @return {WPElement} Element. |
|
829 |
*/ |
|
830 |
|
|
831 |
|
|
832 |
/** |
|
833 |
* Returns an object tracking a reference to a rendered element via its |
|
834 |
* `current` property as either a DOMElement or Element, dependent upon the |
|
835 |
* type of element rendered with the ref attribute. |
|
836 |
* |
|
837 |
* @return {Object} Ref object. |
|
838 |
*/ |
|
839 |
|
|
840 |
|
|
841 |
/** |
|
842 |
* Component enhancer used to enable passing a ref to its wrapped component. |
|
843 |
* Pass a function argument which receives `props` and `ref` as its arguments, |
|
844 |
* returning an element using the forwarded ref. The return value is a new |
|
845 |
* component which forwards its ref. |
|
846 |
* |
|
847 |
* @param {Function} forwarder Function passed `props` and `ref`, expected to |
|
848 |
* return an element. |
|
849 |
* |
|
850 |
* @return {WPComponent} Enhanced component. |
|
851 |
*/ |
|
852 |
|
|
853 |
|
|
854 |
/** |
|
855 |
* A component which renders its children without any wrapping element. |
|
856 |
*/ |
|
857 |
|
|
858 |
|
|
859 |
/** |
16
|
860 |
* Checks if an object is a valid WPElement. |
9
|
861 |
* |
|
862 |
* @param {Object} objectToCheck The object to be checked. |
|
863 |
* |
|
864 |
* @return {boolean} true if objectToTest is a valid WPElement and false otherwise. |
|
865 |
*/ |
|
866 |
|
|
867 |
|
|
868 |
/** |
16
|
869 |
* @see https://reactjs.org/docs/react-api.html#reactmemo |
|
870 |
*/ |
|
871 |
|
|
872 |
|
|
873 |
/** |
9
|
874 |
* Component that activates additional checks and warnings for its descendants. |
|
875 |
*/ |
|
876 |
|
|
877 |
|
|
878 |
/** |
|
879 |
* @see https://reactjs.org/docs/hooks-reference.html#usecallback |
|
880 |
*/ |
|
881 |
|
|
882 |
|
|
883 |
/** |
|
884 |
* @see https://reactjs.org/docs/hooks-reference.html#usecontext |
|
885 |
*/ |
|
886 |
|
|
887 |
|
|
888 |
/** |
|
889 |
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue |
|
890 |
*/ |
|
891 |
|
|
892 |
|
|
893 |
/** |
|
894 |
* @see https://reactjs.org/docs/hooks-reference.html#useeffect |
|
895 |
*/ |
|
896 |
|
|
897 |
|
|
898 |
/** |
|
899 |
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle |
|
900 |
*/ |
|
901 |
|
|
902 |
|
|
903 |
/** |
|
904 |
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect |
|
905 |
*/ |
|
906 |
|
|
907 |
|
|
908 |
/** |
|
909 |
* @see https://reactjs.org/docs/hooks-reference.html#usememo |
|
910 |
*/ |
|
911 |
|
|
912 |
|
|
913 |
/** |
|
914 |
* @see https://reactjs.org/docs/hooks-reference.html#usereducer |
|
915 |
*/ |
|
916 |
|
|
917 |
|
|
918 |
/** |
|
919 |
* @see https://reactjs.org/docs/hooks-reference.html#useref |
|
920 |
*/ |
|
921 |
|
|
922 |
|
|
923 |
/** |
|
924 |
* @see https://reactjs.org/docs/hooks-reference.html#usestate |
|
925 |
*/ |
|
926 |
|
|
927 |
|
|
928 |
/** |
16
|
929 |
* @see https://reactjs.org/docs/react-api.html#reactlazy |
|
930 |
*/ |
|
931 |
|
|
932 |
|
|
933 |
/** |
|
934 |
* @see https://reactjs.org/docs/react-api.html#reactsuspense |
|
935 |
*/ |
|
936 |
|
|
937 |
|
|
938 |
/** |
9
|
939 |
* Concatenate two or more React children objects. |
|
940 |
* |
|
941 |
* @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate. |
|
942 |
* |
|
943 |
* @return {Array} The concatenated value. |
|
944 |
*/ |
|
945 |
|
|
946 |
function concatChildren() { |
|
947 |
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) { |
|
948 |
childrenArguments[_key] = arguments[_key]; |
|
949 |
} |
|
950 |
|
16
|
951 |
return childrenArguments.reduce(function (accumulator, children, i) { |
|
952 |
external_this_React_["Children"].forEach(children, function (child, j) { |
9
|
953 |
if (child && 'string' !== typeof child) { |
16
|
954 |
child = Object(external_this_React_["cloneElement"])(child, { |
9
|
955 |
key: [i, j].join() |
|
956 |
}); |
|
957 |
} |
|
958 |
|
16
|
959 |
accumulator.push(child); |
9
|
960 |
}); |
16
|
961 |
return accumulator; |
9
|
962 |
}, []); |
|
963 |
} |
|
964 |
/** |
|
965 |
* Switches the nodeName of all the elements in the children object. |
|
966 |
* |
|
967 |
* @param {?Object} children Children object. |
|
968 |
* @param {string} nodeName Node name. |
|
969 |
* |
|
970 |
* @return {?Object} The updated children object. |
|
971 |
*/ |
|
972 |
|
|
973 |
function switchChildrenNodeName(children, nodeName) { |
16
|
974 |
return children && external_this_React_["Children"].map(children, function (elt, index) { |
|
975 |
if (Object(external_this_lodash_["isString"])(elt)) { |
|
976 |
return Object(external_this_React_["createElement"])(nodeName, { |
9
|
977 |
key: index |
|
978 |
}, elt); |
|
979 |
} |
|
980 |
|
|
981 |
var _elt$props = elt.props, |
|
982 |
childrenProp = _elt$props.children, |
|
983 |
props = Object(objectWithoutProperties["a" /* default */])(_elt$props, ["children"]); |
|
984 |
|
16
|
985 |
return Object(external_this_React_["createElement"])(nodeName, _objectSpread({ |
9
|
986 |
key: index |
|
987 |
}, props), childrenProp); |
|
988 |
}); |
|
989 |
} |
|
990 |
|
16
|
991 |
// EXTERNAL MODULE: external {"this":"ReactDOM"} |
|
992 |
var external_this_ReactDOM_ = __webpack_require__(144); |
9
|
993 |
|
|
994 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react-platform.js |
|
995 |
/** |
|
996 |
* External dependencies |
|
997 |
*/ |
|
998 |
|
|
999 |
/** |
|
1000 |
* Creates a portal into which a component can be rendered. |
|
1001 |
* |
|
1002 |
* @see https://github.com/facebook/react/issues/10309#issuecomment-318433235 |
|
1003 |
* |
16
|
1004 |
* @param {import('./react').WPElement} child Any renderable child, such as an element, |
|
1005 |
* string, or fragment. |
|
1006 |
* @param {HTMLElement} container DOM node into which element should be rendered. |
9
|
1007 |
*/ |
|
1008 |
|
|
1009 |
|
|
1010 |
/** |
16
|
1011 |
* Finds the dom node of a React component. |
9
|
1012 |
* |
16
|
1013 |
* @param {import('./react').WPComponent} component Component's instance. |
9
|
1014 |
*/ |
|
1015 |
|
|
1016 |
|
|
1017 |
/** |
|
1018 |
* Renders a given element into the target DOM node. |
|
1019 |
* |
16
|
1020 |
* @param {import('./react').WPElement} element Element to render. |
|
1021 |
* @param {HTMLElement} target DOM node into which element should be rendered. |
9
|
1022 |
*/ |
|
1023 |
|
|
1024 |
|
|
1025 |
/** |
|
1026 |
* Removes any mounted element from the target DOM node. |
|
1027 |
* |
|
1028 |
* @param {Element} target DOM node in which element is to be removed |
|
1029 |
*/ |
|
1030 |
|
|
1031 |
|
|
1032 |
|
|
1033 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/utils.js |
|
1034 |
/** |
|
1035 |
* External dependencies |
|
1036 |
*/ |
|
1037 |
|
|
1038 |
/** |
|
1039 |
* Checks if the provided WP element is empty. |
|
1040 |
* |
|
1041 |
* @param {*} element WP element to check. |
|
1042 |
* @return {boolean} True when an element is considered empty. |
|
1043 |
*/ |
|
1044 |
|
|
1045 |
var utils_isEmptyElement = function isEmptyElement(element) { |
16
|
1046 |
if (Object(external_this_lodash_["isNumber"])(element)) { |
9
|
1047 |
return false; |
|
1048 |
} |
|
1049 |
|
16
|
1050 |
if (Object(external_this_lodash_["isString"])(element) || Object(external_this_lodash_["isArray"])(element)) { |
9
|
1051 |
return !element.length; |
|
1052 |
} |
|
1053 |
|
|
1054 |
return !element; |
|
1055 |
}; |
|
1056 |
|
16
|
1057 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/platform.js |
|
1058 |
/** |
|
1059 |
* Parts of this source were derived and modified from react-native-web, |
|
1060 |
* released under the MIT license. |
|
1061 |
* |
|
1062 |
* Copyright (c) 2016-present, Nicolas Gallagher. |
|
1063 |
* Copyright (c) 2015-present, Facebook, Inc. |
|
1064 |
* |
|
1065 |
*/ |
|
1066 |
var Platform = { |
|
1067 |
OS: 'web', |
|
1068 |
select: function select(spec) { |
|
1069 |
return 'web' in spec ? spec.web : spec.default; |
|
1070 |
} |
|
1071 |
}; |
|
1072 |
/** |
|
1073 |
* Component used to detect the current Platform being used. |
|
1074 |
* Use Platform.OS === 'web' to detect if running on web enviroment. |
|
1075 |
* |
|
1076 |
* This is the same concept as the React Native implementation. |
|
1077 |
* |
|
1078 |
* @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module |
|
1079 |
* |
|
1080 |
* Here is an example of how to use the select method: |
|
1081 |
* @example |
|
1082 |
* ```js |
|
1083 |
* import { Platform } from '@wordpress/element'; |
|
1084 |
* |
|
1085 |
* const placeholderLabel = Platform.select( { |
|
1086 |
* native: __( 'Add media' ), |
|
1087 |
* web: __( 'Drag images, upload new ones or select files from your library.' ), |
|
1088 |
* } ); |
|
1089 |
* ``` |
|
1090 |
*/ |
|
1091 |
|
|
1092 |
/* harmony default export */ var platform = (Platform); |
9
|
1093 |
|
|
1094 |
// EXTERNAL MODULE: external {"this":["wp","escapeHtml"]} |
16
|
1095 |
var external_this_wp_escapeHtml_ = __webpack_require__(89); |
9
|
1096 |
|
|
1097 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/raw-html.js |
|
1098 |
|
|
1099 |
|
|
1100 |
|
16
|
1101 |
function raw_html_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
1102 |
|
|
1103 |
function raw_html_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { raw_html_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { raw_html_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
1104 |
|
9
|
1105 |
/** |
|
1106 |
* Internal dependencies |
|
1107 |
*/ |
16
|
1108 |
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly. |
|
1109 |
|
|
1110 |
/* eslint-disable jsdoc/valid-types */ |
|
1111 |
|
|
1112 |
/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */ |
|
1113 |
|
|
1114 |
/* eslint-enable jsdoc/valid-types */ |
9
|
1115 |
|
|
1116 |
/** |
|
1117 |
* Component used as equivalent of Fragment with unescaped HTML, in cases where |
|
1118 |
* it is desirable to render dangerous HTML without needing a wrapper element. |
|
1119 |
* To preserve additional props, a `div` wrapper _will_ be created if any props |
|
1120 |
* aside from `children` are passed. |
|
1121 |
* |
16
|
1122 |
* @param {RawHTMLProps} props Children should be a string of HTML. Other props |
|
1123 |
* will be passed through to div wrapper. |
9
|
1124 |
* |
16
|
1125 |
* @return {JSX.Element} Dangerously-rendering component. |
9
|
1126 |
*/ |
|
1127 |
|
|
1128 |
function RawHTML(_ref) { |
|
1129 |
var children = _ref.children, |
|
1130 |
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children"]); |
|
1131 |
|
|
1132 |
// The DIV wrapper will be stripped by serializer, unless there are |
|
1133 |
// non-children props present. |
16
|
1134 |
return Object(external_this_React_["createElement"])('div', raw_html_objectSpread({ |
9
|
1135 |
dangerouslySetInnerHTML: { |
|
1136 |
__html: children |
|
1137 |
} |
|
1138 |
}, props)); |
|
1139 |
} |
|
1140 |
|
|
1141 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/serialize.js |
|
1142 |
|
|
1143 |
|
|
1144 |
|
|
1145 |
|
16
|
1146 |
function serialize_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
1147 |
|
|
1148 |
function serialize_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { serialize_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { serialize_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
1149 |
|
9
|
1150 |
/** |
|
1151 |
* Parts of this source were derived and modified from fast-react-render, |
|
1152 |
* released under the MIT license. |
|
1153 |
* |
|
1154 |
* https://github.com/alt-j/fast-react-render |
|
1155 |
* |
|
1156 |
* Copyright (c) 2016 Andrey Morozov |
|
1157 |
* |
|
1158 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
1159 |
* of this software and associated documentation files (the "Software"), to deal |
|
1160 |
* in the Software without restriction, including without limitation the rights |
|
1161 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
1162 |
* copies of the Software, and to permit persons to whom the Software is |
|
1163 |
* furnished to do so, subject to the following conditions: |
|
1164 |
* |
|
1165 |
* The above copyright notice and this permission notice shall be included in |
|
1166 |
* all copies or substantial portions of the Software. |
|
1167 |
* |
|
1168 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
1169 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
1170 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
1171 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
1172 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
1173 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
1174 |
* THE SOFTWARE. |
|
1175 |
*/ |
|
1176 |
|
|
1177 |
/** |
|
1178 |
* External dependencies |
|
1179 |
*/ |
|
1180 |
|
|
1181 |
/** |
|
1182 |
* WordPress dependencies |
|
1183 |
*/ |
|
1184 |
|
|
1185 |
|
|
1186 |
/** |
|
1187 |
* Internal dependencies |
|
1188 |
*/ |
|
1189 |
|
|
1190 |
|
|
1191 |
|
16
|
1192 |
/** @typedef {import('./react').WPElement} WPElement */ |
9
|
1193 |
|
16
|
1194 |
var _createContext = Object(external_this_React_["createContext"])(undefined), |
9
|
1195 |
Provider = _createContext.Provider, |
|
1196 |
Consumer = _createContext.Consumer; |
16
|
1197 |
|
|
1198 |
var ForwardRef = Object(external_this_React_["forwardRef"])(function () { |
|
1199 |
return null; |
|
1200 |
}); |
9
|
1201 |
/** |
|
1202 |
* Valid attribute types. |
|
1203 |
* |
16
|
1204 |
* @type {Set<string>} |
9
|
1205 |
*/ |
|
1206 |
|
|
1207 |
var ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']); |
|
1208 |
/** |
|
1209 |
* Element tags which can be self-closing. |
|
1210 |
* |
16
|
1211 |
* @type {Set<string>} |
9
|
1212 |
*/ |
|
1213 |
|
|
1214 |
var SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']); |
|
1215 |
/** |
|
1216 |
* Boolean attributes are attributes whose presence as being assigned is |
|
1217 |
* meaningful, even if only empty. |
|
1218 |
* |
|
1219 |
* See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes |
|
1220 |
* Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 |
|
1221 |
* |
|
1222 |
* Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] |
|
1223 |
* .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 ) |
|
1224 |
* .reduce( ( result, tr ) => Object.assign( result, { |
|
1225 |
* [ tr.firstChild.textContent.trim() ]: true |
|
1226 |
* } ), {} ) ).sort(); |
|
1227 |
* |
16
|
1228 |
* @type {Set<string>} |
9
|
1229 |
*/ |
|
1230 |
|
|
1231 |
var BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch']); |
|
1232 |
/** |
|
1233 |
* Enumerated attributes are attributes which must be of a specific value form. |
|
1234 |
* Like boolean attributes, these are meaningful if specified, even if not of a |
|
1235 |
* valid enumerated value. |
|
1236 |
* |
|
1237 |
* See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute |
|
1238 |
* Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 |
|
1239 |
* |
|
1240 |
* Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] |
|
1241 |
* .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) ) |
|
1242 |
* .reduce( ( result, tr ) => Object.assign( result, { |
|
1243 |
* [ tr.firstChild.textContent.trim() ]: true |
|
1244 |
* } ), {} ) ).sort(); |
|
1245 |
* |
|
1246 |
* Some notable omissions: |
|
1247 |
* |
|
1248 |
* - `alt`: https://blog.whatwg.org/omit-alt |
|
1249 |
* |
16
|
1250 |
* @type {Set<string>} |
9
|
1251 |
*/ |
|
1252 |
|
|
1253 |
var ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap']); |
|
1254 |
/** |
|
1255 |
* Set of CSS style properties which support assignment of unitless numbers. |
|
1256 |
* Used in rendering of style properties, where `px` unit is assumed unless |
|
1257 |
* property is included in this set or value is zero. |
|
1258 |
* |
|
1259 |
* Generated via: |
|
1260 |
* |
|
1261 |
* Object.entries( document.createElement( 'div' ).style ) |
|
1262 |
* .filter( ( [ key ] ) => ( |
|
1263 |
* ! /^(webkit|ms|moz)/.test( key ) && |
|
1264 |
* ( e.style[ key ] = 10 ) && |
|
1265 |
* e.style[ key ] === '10' |
|
1266 |
* ) ) |
|
1267 |
* .map( ( [ key ] ) => key ) |
|
1268 |
* .sort(); |
|
1269 |
* |
16
|
1270 |
* @type {Set<string>} |
9
|
1271 |
*/ |
|
1272 |
|
|
1273 |
var CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set(['animation', 'animationIterationCount', 'baselineShift', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'columnCount', 'cx', 'cy', 'fillOpacity', 'flexGrow', 'flexShrink', 'floodOpacity', 'fontWeight', 'gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart', 'lineHeight', 'opacity', 'order', 'orphans', 'r', 'rx', 'ry', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'widows', 'x', 'y', 'zIndex', 'zoom']); |
|
1274 |
/** |
|
1275 |
* Returns true if the specified string is prefixed by one of an array of |
|
1276 |
* possible prefixes. |
|
1277 |
* |
|
1278 |
* @param {string} string String to check. |
|
1279 |
* @param {string[]} prefixes Possible prefixes. |
|
1280 |
* |
|
1281 |
* @return {boolean} Whether string has prefix. |
|
1282 |
*/ |
|
1283 |
|
|
1284 |
function hasPrefix(string, prefixes) { |
|
1285 |
return prefixes.some(function (prefix) { |
|
1286 |
return string.indexOf(prefix) === 0; |
|
1287 |
}); |
|
1288 |
} |
|
1289 |
/** |
|
1290 |
* Returns true if the given prop name should be ignored in attributes |
|
1291 |
* serialization, or false otherwise. |
|
1292 |
* |
|
1293 |
* @param {string} attribute Attribute to check. |
|
1294 |
* |
|
1295 |
* @return {boolean} Whether attribute should be ignored. |
|
1296 |
*/ |
|
1297 |
|
|
1298 |
function isInternalAttribute(attribute) { |
|
1299 |
return 'key' === attribute || 'children' === attribute; |
|
1300 |
} |
|
1301 |
/** |
|
1302 |
* Returns the normal form of the element's attribute value for HTML. |
|
1303 |
* |
|
1304 |
* @param {string} attribute Attribute name. |
|
1305 |
* @param {*} value Non-normalized attribute value. |
|
1306 |
* |
16
|
1307 |
* @return {*} Normalized attribute value. |
9
|
1308 |
*/ |
|
1309 |
|
|
1310 |
|
|
1311 |
function getNormalAttributeValue(attribute, value) { |
|
1312 |
switch (attribute) { |
|
1313 |
case 'style': |
|
1314 |
return renderStyle(value); |
|
1315 |
} |
|
1316 |
|
|
1317 |
return value; |
|
1318 |
} |
|
1319 |
/** |
|
1320 |
* Returns the normal form of the element's attribute name for HTML. |
|
1321 |
* |
|
1322 |
* @param {string} attribute Non-normalized attribute name. |
|
1323 |
* |
|
1324 |
* @return {string} Normalized attribute name. |
|
1325 |
*/ |
|
1326 |
|
|
1327 |
|
|
1328 |
function getNormalAttributeName(attribute) { |
|
1329 |
switch (attribute) { |
|
1330 |
case 'htmlFor': |
|
1331 |
return 'for'; |
|
1332 |
|
|
1333 |
case 'className': |
|
1334 |
return 'class'; |
|
1335 |
} |
|
1336 |
|
|
1337 |
return attribute.toLowerCase(); |
|
1338 |
} |
|
1339 |
/** |
|
1340 |
* Returns the normal form of the style property name for HTML. |
|
1341 |
* |
|
1342 |
* - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color' |
|
1343 |
* - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor' |
|
1344 |
* - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform' |
|
1345 |
* |
|
1346 |
* @param {string} property Property name. |
|
1347 |
* |
|
1348 |
* @return {string} Normalized property name. |
|
1349 |
*/ |
|
1350 |
|
|
1351 |
|
|
1352 |
function getNormalStylePropertyName(property) { |
16
|
1353 |
if (Object(external_this_lodash_["startsWith"])(property, '--')) { |
9
|
1354 |
return property; |
|
1355 |
} |
|
1356 |
|
|
1357 |
if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) { |
16
|
1358 |
return '-' + Object(external_this_lodash_["kebabCase"])(property); |
9
|
1359 |
} |
|
1360 |
|
16
|
1361 |
return Object(external_this_lodash_["kebabCase"])(property); |
9
|
1362 |
} |
|
1363 |
/** |
|
1364 |
* Returns the normal form of the style property value for HTML. Appends a |
|
1365 |
* default pixel unit if numeric, not a unitless property, and not zero. |
|
1366 |
* |
|
1367 |
* @param {string} property Property name. |
|
1368 |
* @param {*} value Non-normalized property value. |
|
1369 |
* |
|
1370 |
* @return {*} Normalized property value. |
|
1371 |
*/ |
|
1372 |
|
|
1373 |
|
|
1374 |
function getNormalStylePropertyValue(property, value) { |
|
1375 |
if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { |
|
1376 |
return value + 'px'; |
|
1377 |
} |
|
1378 |
|
|
1379 |
return value; |
|
1380 |
} |
|
1381 |
/** |
|
1382 |
* Serializes a React element to string. |
|
1383 |
* |
16
|
1384 |
* @param {import('react').ReactNode} element Element to serialize. |
|
1385 |
* @param {Object} [context] Context object. |
|
1386 |
* @param {Object} [legacyContext] Legacy context object. |
9
|
1387 |
* |
|
1388 |
* @return {string} Serialized element. |
|
1389 |
*/ |
|
1390 |
|
|
1391 |
|
|
1392 |
function renderElement(element, context) { |
|
1393 |
var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
|
1394 |
|
|
1395 |
if (null === element || undefined === element || false === element) { |
|
1396 |
return ''; |
|
1397 |
} |
|
1398 |
|
|
1399 |
if (Array.isArray(element)) { |
|
1400 |
return renderChildren(element, context, legacyContext); |
|
1401 |
} |
|
1402 |
|
|
1403 |
switch (Object(esm_typeof["a" /* default */])(element)) { |
|
1404 |
case 'string': |
|
1405 |
return Object(external_this_wp_escapeHtml_["escapeHTML"])(element); |
|
1406 |
|
|
1407 |
case 'number': |
|
1408 |
return element.toString(); |
|
1409 |
} |
|
1410 |
|
16
|
1411 |
var type = |
|
1412 |
/** @type {{type?: any, props?: any}} */ |
|
1413 |
element.type, |
9
|
1414 |
props = element.props; |
|
1415 |
|
|
1416 |
switch (type) { |
16
|
1417 |
case external_this_React_["StrictMode"]: |
|
1418 |
case external_this_React_["Fragment"]: |
9
|
1419 |
return renderChildren(props.children, context, legacyContext); |
|
1420 |
|
|
1421 |
case RawHTML: |
|
1422 |
var children = props.children, |
|
1423 |
wrapperProps = Object(objectWithoutProperties["a" /* default */])(props, ["children"]); |
|
1424 |
|
16
|
1425 |
return renderNativeComponent(Object(external_this_lodash_["isEmpty"])(wrapperProps) ? null : 'div', serialize_objectSpread({}, wrapperProps, { |
9
|
1426 |
dangerouslySetInnerHTML: { |
|
1427 |
__html: children |
|
1428 |
} |
|
1429 |
}), context, legacyContext); |
|
1430 |
} |
|
1431 |
|
|
1432 |
switch (Object(esm_typeof["a" /* default */])(type)) { |
|
1433 |
case 'string': |
|
1434 |
return renderNativeComponent(type, props, context, legacyContext); |
|
1435 |
|
|
1436 |
case 'function': |
|
1437 |
if (type.prototype && typeof type.prototype.render === 'function') { |
|
1438 |
return renderComponent(type, props, context, legacyContext); |
|
1439 |
} |
|
1440 |
|
|
1441 |
return renderElement(type(props, legacyContext), context, legacyContext); |
|
1442 |
} |
|
1443 |
|
|
1444 |
switch (type && type.$$typeof) { |
|
1445 |
case Provider.$$typeof: |
|
1446 |
return renderChildren(props.children, props.value, legacyContext); |
|
1447 |
|
|
1448 |
case Consumer.$$typeof: |
|
1449 |
return renderElement(props.children(context || type._currentValue), context, legacyContext); |
16
|
1450 |
|
|
1451 |
case ForwardRef.$$typeof: |
|
1452 |
return renderElement(type.render(props), context, legacyContext); |
9
|
1453 |
} |
|
1454 |
|
|
1455 |
return ''; |
|
1456 |
} |
|
1457 |
/** |
|
1458 |
* Serializes a native component type to string. |
|
1459 |
* |
16
|
1460 |
* @param {?string} type Native component type to serialize, or null if |
|
1461 |
* rendering as fragment of children content. |
|
1462 |
* @param {Object} props Props object. |
|
1463 |
* @param {Object} [context] Context object. |
|
1464 |
* @param {Object} [legacyContext] Legacy context object. |
9
|
1465 |
* |
|
1466 |
* @return {string} Serialized element. |
|
1467 |
*/ |
|
1468 |
|
|
1469 |
function renderNativeComponent(type, props, context) { |
|
1470 |
var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; |
|
1471 |
var content = ''; |
|
1472 |
|
|
1473 |
if (type === 'textarea' && props.hasOwnProperty('value')) { |
|
1474 |
// Textarea children can be assigned as value prop. If it is, render in |
|
1475 |
// place of children. Ensure to omit so it is not assigned as attribute |
|
1476 |
// as well. |
|
1477 |
content = renderChildren(props.value, context, legacyContext); |
16
|
1478 |
props = Object(external_this_lodash_["omit"])(props, 'value'); |
9
|
1479 |
} else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') { |
|
1480 |
// Dangerous content is left unescaped. |
|
1481 |
content = props.dangerouslySetInnerHTML.__html; |
|
1482 |
} else if (typeof props.children !== 'undefined') { |
|
1483 |
content = renderChildren(props.children, context, legacyContext); |
|
1484 |
} |
|
1485 |
|
|
1486 |
if (!type) { |
|
1487 |
return content; |
|
1488 |
} |
|
1489 |
|
|
1490 |
var attributes = renderAttributes(props); |
|
1491 |
|
|
1492 |
if (SELF_CLOSING_TAGS.has(type)) { |
|
1493 |
return '<' + type + attributes + '/>'; |
|
1494 |
} |
|
1495 |
|
|
1496 |
return '<' + type + attributes + '>' + content + '</' + type + '>'; |
|
1497 |
} |
16
|
1498 |
/** @typedef {import('./react').WPComponent} WPComponent */ |
|
1499 |
|
9
|
1500 |
/** |
|
1501 |
* Serializes a non-native component type to string. |
|
1502 |
* |
16
|
1503 |
* @param {WPComponent} Component Component type to serialize. |
|
1504 |
* @param {Object} props Props object. |
|
1505 |
* @param {Object} [context] Context object. |
|
1506 |
* @param {Object} [legacyContext] Legacy context object. |
9
|
1507 |
* |
|
1508 |
* @return {string} Serialized element |
|
1509 |
*/ |
|
1510 |
|
|
1511 |
function renderComponent(Component, props, context) { |
|
1512 |
var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; |
16
|
1513 |
var instance = new |
|
1514 |
/** @type {import('react').ComponentClass} */ |
|
1515 |
Component(props, legacyContext); |
9
|
1516 |
|
16
|
1517 |
if (typeof // Ignore reason: Current prettier reformats parens and mangles type assertion |
|
1518 |
// prettier-ignore |
|
1519 |
|
|
1520 |
/** @type {{getChildContext?: () => unknown}} */ |
|
1521 |
instance.getChildContext === 'function') { |
|
1522 |
Object.assign(legacyContext, |
|
1523 |
/** @type {{getChildContext?: () => unknown}} */ |
|
1524 |
instance.getChildContext()); |
9
|
1525 |
} |
|
1526 |
|
|
1527 |
var html = renderElement(instance.render(), context, legacyContext); |
|
1528 |
return html; |
|
1529 |
} |
|
1530 |
/** |
|
1531 |
* Serializes an array of children to string. |
|
1532 |
* |
16
|
1533 |
* @param {import('react').ReactNodeArray} children Children to serialize. |
|
1534 |
* @param {Object} [context] Context object. |
|
1535 |
* @param {Object} [legacyContext] Legacy context object. |
9
|
1536 |
* |
|
1537 |
* @return {string} Serialized children. |
|
1538 |
*/ |
|
1539 |
|
|
1540 |
function renderChildren(children, context) { |
|
1541 |
var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
|
1542 |
var result = ''; |
16
|
1543 |
children = Object(external_this_lodash_["castArray"])(children); |
9
|
1544 |
|
|
1545 |
for (var i = 0; i < children.length; i++) { |
|
1546 |
var child = children[i]; |
|
1547 |
result += renderElement(child, context, legacyContext); |
|
1548 |
} |
|
1549 |
|
|
1550 |
return result; |
|
1551 |
} |
|
1552 |
/** |
|
1553 |
* Renders a props object as a string of HTML attributes. |
|
1554 |
* |
|
1555 |
* @param {Object} props Props object. |
|
1556 |
* |
|
1557 |
* @return {string} Attributes string. |
|
1558 |
*/ |
|
1559 |
|
|
1560 |
|
|
1561 |
function renderAttributes(props) { |
|
1562 |
var result = ''; |
|
1563 |
|
|
1564 |
for (var key in props) { |
|
1565 |
var attribute = getNormalAttributeName(key); |
|
1566 |
|
|
1567 |
if (!Object(external_this_wp_escapeHtml_["isValidAttributeName"])(attribute)) { |
|
1568 |
continue; |
|
1569 |
} |
|
1570 |
|
|
1571 |
var value = getNormalAttributeValue(key, props[key]); // If value is not of serializeable type, skip. |
|
1572 |
|
|
1573 |
if (!ATTRIBUTES_TYPES.has(Object(esm_typeof["a" /* default */])(value))) { |
|
1574 |
continue; |
|
1575 |
} // Don't render internal attribute names. |
|
1576 |
|
|
1577 |
|
|
1578 |
if (isInternalAttribute(key)) { |
|
1579 |
continue; |
|
1580 |
} |
|
1581 |
|
|
1582 |
var isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); // Boolean attribute should be omitted outright if its value is false. |
|
1583 |
|
|
1584 |
if (isBooleanAttribute && value === false) { |
|
1585 |
continue; |
|
1586 |
} |
|
1587 |
|
|
1588 |
var isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); // Only write boolean value as attribute if meaningful. |
|
1589 |
|
|
1590 |
if (typeof value === 'boolean' && !isMeaningfulAttribute) { |
|
1591 |
continue; |
|
1592 |
} |
|
1593 |
|
|
1594 |
result += ' ' + attribute; // Boolean attributes should write attribute name, but without value. |
|
1595 |
// Mere presence of attribute name is effective truthiness. |
|
1596 |
|
|
1597 |
if (isBooleanAttribute) { |
|
1598 |
continue; |
|
1599 |
} |
|
1600 |
|
|
1601 |
if (typeof value === 'string') { |
|
1602 |
value = Object(external_this_wp_escapeHtml_["escapeAttribute"])(value); |
|
1603 |
} |
|
1604 |
|
|
1605 |
result += '="' + value + '"'; |
|
1606 |
} |
|
1607 |
|
|
1608 |
return result; |
|
1609 |
} |
|
1610 |
/** |
|
1611 |
* Renders a style object as a string attribute value. |
|
1612 |
* |
|
1613 |
* @param {Object} style Style object. |
|
1614 |
* |
|
1615 |
* @return {string} Style attribute value. |
|
1616 |
*/ |
|
1617 |
|
|
1618 |
function renderStyle(style) { |
|
1619 |
// Only generate from object, e.g. tolerate string value. |
16
|
1620 |
if (!Object(external_this_lodash_["isPlainObject"])(style)) { |
9
|
1621 |
return style; |
|
1622 |
} |
|
1623 |
|
|
1624 |
var result; |
|
1625 |
|
|
1626 |
for (var property in style) { |
|
1627 |
var value = style[property]; |
|
1628 |
|
|
1629 |
if (null === value || undefined === value) { |
|
1630 |
continue; |
|
1631 |
} |
|
1632 |
|
|
1633 |
if (result) { |
|
1634 |
result += ';'; |
|
1635 |
} else { |
|
1636 |
result = ''; |
|
1637 |
} |
|
1638 |
|
|
1639 |
var normalName = getNormalStylePropertyName(property); |
|
1640 |
var normalValue = getNormalStylePropertyValue(property, value); |
|
1641 |
result += normalName + ':' + normalValue; |
|
1642 |
} |
|
1643 |
|
|
1644 |
return result; |
|
1645 |
} |
|
1646 |
/* harmony default export */ var serialize = (renderElement); |
|
1647 |
|
|
1648 |
// CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/index.js |
16
|
1649 |
|
|
1650 |
|
9
|
1651 |
|
|
1652 |
|
|
1653 |
|
|
1654 |
|
|
1655 |
|
|
1656 |
|
|
1657 |
|
|
1658 |
/***/ }), |
|
1659 |
|
16
|
1660 |
/***/ 5: |
|
1661 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
9
|
1662 |
|
16
|
1663 |
"use strict"; |
|
1664 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
|
1665 |
function _defineProperty(obj, key, value) { |
|
1666 |
if (key in obj) { |
|
1667 |
Object.defineProperty(obj, key, { |
|
1668 |
value: value, |
|
1669 |
enumerable: true, |
|
1670 |
configurable: true, |
|
1671 |
writable: true |
|
1672 |
}); |
|
1673 |
} else { |
|
1674 |
obj[key] = value; |
|
1675 |
} |
|
1676 |
|
|
1677 |
return obj; |
|
1678 |
} |
9
|
1679 |
|
|
1680 |
/***/ }), |
|
1681 |
|
16
|
1682 |
/***/ 89: |
9
|
1683 |
/***/ (function(module, exports) { |
|
1684 |
|
|
1685 |
(function() { module.exports = this["wp"]["escapeHtml"]; }()); |
|
1686 |
|
|
1687 |
/***/ }) |
|
1688 |
|
|
1689 |
/******/ }); |